style: rustfmt the Phase 1 test additions
The per-file Phase 1 test commits were written without running rustfmt as I went; this pass formats the new test code (long assert_eq! lines wrapped, etc.). Formatting-only — no behavioural change.
This commit is contained in:
+52
-14
@@ -33,23 +33,59 @@ use heuropt::prelude::*;
|
||||
|
||||
/// First 25 cities of TSPLIB KroA100 (EUC_2D).
|
||||
const KROA_25: [(f64, f64); 25] = [
|
||||
(1380.0, 939.0), (2848.0, 96.0), (3510.0, 1671.0), (457.0, 334.0),
|
||||
(3888.0, 666.0), (984.0, 965.0), (2721.0, 1482.0), (1286.0, 525.0),
|
||||
(2716.0, 1432.0),(738.0, 1325.0), (1251.0, 1832.0), (2728.0, 1698.0),
|
||||
(3815.0, 169.0), (3683.0, 1533.0),(1247.0, 1945.0), (123.0, 862.0),
|
||||
(1234.0, 1946.0),(252.0, 1240.0), (611.0, 673.0), (2576.0, 1676.0),
|
||||
(928.0, 1700.0), (53.0, 857.0), (1807.0, 1711.0), (274.0, 1420.0),
|
||||
(1380.0, 939.0),
|
||||
(2848.0, 96.0),
|
||||
(3510.0, 1671.0),
|
||||
(457.0, 334.0),
|
||||
(3888.0, 666.0),
|
||||
(984.0, 965.0),
|
||||
(2721.0, 1482.0),
|
||||
(1286.0, 525.0),
|
||||
(2716.0, 1432.0),
|
||||
(738.0, 1325.0),
|
||||
(1251.0, 1832.0),
|
||||
(2728.0, 1698.0),
|
||||
(3815.0, 169.0),
|
||||
(3683.0, 1533.0),
|
||||
(1247.0, 1945.0),
|
||||
(123.0, 862.0),
|
||||
(1234.0, 1946.0),
|
||||
(252.0, 1240.0),
|
||||
(611.0, 673.0),
|
||||
(2576.0, 1676.0),
|
||||
(928.0, 1700.0),
|
||||
(53.0, 857.0),
|
||||
(1807.0, 1711.0),
|
||||
(274.0, 1420.0),
|
||||
(2574.0, 946.0),
|
||||
];
|
||||
|
||||
/// First 25 cities of TSPLIB KroB100 (EUC_2D).
|
||||
const KROB_25: [(f64, f64); 25] = [
|
||||
(3140.0, 1401.0),(556.0, 1056.0), (3675.0, 1522.0), (1182.0, 1853.0),
|
||||
(3595.0, 1340.0),(1936.0, 953.0), (2722.0, 1311.0), (2839.0, 2055.0),
|
||||
(2253.0, 1242.0),(3142.0, 1591.0),(627.0, 1336.0), (936.0, 211.0),
|
||||
(4014.0, 471.0), (1376.0, 1452.0),(3289.0, 593.0), (1453.0, 67.0),
|
||||
(1014.0, 1944.0),(2811.0, 1080.0),(3010.0, 1290.0), (1817.0, 1517.0),
|
||||
(510.0, 458.0), (1717.0, 1693.0),(1252.0, 1633.0), (1693.0, 1374.0),
|
||||
(3140.0, 1401.0),
|
||||
(556.0, 1056.0),
|
||||
(3675.0, 1522.0),
|
||||
(1182.0, 1853.0),
|
||||
(3595.0, 1340.0),
|
||||
(1936.0, 953.0),
|
||||
(2722.0, 1311.0),
|
||||
(2839.0, 2055.0),
|
||||
(2253.0, 1242.0),
|
||||
(3142.0, 1591.0),
|
||||
(627.0, 1336.0),
|
||||
(936.0, 211.0),
|
||||
(4014.0, 471.0),
|
||||
(1376.0, 1452.0),
|
||||
(3289.0, 593.0),
|
||||
(1453.0, 67.0),
|
||||
(1014.0, 1944.0),
|
||||
(2811.0, 1080.0),
|
||||
(3010.0, 1290.0),
|
||||
(1817.0, 1517.0),
|
||||
(510.0, 458.0),
|
||||
(1717.0, 1693.0),
|
||||
(1252.0, 1633.0),
|
||||
(1693.0, 1374.0),
|
||||
(539.0, 1378.0),
|
||||
];
|
||||
|
||||
@@ -182,6 +218,8 @@ fn main() {
|
||||
let owned: Vec<Candidate<Vec<usize>>> = result.pareto_front.to_vec();
|
||||
let hv = hypervolume_2d(&owned, &problem.objectives(), ref_point);
|
||||
println!();
|
||||
println!("Hypervolume vs. reference ({}, {}): {:.0}",
|
||||
ref_point[0], ref_point[1], hv);
|
||||
println!(
|
||||
"Hypervolume vs. reference ({}, {}): {:.0}",
|
||||
ref_point[0], ref_point[1], hv
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user