[−][src]Struct optlib::particleswarm::velocitycalc::NegativeReinforcement
Velocity update with negative reinforcement, global and current best and worst positions. v_i = xi * (v_i + phi_best_personal * rb_p * (p_best_i - x_i) + phi_best_current * rb_c * (c_best_i - x_i) + phi_best_global * rb_g * (g_best_i - x_i) - phi_worst_personal * rw_p * (p_worst_i - x_i) - phi_worst_current * rw_c * (c_worst_i - x_i) - phi_worst_global * rw_g * (g_worst_i - x_i))
v_i
- velocity projection for dimension i,
p_best_i
- personal best coordinate,
c_best_i
- best coordinate for current swarm,
g_best_i
- global best coordinate,
p_worst_i
- personal worst coordinate,
c_worst_i
- worst coordinate for current swarm,
g_worst_i
- global worst coordinate,
xi
- parameter,
x_i
- current coordinate,
phi_best_personal
, phi_best_current
, phi_best_global
, phi_worst_personal
, phi_worst_current
, phi_worst_global
- parameters,
rb_p
, rb_c
, rb_g
, rw_p
, rw_c
, rw_g
- random values in (0, 1),
Methods
impl<T> NegativeReinforcement<T>
[src]
pub fn new(
phi_best_personal: T,
phi_best_current: T,
phi_best_global: T,
phi_worst_personal: T,
phi_worst_current: T,
phi_worst_global: T,
xi: T
) -> Self
[src]
phi_best_personal: T,
phi_best_current: T,
phi_best_global: T,
phi_worst_personal: T,
phi_worst_current: T,
phi_worst_global: T,
xi: T
) -> Self
Trait Implementations
impl<T: NumCast + Num + Copy> VelocityCalculator<T> for NegativeReinforcement<T>
[src]
fn calc_new_velocity(
&mut self,
swarm: &Swarm<T>,
particle: &Particle<T>
) -> Vec<T>
[src]
&mut self,
swarm: &Swarm<T>,
particle: &Particle<T>
) -> Vec<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for NegativeReinforcement<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for NegativeReinforcement<T>
impl<T> !Sync for NegativeReinforcement<T>
impl<T> Unpin for NegativeReinforcement<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for NegativeReinforcement<T> where
T: 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,
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, 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.
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.
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>,