[][src]Struct argmin::solver::particleswarm::ParticleSwarm

pub struct ParticleSwarm<'a, O> where
    O: ArgminOp<Output = f64>,
    <O as ArgminOp>::Param: Position
{ /* fields omitted */ }

Particle Swarm Optimization (PSO)

Example

References:

TODO

Methods

impl<'a, O> ParticleSwarm<'a, O> where
    O: ArgminOp<Output = f64>,
    <O as ArgminOp>::Param: Position
[src]

pub fn new(
    search_region: (O::Param, O::Param),
    num_particles: usize,
    weight_momentum: f64,
    weight_particle: f64,
    weight_swarm: f64
) -> Result<Self, Error>
[src]

Constructor

Parameters:

  • cost_function: cost function
  • init_temp: initial temperature

pub fn set_iter_callback(
    &mut self,
    callback: &'a mut dyn FnMut(&O::Param, f64, &Vec<Particle<O::Param>>)
)
[src]

Set callback

Trait Implementations

impl<'a, O> Solver<O> for ParticleSwarm<'a, O> where
    O: ArgminOp<Output = f64>,
    <O as ArgminOp>::Param: Position,
    <O as ArgminOp>::Hessian: Clone + Default
[src]

fn next_iter(
    &mut self,
    _op: &mut OpWrapper<O>,
    _state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
[src]

Perform one iteration of algorithm

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason[src]

Checks whether basic termination reasons apply. Read more

fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason[src]

Checks whether the algorithm must be terminated

impl<'de, 'a, O> Deserialize<'de> for ParticleSwarm<'a, O> where
    O: ArgminOp<Output = f64>,
    <O as ArgminOp>::Param: Position,
    O::Param: Deserialize<'de>, 
[src]

impl<'a, O> Serialize for ParticleSwarm<'a, O> where
    O: ArgminOp<Output = f64>,
    <O as ArgminOp>::Param: Position,
    O::Param: Serialize
[src]

Auto Trait Implementations

impl<'a, O> !Sync for ParticleSwarm<'a, O>

impl<'a, O> !Send for ParticleSwarm<'a, O>

impl<'a, O> Unpin for ParticleSwarm<'a, O> where
    <O as ArgminOp>::Param: Unpin

impl<'a, O> !RefUnwindSafe for ParticleSwarm<'a, O>

impl<'a, O> !UnwindSafe for ParticleSwarm<'a, O>

Blanket Implementations

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]