From d0d9a3f7b2a50fbce3bfeee5556fa38ec96d409f Mon Sep 17 00:00:00 2001 From: Jeroen Gardeyn Date: Mon, 12 Feb 2024 08:50:51 +0100 Subject: [PATCH] small LBF changes --- assets/config_lbf.json | 4 ++-- lbf/src/lbf_cost.rs | 6 ++++-- lbf/src/lbf_optimizer.rs | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/assets/config_lbf.json b/assets/config_lbf.json index 2587b6b..a8e7ca9 100644 --- a/assets/config_lbf.json +++ b/assets/config_lbf.json @@ -22,9 +22,9 @@ }, "deterministic_mode": true, "n_samples_per_item": 5000, - "ls_samples_fraction": 0.2, + "ls_samples_fraction": 0.5, "svg_draw_options": { - "quadtree": true, + "quadtree": false, "haz_prox_grid": false, "surrogate": false } diff --git a/lbf/src/lbf_cost.rs b/lbf/src/lbf_cost.rs index 78348bf..e0e5644 100644 --- a/lbf/src/lbf_cost.rs +++ b/lbf/src/lbf_cost.rs @@ -4,7 +4,6 @@ use ordered_float::NotNan; use jaguars::geometry::geo_traits::Shape; use jaguars::geometry::primitives::simple_polygon::SimplePolygon; - #[derive(PartialEq)] pub struct LBFCost { pub x_max: NotNan, @@ -20,8 +19,11 @@ impl LBFCost { y_max: NotNan::new(y_max).unwrap(), } } + + /// Compare two LBFCosts by their x_max and y_max values, where + /// x_max is weighted more than y_max pub fn cmp(&self, other: &LBFCost) -> Ordering { - let x_mltp = NotNan::new(100.0).unwrap(); + let x_mltp = NotNan::new(10.0).unwrap(); (x_mltp * self.x_max + self.y_max).cmp(&(x_mltp * other.x_max + other.y_max)) } diff --git a/lbf/src/lbf_optimizer.rs b/lbf/src/lbf_optimizer.rs index d6ac1a7..d9f88dc 100644 --- a/lbf/src/lbf_optimizer.rs +++ b/lbf/src/lbf_optimizer.rs @@ -33,7 +33,8 @@ pub const STDDEV_TRANSL_END_FRAC: f64 = 0.001; pub const STDDEV_ROT_START_FRAC: f64 = 2.0 * (PI / 180.0); pub const STDDEV_ROT_END_FRAC: f64 = 0.5 * (PI / 180.0); -pub const ITEM_LIMIT: usize = 1000; +//limits the number of items to be placed, for debugging purposes +pub const ITEM_LIMIT: usize = usize::MAX; pub struct LBFOptimizer { instance: Instance,