pub struct GdrrNestingProblem { /* private fields */ }Expand description
GDRR problem definition for 2D nesting.
Implementations§
Source§impl GdrrNestingProblem
impl GdrrNestingProblem
Sourcepub fn new(
geometries: Vec<Geometry2D>,
boundary: Boundary2D,
config: Config,
cancelled: Arc<AtomicBool>,
time_limit_ms: u64,
) -> Self
pub fn new( geometries: Vec<Geometry2D>, boundary: Boundary2D, config: Config, cancelled: Arc<AtomicBool>, time_limit_ms: u64, ) -> Self
Creates a new GDRR nesting problem.
Sourcepub fn num_instances(&self) -> usize
pub fn num_instances(&self) -> usize
Returns the total number of instances.
Trait Implementations§
Source§impl GdrrProblem for GdrrNestingProblem
impl GdrrProblem for GdrrNestingProblem
Source§type Solution = GdrrNestingSolution
type Solution = GdrrNestingSolution
Solution type
Source§fn create_initial_solution(&mut self) -> GdrrNestingSolution
fn create_initial_solution(&mut self) -> GdrrNestingSolution
Create an initial solution.
Source§fn clone_solution(&self, solution: &GdrrNestingSolution) -> GdrrNestingSolution
fn clone_solution(&self, solution: &GdrrNestingSolution) -> GdrrNestingSolution
Clone a solution.
Source§fn ruin_random(
&mut self,
solution: &mut GdrrNestingSolution,
ratio: f64,
rng: &mut StdRng,
) -> RuinResult
fn ruin_random( &mut self, solution: &mut GdrrNestingSolution, ratio: f64, rng: &mut StdRng, ) -> RuinResult
Apply random ruin operator.
Source§fn ruin_cluster(
&mut self,
solution: &mut GdrrNestingSolution,
ratio: f64,
rng: &mut StdRng,
) -> RuinResult
fn ruin_cluster( &mut self, solution: &mut GdrrNestingSolution, ratio: f64, rng: &mut StdRng, ) -> RuinResult
Apply cluster ruin operator.
Source§fn ruin_worst(
&mut self,
solution: &mut GdrrNestingSolution,
ratio: f64,
_rng: &mut StdRng,
) -> RuinResult
fn ruin_worst( &mut self, solution: &mut GdrrNestingSolution, ratio: f64, _rng: &mut StdRng, ) -> RuinResult
Apply worst ruin operator.
Source§fn recreate_best_fit(
&mut self,
solution: &mut GdrrNestingSolution,
_ruined: &RuinResult,
) -> RecreateResult
fn recreate_best_fit( &mut self, solution: &mut GdrrNestingSolution, _ruined: &RuinResult, ) -> RecreateResult
Apply best-fit recreate operator.
Source§fn recreate_blf(
&mut self,
solution: &mut GdrrNestingSolution,
_ruined: &RuinResult,
) -> RecreateResult
fn recreate_blf( &mut self, solution: &mut GdrrNestingSolution, _ruined: &RuinResult, ) -> RecreateResult
Apply BLF recreate operator.
Source§fn recreate_nfp(
&mut self,
solution: &mut GdrrNestingSolution,
_ruined: &RuinResult,
) -> RecreateResult
fn recreate_nfp( &mut self, solution: &mut GdrrNestingSolution, _ruined: &RuinResult, ) -> RecreateResult
Apply NFP-guided recreate operator (2D only).
Source§fn placement_score(
&self,
solution: &GdrrNestingSolution,
item_index: usize,
) -> f64
fn placement_score( &self, solution: &GdrrNestingSolution, item_index: usize, ) -> f64
Calculate placement score for an item (for worst ruin).
Source§fn get_neighbors(
&self,
solution: &GdrrNestingSolution,
item_index: usize,
radius: f64,
) -> Vec<usize>
fn get_neighbors( &self, solution: &GdrrNestingSolution, item_index: usize, radius: f64, ) -> Vec<usize>
Get spatial neighbors of an item (for cluster ruin).
Auto Trait Implementations§
impl Freeze for GdrrNestingProblem
impl RefUnwindSafe for GdrrNestingProblem
impl Send for GdrrNestingProblem
impl Sync for GdrrNestingProblem
impl Unpin for GdrrNestingProblem
impl UnwindSafe for GdrrNestingProblem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.