pub struct SaConfig {
pub initial_temp: f64,
pub final_temp: f64,
pub cooling_rate: f64,
pub iterations_per_temp: usize,
pub max_iterations: Option<u64>,
pub cooling_schedule: CoolingSchedule,
pub time_limit: Option<Duration>,
pub target_fitness: Option<f64>,
pub enable_reheating: bool,
pub reheat_threshold: u64,
pub reheat_factor: f64,
}Expand description
Configuration for Simulated Annealing.
Fields§
§initial_temp: f64Initial temperature.
final_temp: f64Final (minimum) temperature.
cooling_rate: f64Cooling rate (alpha for Geometric, delta for Linear, beta for LundyMees).
iterations_per_temp: usizeNumber of iterations at each temperature level.
max_iterations: Option<u64>Maximum total iterations (None = temperature-based stopping only).
cooling_schedule: CoolingScheduleCooling schedule type.
time_limit: Option<Duration>Maximum time limit (None = unlimited).
target_fitness: Option<f64>Target fitness to stop early (None = run until temperature limit).
enable_reheating: boolEnable reheating when stagnation detected.
reheat_threshold: u64Stagnation threshold for reheating.
reheat_factor: f64Reheat factor (multiplier for current temperature).
Implementations§
Source§impl SaConfig
impl SaConfig
Sourcepub fn with_initial_temp(self, temp: f64) -> Self
pub fn with_initial_temp(self, temp: f64) -> Self
Sets the initial temperature.
Sourcepub fn with_final_temp(self, temp: f64) -> Self
pub fn with_final_temp(self, temp: f64) -> Self
Sets the final temperature.
Sourcepub fn with_cooling_rate(self, rate: f64) -> Self
pub fn with_cooling_rate(self, rate: f64) -> Self
Sets the cooling rate.
Sourcepub fn with_iterations_per_temp(self, iterations: usize) -> Self
pub fn with_iterations_per_temp(self, iterations: usize) -> Self
Sets the iterations per temperature level.
Sourcepub fn with_max_iterations(self, iterations: u64) -> Self
pub fn with_max_iterations(self, iterations: u64) -> Self
Sets the maximum iterations.
Sourcepub fn with_cooling_schedule(self, schedule: CoolingSchedule) -> Self
pub fn with_cooling_schedule(self, schedule: CoolingSchedule) -> Self
Sets the cooling schedule.
Sourcepub fn with_time_limit(self, duration: Duration) -> Self
pub fn with_time_limit(self, duration: Duration) -> Self
Sets the time limit.
Sourcepub fn with_target_fitness(self, fitness: f64) -> Self
pub fn with_target_fitness(self, fitness: f64) -> Self
Sets the target fitness.
Sourcepub fn with_reheating(self, threshold: u64, factor: f64) -> Self
pub fn with_reheating(self, threshold: u64, factor: f64) -> Self
Enables reheating.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SaConfig
impl RefUnwindSafe for SaConfig
impl Send for SaConfig
impl Sync for SaConfig
impl Unpin for SaConfig
impl UnwindSafe for SaConfig
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
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>
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>
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.