Skip to content

Commit

Permalink
small LBF changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenGar committed Feb 12, 2024
1 parent 8fd659a commit d0d9a3f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions assets/config_lbf.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 4 additions & 2 deletions lbf/src/lbf_cost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f64>,
Expand All @@ -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))
}
Expand Down
3 changes: 2 additions & 1 deletion lbf/src/lbf_optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d0d9a3f

Please sign in to comment.