pso.velocity {gena} | R Documentation |
Velocity
Description
Calculates (updates) velocities of the particles.
Usage
pso.velocity(
population,
method = "hypersphere",
par = list(w = 1/(2 * log(2)), c1 = 0.5 + log(2), c2 = 0.5 + log(2)),
velocity,
best.pn,
best.nh,
best.pn.fitness,
best.nh.fitness,
iter = 1
)
Arguments
population |
numeric matrix which rows are particles i.e. vectors of parameters values. |
method |
string representing method to be used for velocities calculation. See 'Details' for additional information. |
par |
additional parameters to be passed depending on the |
velocity |
matrix which i-th row is a velocity of the i-th particle. |
best.pn |
numeric matrix which i-th row is a best personal position known by the i-th particle. |
best.nh |
numeric matrix which i-th row is a best personal position in a neighbourhood of the i-th particle. |
best.pn.fitness |
numeric vector which i-th row is the value of
a fitness function at point |
best.nh.fitness |
numeric vector which i-th row is the value of
a fitness function at point |
iter |
iteration number of the genetic algorithm. |
Details
If method = "classic"
then classical velocity formula
is used:
where is a velocity of the
-th particle
respect to the
-th component at time
. Random variables
and
are i.i.d. respect to all indexes and
follow standard uniform distribution
.
Variable
is
-th component of the best known
particle's (personal) position up to time period
.
Similarly
is
-th component of the best of best
known particle's position in a neighbourhood of the
-th particle.
Hyperparameters
,
and
may be provided
via
par
argument as a list with elements par$w
, par$c1
and par$c2
correspondingly.
If method = "hypersphere"
then rotation invariant formula from
sections 3.4.2 and 3.4.3 of M. Clerc (2012) is used with arguments
identical to the classical method. To simulate a random variate from
the hypersphere function rhypersphere
is used
setting type = "non-uniform"
.
In accordance with M. Clerc (2012)
default values are par$w = 1/(2 * log(2))
,
par$c1 = 0.5 + log(2)
and par$c2 = 0.5 + log(2)
.
Value
This function returns a matrix which i-th row represents updated velocity of the i-th particle.
References
Maurice Clerc (2012). Standard Particle Swarm Optimisation. HAL archieve.