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