EvolutionaryAlgorithm

Trait EvolutionaryAlgorithm 

Source
pub trait EvolutionaryAlgorithm {
    // Required methods
    fn initialize_population<'life0, 'async_trait>(
        &'life0 mut self,
        size: usize,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn evaluate_fitness<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn selection<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Vec<Uuid>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn crossover<'life0, 'async_trait>(
        &'life0 mut self,
        parent1: Uuid,
        parent2: Uuid,
    ) -> Pin<Box<dyn Future<Output = SwarmAgent> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn mutation<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        agent: &'life1 mut SwarmAgent,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn evolve<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Evolutionary algorithm trait

Required Methods§

Source

fn initialize_population<'life0, 'async_trait>( &'life0 mut self, size: usize, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize population

Source

fn evaluate_fitness<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Evaluate fitness

Source

fn selection<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Vec<Uuid>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Select parents

Source

fn crossover<'life0, 'async_trait>( &'life0 mut self, parent1: Uuid, parent2: Uuid, ) -> Pin<Box<dyn Future<Output = SwarmAgent> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Crossover operation

Source

fn mutation<'life0, 'life1, 'async_trait>( &'life0 mut self, agent: &'life1 mut SwarmAgent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mutation operation

Source

fn evolve<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Evolution step

Implementors§