pub struct Config {
pub strategy: Strategy,
pub spacing: f64,
pub margin: f64,
pub time_limit_ms: u64,
pub target_utilization: Option<f64>,
pub threads: usize,
pub population_size: usize,
pub max_generations: u32,
pub crossover_rate: f64,
pub mutation_rate: f64,
pub elite_count: usize,
}Expand description
Common configuration for solvers.
Fields§
§strategy: StrategyOptimization strategy.
spacing: f64Minimum spacing between geometries.
margin: f64Margin from boundary edges.
time_limit_ms: u64Maximum computation time in milliseconds (0 = unlimited).
target_utilization: Option<f64>Target utilization (0.0 - 1.0). Solver stops if reached.
threads: usizeNumber of threads to use (0 = auto).
population_size: usizePopulation size for GA.
max_generations: u32Number of generations for GA.
crossover_rate: f64Crossover rate for GA (0.0 - 1.0).
mutation_rate: f64Mutation rate for GA (0.0 - 1.0).
elite_count: usizeElite count for GA.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_strategy(self, strategy: Strategy) -> Self
pub fn with_strategy(self, strategy: Strategy) -> Self
Sets the optimization strategy.
Sourcepub fn with_spacing(self, spacing: f64) -> Self
pub fn with_spacing(self, spacing: f64) -> Self
Sets the spacing between geometries.
Sourcepub fn with_margin(self, margin: f64) -> Self
pub fn with_margin(self, margin: f64) -> Self
Sets the margin from boundary edges.
Sourcepub fn with_time_limit(self, ms: u64) -> Self
pub fn with_time_limit(self, ms: u64) -> Self
Sets the time limit in milliseconds.
Sourcepub fn with_target_utilization(self, util: f64) -> Self
pub fn with_target_utilization(self, util: f64) -> Self
Sets the target utilization.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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.