Package org.opt4j.optimizer.mopso
Class Particle
- java.lang.Object
-
- org.opt4j.core.Individual
-
- org.opt4j.optimizer.mopso.Particle
-
public class Particle extends Individual
TheParticle
extends theIndividual
by an id, a velocityGenotype
, a personal bestGenotype
and the corresponding bestObjectives
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opt4j.core.Individual
Individual.State
-
-
Field Summary
Fields Modifier and Type Field Description protected Genotype
best
protected int
id
protected Objectives
objectivesBest
protected Genotype
velocity
-
Fields inherited from class org.opt4j.core.Individual
genotype, individualStateListeners, objectives, phenotype, state
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Genotype
getBest()
Returns the best position.Objectives
getBestObjectives()
Returns the best objectives.int
getId()
Returns the id.Genotype
getVelocity()
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 Detail
-
id
protected int id
-
velocity
protected Genotype velocity
-
best
protected Genotype best
-
objectivesBest
protected Objectives objectivesBest
-
-
Constructor Detail
-
Particle
@Inject public Particle()
Constructs aParticle
.
-
-
Method Detail
-
getVelocity
public Genotype getVelocity()
Returns the velocity.- Returns:
- the velocity
- See Also:
setVelocity(org.opt4j.core.Genotype)
-
setVelocity
public void setVelocity(Genotype velocity)
Sets the velocity.- Parameters:
velocity
- the velocity to set- See Also:
getVelocity()
-
getBest
public Genotype getBest()
Returns the best position.- Returns:
- the best
- See Also:
setBest(org.opt4j.core.Genotype, org.opt4j.core.Objectives)
-
getBestObjectives
public Objectives getBestObjectives()
Returns the best objectives.- Returns:
- the best objectives
- See Also:
setBest(org.opt4j.core.Genotype, org.opt4j.core.Objectives)
-
setBest
public void setBest(Genotype best, Objectives objectives)
Sets the best position.- Parameters:
best
- the best to setobjectives
- the corresponding best objectives- See Also:
getBest()
-
getId
public int getId()
Returns the id.- Returns:
- the id
- See Also:
setId(int)
-
setId
public void setId(int id)
Sets the id.- Parameters:
id
- the id to set- See Also:
getId()
-
-