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§
Sourcefn 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 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
Sourcefn evaluate_fitness<'life0, 'async_trait>(
&'life0 mut self,
) -> 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,
Evaluate fitness
Sourcefn 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 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
Sourcefn 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 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