Struct cisat::Cohort [−][src]
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]
S: Solution,
A: AgentMethods<S>,
T: TeamMethods<S, A>,
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]
S: Solution,
A: AgentMethods<S>,
T: TeamMethods<S, A>,
impl<S: Debug, A: Debug, T: Debug> Debug for Cohort<S, A, T> where
S: Solution,
A: AgentMethods<S>,
T: TeamMethods<S, A>,
[src]
S: Solution,
A: AgentMethods<S>,
T: TeamMethods<S, A>,
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,
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,
A: Sync,
S: Sync,
T: Sync,
impl<S, A, T> Unpin for Cohort<S, A, T> where
A: Unpin,
S: Unpin,
T: Unpin,
A: Unpin,
S: Unpin,
T: Unpin,
impl<S, A, T> UnwindSafe for Cohort<S, A, T> where
A: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
A: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,