pub trait AgentMethods<S: Solution>: Send {
// Required methods
fn new(id: usize, parameters: Parameters) -> Self;
fn iterate(&mut self);
fn get_best_solution_so_far(&mut self) -> S;
fn get_current_solution(&mut self) -> S;
fn communicate(&mut self, solutions: Vec<S>);
}
Expand description
This is a trait for implementing new agents
Required Methods§
Sourcefn new(id: usize, parameters: Parameters) -> Self
fn new(id: usize, parameters: Parameters) -> Self
Generates a new agent
Sourcefn get_best_solution_so_far(&mut self) -> S
fn get_best_solution_so_far(&mut self) -> S
Gets the best solution found by the agent so far
Sourcefn get_current_solution(&mut self) -> S
fn get_current_solution(&mut self) -> S
Gets the current solution of the agent
Sourcefn communicate(&mut self, solutions: Vec<S>)
fn communicate(&mut self, solutions: Vec<S>)
Agent accepts rival solutions and interacts
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.