Struct argmin::solver::particleswarm::ParticleSwarm
source · [−]pub struct ParticleSwarm<P, F> { /* private fields */ }
Expand description
Implementations
sourceimpl<P, F> ParticleSwarm<P, F> where
P: Position<F> + DeserializeOwned + Serialize,
F: ArgminFloat,
impl<P, F> ParticleSwarm<P, F> where
P: Position<F> + DeserializeOwned + Serialize,
F: ArgminFloat,
sourcepub fn new(
search_region: (P, P),
num_particles: usize,
weight_momentum: F,
weight_particle: F,
weight_swarm: F
) -> Result<Self, Error>
pub fn new(
search_region: (P, P),
num_particles: usize,
weight_momentum: F,
weight_particle: F,
weight_swarm: F
) -> Result<Self, Error>
Constructor
Parameters:
search_region
: size of search regionnum_particles
: number of particlesweight_momentum
: momentum weight for particle updateweight_particle
: particle weight for particle updateweight_swarm
: swarm weight for particle update
Trait Implementations
sourceimpl<'de, P, F> Deserialize<'de> for ParticleSwarm<P, F> where
P: Deserialize<'de>,
F: Deserialize<'de>,
impl<'de, P, F> Deserialize<'de> for ParticleSwarm<P, F> where
P: Deserialize<'de>,
F: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<P, F> Serialize for ParticleSwarm<P, F> where
P: Serialize,
F: Serialize,
impl<P, F> Serialize for ParticleSwarm<P, F> where
P: Serialize,
F: Serialize,
sourceimpl<O, P, F> Solver<O> for ParticleSwarm<P, F> where
O: ArgminOp<Output = F, Param = P, Float = F>,
P: Position<F> + DeserializeOwned + Serialize,
F: ArgminFloat,
impl<O, P, F> Solver<O> for ParticleSwarm<P, F> where
O: ArgminOp<Output = F, Param = P, Float = F>,
P: Position<F> + DeserializeOwned + Serialize,
F: ArgminFloat,
sourcefn next_iter(
&mut self,
_op: &mut OpWrapper<O>,
_state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
fn next_iter(
&mut self,
_op: &mut OpWrapper<O>,
_state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
Perform one iteration of algorithm
sourcefn init(
&mut self,
_op: &mut OpWrapper<O>,
_state: &IterState<O>
) -> Result<Option<ArgminIterData<O>>, Error>
fn init(
&mut self,
_op: &mut OpWrapper<O>,
_state: &IterState<O>
) -> Result<Option<ArgminIterData<O>>, Error>
Initializes the algorithm Read more
sourcefn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason
fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &IterState<O>) -> TerminationReason
fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason
Checks whether the algorithm must be terminated
Auto Trait Implementations
impl<P, F> RefUnwindSafe for ParticleSwarm<P, F> where
F: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, F> Send for ParticleSwarm<P, F> where
F: Send,
P: Send,
impl<P, F> Sync for ParticleSwarm<P, F> where
F: Sync,
P: Sync,
impl<P, F> Unpin for ParticleSwarm<P, F> where
F: Unpin,
P: Unpin,
impl<P, F> UnwindSafe for ParticleSwarm<P, F> where
F: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more