Package org.opt4j.optimizer.mopso
Class Particle
java.lang.Object
org.opt4j.core.Individual
org.opt4j.optimizer.mopso.Particle
The
Particle
extends the Individual
by an id, a velocity
Genotype
, a personal best Genotype
and the corresponding best
Objectives
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.opt4j.core.Individual
Individual.State
-
Field Summary
Modifier and TypeFieldDescriptionprotected Genotype
protected int
protected Objectives
protected Genotype
Fields inherited from class org.opt4j.core.Individual
genotype, individualStateListeners, objectives, phenotype, state
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBest()
Returns the best position.Returns the best objectives.int
getId()
Returns the id.Returns the velocity.void
setBest
(Genotype best, Objectives objectives) Sets the best position.void
setId
(int id) Sets the id.void
setVelocity
(Genotype velocity) Sets the velocity.Methods inherited from class org.opt4j.core.Individual
getGenotype, getObjectives, getPhenotype, getState, isDecoded, isEvaluated, setGenotype, setIndividualStatusListeners, setObjectives, setPhenotype, setState
-
Field Details
-
id
protected int id -
velocity
-
best
-
objectivesBest
-
-
Constructor Details
-
Particle
@Inject public Particle()Constructs aParticle
.
-
-
Method Details
-
getVelocity
Returns the velocity.- Returns:
- the velocity
- See Also:
-
setVelocity
Sets the velocity.- Parameters:
velocity
- the velocity to set- See Also:
-
getBest
Returns the best position.- Returns:
- the best
- See Also:
-
getBestObjectives
Returns the best objectives.- Returns:
- the best objectives
- See Also:
-
setBest
Sets the best position.- Parameters:
best
- the best to setobjectives
- the corresponding best objectives- See Also:
-
getId
public int getId()Returns the id.- Returns:
- the id
- See Also:
-
setId
public void setId(int id) Sets the id.- Parameters:
id
- the id to set- See Also:
-