pub struct AlnsConfig {
pub max_iterations: usize,
pub time_limit_ms: u64,
pub segment_size: usize,
pub score_best: f64,
pub score_better: f64,
pub score_accepted: f64,
pub reaction_factor: f64,
pub min_weight: f64,
pub initial_temperature: f64,
pub cooling_rate: f64,
pub final_temperature: f64,
pub seed: Option<u64>,
}Expand description
Configuration for the ALNS algorithm.
Fields§
§max_iterations: usizeMaximum number of iterations
time_limit_ms: u64Time limit in milliseconds (0 = no limit)
segment_size: usizeNumber of iterations per segment (for weight updates)
score_best: f64Score for finding new best solution
score_better: f64Score for finding better solution than current
score_accepted: f64Score for accepting worse solution
reaction_factor: f64Reaction factor (how quickly weights adapt, 0-1)
min_weight: f64Minimum operator weight
initial_temperature: f64Initial temperature for SA acceptance
cooling_rate: f64Cooling rate for SA acceptance (0-1)
final_temperature: f64Final temperature threshold
seed: Option<u64>Random seed for reproducibility (None = random)
Implementations§
Source§impl AlnsConfig
impl AlnsConfig
Sourcepub fn with_max_iterations(self, iterations: usize) -> Self
pub fn with_max_iterations(self, iterations: usize) -> Self
Set maximum iterations.
Sourcepub fn with_time_limit_ms(self, ms: u64) -> Self
pub fn with_time_limit_ms(self, ms: u64) -> Self
Set time limit in milliseconds.
Sourcepub fn with_segment_size(self, size: usize) -> Self
pub fn with_segment_size(self, size: usize) -> Self
Set segment size for weight updates.
Sourcepub fn with_scores(self, best: f64, better: f64, accepted: f64) -> Self
pub fn with_scores(self, best: f64, better: f64, accepted: f64) -> Self
Set scoring parameters.
Sourcepub fn with_reaction_factor(self, factor: f64) -> Self
pub fn with_reaction_factor(self, factor: f64) -> Self
Set reaction factor.
Sourcepub fn with_temperature(
self,
initial: f64,
cooling_rate: f64,
final_temp: f64,
) -> Self
pub fn with_temperature( self, initial: f64, cooling_rate: f64, final_temp: f64, ) -> Self
Set temperature parameters for SA acceptance.
Trait Implementations§
Source§impl Clone for AlnsConfig
impl Clone for AlnsConfig
Source§fn clone(&self) -> AlnsConfig
fn clone(&self) -> AlnsConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlnsConfig
impl Debug for AlnsConfig
Auto Trait Implementations§
impl Freeze for AlnsConfig
impl RefUnwindSafe for AlnsConfig
impl Send for AlnsConfig
impl Sync for AlnsConfig
impl Unpin for AlnsConfig
impl UnwindSafe for AlnsConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.