pub struct AlnsNestingProblem { /* private fields */ }Expand description
ALNS problem definition for 2D nesting.
Implementations§
Source§impl AlnsNestingProblem
impl AlnsNestingProblem
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 ALNS nesting problem.
Sourcepub fn num_instances(&self) -> usize
pub fn num_instances(&self) -> usize
Returns the total number of instances.
Trait Implementations§
Source§impl AlnsProblem for AlnsNestingProblem
impl AlnsProblem for AlnsNestingProblem
Source§type Solution = AlnsNestingSolution
type Solution = AlnsNestingSolution
Solution type
Source§fn create_initial_solution(&mut self) -> AlnsNestingSolution
fn create_initial_solution(&mut self) -> AlnsNestingSolution
Create an initial solution.
Source§fn clone_solution(&self, solution: &AlnsNestingSolution) -> AlnsNestingSolution
fn clone_solution(&self, solution: &AlnsNestingSolution) -> AlnsNestingSolution
Clone a solution.
Source§fn destroy_operators(&self) -> Vec<DestroyOperatorId>
fn destroy_operators(&self) -> Vec<DestroyOperatorId>
Get available destroy operators.
Source§fn repair_operators(&self) -> Vec<RepairOperatorId>
fn repair_operators(&self) -> Vec<RepairOperatorId>
Get available repair operators.
Source§fn destroy(
&mut self,
solution: &mut AlnsNestingSolution,
operator: DestroyOperatorId,
degree: f64,
rng: &mut StdRng,
) -> DestroyResult
fn destroy( &mut self, solution: &mut AlnsNestingSolution, operator: DestroyOperatorId, degree: f64, rng: &mut StdRng, ) -> DestroyResult
Apply a destroy operator.
Source§fn repair(
&mut self,
solution: &mut AlnsNestingSolution,
_destroyed: &DestroyResult,
operator: RepairOperatorId,
) -> RepairResult
fn repair( &mut self, solution: &mut AlnsNestingSolution, _destroyed: &DestroyResult, operator: RepairOperatorId, ) -> RepairResult
Apply a repair operator.
Calculate relatedness between two items (for Shaw/Related removal).
Auto Trait Implementations§
impl Freeze for AlnsNestingProblem
impl RefUnwindSafe for AlnsNestingProblem
impl Send for AlnsNestingProblem
impl Sync for AlnsNestingProblem
impl Unpin for AlnsNestingProblem
impl UnwindSafe for AlnsNestingProblem
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.