pub struct GeneticOperators {
pub crossover_type: CrossoverType,
pub mutation_type: MutationType,
}Expand description
Runtime-selectable genetic operators for scheduling GA.
Wraps crossover and mutation strategy selection so that u-aps can switch operators via configuration without changing the GA problem definition.
§Example
use u_schedule::ga::operators::{GeneticOperators, CrossoverType, MutationType};
let ops = GeneticOperators {
crossover_type: CrossoverType::LOX,
mutation_type: MutationType::Invert,
};Fields§
§crossover_type: CrossoverTypeCrossover strategy.
mutation_type: MutationTypeOSV mutation strategy.
Implementations§
Source§impl GeneticOperators
impl GeneticOperators
Sourcepub fn crossover<R: Rng>(
&self,
p1: &ScheduleChromosome,
p2: &ScheduleChromosome,
activities: &[ActivityInfo],
rng: &mut R,
) -> (ScheduleChromosome, ScheduleChromosome)
pub fn crossover<R: Rng>( &self, p1: &ScheduleChromosome, p2: &ScheduleChromosome, activities: &[ActivityInfo], rng: &mut R, ) -> (ScheduleChromosome, ScheduleChromosome)
Performs crossover using the configured strategy.
Sourcepub fn mutate<R: Rng>(
&self,
chromosome: &mut ScheduleChromosome,
activities: &[ActivityInfo],
rng: &mut R,
)
pub fn mutate<R: Rng>( &self, chromosome: &mut ScheduleChromosome, activities: &[ActivityInfo], rng: &mut R, )
Performs mutation using the configured strategy.
Always also applies MAV mutation to diversify resource assignments.
Trait Implementations§
Source§impl Clone for GeneticOperators
impl Clone for GeneticOperators
Source§fn clone(&self) -> GeneticOperators
fn clone(&self) -> GeneticOperators
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 GeneticOperators
impl Debug for GeneticOperators
Auto Trait Implementations§
impl Freeze for GeneticOperators
impl RefUnwindSafe for GeneticOperators
impl Send for GeneticOperators
impl Sync for GeneticOperators
impl Unpin for GeneticOperators
impl UnsafeUnpin for GeneticOperators
impl UnwindSafe for GeneticOperators
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