public class Particle
extends org.opt4j.core.Individual
Particle
extends the Individual
by an id, a velocity
Genotype
, a personal best Genotype
and the corresponding best
Objectives
.Modifier and Type | Field and Description |
---|---|
protected org.opt4j.core.Genotype |
best |
protected int |
id |
protected org.opt4j.core.Objectives |
objectivesBest |
protected org.opt4j.core.Genotype |
velocity |
Modifier and Type | Method and 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.
|
protected int id
protected org.opt4j.core.Genotype velocity
protected org.opt4j.core.Genotype best
protected org.opt4j.core.Objectives objectivesBest
@Inject public Particle()
Particle
.public org.opt4j.core.Genotype getVelocity()
setVelocity(org.opt4j.core.Genotype)
public void setVelocity(org.opt4j.core.Genotype velocity)
velocity
- the velocity to setgetVelocity()
public org.opt4j.core.Genotype getBest()
setBest(org.opt4j.core.Genotype, org.opt4j.core.Objectives)
public org.opt4j.core.Objectives getBestObjectives()
setBest(org.opt4j.core.Genotype, org.opt4j.core.Objectives)
public void setBest(org.opt4j.core.Genotype best, org.opt4j.core.Objectives objectives)
best
- the best to setobjectives
- the corresponding best objectivesgetBest()
public int getId()
setId(int)
public void setId(int id)
id
- the id to setgetId()