Trait Environment

Source
pub trait Environment {
    // Required methods
    fn generate(pop: Vec<Box<dyn Agent>>) -> Result<Box<Self>, &'static str>
       where Self: Sized;
    fn collect(&self) -> Result<String, &'static str>;
    fn tick(&mut self) -> Result<(), &'static str>;
    fn add_agent(&mut self, agent: Box<dyn Agent>) -> Result<(), &'static str>;
    fn add_agents(
        &mut self,
        agents: Vec<Box<dyn Agent>>,
    ) -> Result<(), &'static str>;
}

Required Methods§

Source

fn generate(pop: Vec<Box<dyn Agent>>) -> Result<Box<Self>, &'static str>
where Self: Sized,

Source

fn collect(&self) -> Result<String, &'static str>

Source

fn tick(&mut self) -> Result<(), &'static str>

Source

fn add_agent(&mut self, agent: Box<dyn Agent>) -> Result<(), &'static str>

Source

fn add_agents( &mut self, agents: Vec<Box<dyn Agent>>, ) -> Result<(), &'static str>

Implementors§