Struct cisat::Cohort[][src]

pub struct Cohort<S = Ackley, A = Agent<S>, T = Team<S, A>> where
    S: Solution,
    A: AgentMethods<S>,
    T: TeamMethods<S, A>, 
{ /* fields omitted */ }

This is the Cohort class, a container for multiple teams

The cohort allows you to run a set of teams easily to achieve statistical significance:

use cisat::{Parameters, Cohort, problems::Ackley};
let mut x = Cohort::<Ackley>::new(Parameters::default());
x.solve();

Above, we specify one generic parameters Ackley, which tells the Cohort which problem to solve. However, we can get more complciated than that! For instance, we feed in a struct that implements AgentMethods to specific which type of agent to use:

use cisat::{Parameters, Cohort, problems::Ackley, Agent};
let mut x = Cohort::<Ackley, Agent<Ackley>>::new(Parameters::default());
x.solve();

Here, we just fed in the in-build Agent class which already implements AgentMethods. You can implement the trait yourself to define a new agent though. The same applies for 'Team' and 'TeamMethods':

use cisat::{Parameters, Cohort, problems::Ackley, Agent, Team};
let mut x = Cohort::<Ackley, Agent<Ackley>, Team<Ackley, Agent<Ackley>>>::new(Parameters::default());
x.solve();

Implementations

impl<S, A, T> Cohort<S, A, T> where
    S: Solution,
    A: AgentMethods<S>,
    T: TeamMethods<S, A>, 
[src]

pub fn new(parameters: Parameters) -> Cohort<S, A, T>[src]

This generates a new cohort

pub fn solve(&mut self)[src]

This runs the cohort using parallelism

pub fn iterate(&mut self)[src]

This runs a single iteration

pub fn get_best_solution_so_far(&mut self) -> f64[src]

Get the current best solution

Trait Implementations

impl<S: Clone, A: Clone, T: Clone> Clone for Cohort<S, A, T> where
    S: Solution,
    A: AgentMethods<S>,
    T: TeamMethods<S, A>, 
[src]

impl<S: Debug, A: Debug, T: Debug> Debug for Cohort<S, A, T> where
    S: Solution,
    A: AgentMethods<S>,
    T: TeamMethods<S, A>, 
[src]

impl Default for Cohort[src]

Auto Trait Implementations

impl<S, A, T> RefUnwindSafe for Cohort<S, A, T> where
    A: RefUnwindSafe,
    S: RefUnwindSafe,
    T: RefUnwindSafe

impl<S, A, T> Send for Cohort<S, A, T>

impl<S, A, T> Sync for Cohort<S, A, T> where
    A: Sync,
    S: Sync,
    T: Sync

impl<S, A, T> Unpin for Cohort<S, A, T> where
    A: Unpin,
    S: Unpin,
    T: Unpin

impl<S, A, T> UnwindSafe for Cohort<S, A, T> where
    A: UnwindSafe,
    S: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,