[][src]Trait maver::Environment

pub trait Environment: Send + Sync {
    fn test(&self, _: &mut Organism);
}

A trait that is implemented by user to allow test of the Environment.

Required methods

fn test(&self, _: &mut Organism)

This test will set the organism fitness:

impl Environment for MyEnv {
    fn test(&self,organism: &mut Organism) {
        ...
        organism.fitness = fitness;
    }
}
Loading content...

Implementors

Loading content...