|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.cilib.entity.AbstractEntity
net.sourceforge.cilib.pso.particle.AbstractParticle
public abstract class AbstractParticle
This class defines the common behaviour available for all Particle instances.
| Field Summary | |
|---|---|
protected NeighbourhoodBestUpdateStrategy |
neighbourhoodBestUpdateStrategy
|
protected PersonalBestUpdateStrategy |
personalBestUpdateStrategy
|
protected PositionInitialisationStrategy |
positionInitialisationStrategy
|
protected PositionUpdateStrategy |
positionUpdateStrategy
|
protected VelocityInitialisationStrategy |
velocityInitialisationStrategy
|
protected VelocityUpdateStrategy |
velocityUpdateStrategy
|
| Constructor Summary | |
|---|---|
AbstractParticle()
Default constructor for all Particles. |
|
AbstractParticle(AbstractParticle copy)
Copy constructor. |
|
| Method Summary | |
|---|---|
void |
calculateFitness()
Calculate the fitness of the Entity incrementing the
number of fitness evaluations for the algorithm. |
abstract void |
calculateFitness(boolean count)
Calculate the fitness of the Entity. |
int |
compareTo(Entity o)
|
boolean |
equals(Object object)
It doesn;t make sense to compare the meta data of the entity. |
abstract Fitness |
getBestFitness()
Return the best fitness associated with this Entity, provided a best fitness is defined on the Entity. |
abstract StructuredType |
getBestPosition()
Get the best position of the Particle. |
abstract Particle |
getClone()
Make a clone of the Entity the exact semantics of the clone method will be defined by the classes that implements this interface. |
abstract int |
getDimension()
Returns the dimension of the Entity. |
abstract Particle |
getNeighbourhoodBest()
Get the current Particle's neighbourhood best. |
NeighbourhoodBestUpdateStrategy |
getNeighbourhoodBestUpdateStrategy()
Get the reference to the currently employed NeighbourhoodBestUpdateStrategy. |
PersonalBestUpdateStrategy |
getPersonalBestUpdateStrategy()
Get the current strategy to perform personal best updates. |
abstract StructuredType |
getPosition()
Get the position of the Particle. |
PositionInitialisationStrategy |
getPositionInitialisationStrategy()
Get the current PositionInitialisationStrategy. |
PositionUpdateStrategy |
getPositionUpdateStrategy()
Get the current PostionUpdateStrategy associated with this Particle. |
Fitness |
getSocialBestFitness()
Get the current social best fitness. |
abstract StructuredType |
getVelocity()
Get the velocity representation of the Particle. |
VelocityInitialisationStrategy |
getVelocityInitialisationStrategy()
Get the VelocityInitialisationStrategy. |
VelocityUpdateStrategy |
getVelocityUpdateStrategy()
Get the VelocityUpdateStrategy
of the current particle. |
int |
hashCode()
|
abstract void |
setNeighbourhoodBest(Particle particle)
Set the neighbourhood best particle for the current Particle based on the topology of the current particle. |
void |
setNeighbourhoodBestUpdateStrategy(NeighbourhoodBestUpdateStrategy neighbourhoodBestUpdateStrategy)
Set the NeighbourhoodBestUpdateStrategy to be used by the Entity. |
void |
setPersonalBestUpdateStrategy(PersonalBestUpdateStrategy personalBestUpdateStrategy)
Set the strategy to perform personal best updates. |
void |
setPositionInitialisationStrategy(PositionInitialisationStrategy positionInitialisationStrategy)
Set the PositionInitialisationStrategy to be used. |
void |
setPositionUpdateStrategy(PositionUpdateStrategy positionUpdateStrategy)
Set the PostionUpdateStrategy for the Particle. |
void |
setVelocityInitialisationStrategy(VelocityInitialisationStrategy velocityInitialisationStrategy)
Set the velocityInitialisationStrategy. |
void |
setVelocityUpdateStrategy(VelocityUpdateStrategy velocityUpdateStrategy)
Set the velocity updating strategy for the particle. |
abstract void |
updateControlParameters()
Update all the ControlParameters that are maintained within the Particle. |
abstract void |
updatePosition()
Update the position of the Particle. |
abstract void |
updateVelocity()
Update the velocity of the Particle. |
| Methods inherited from class net.sourceforge.cilib.entity.AbstractEntity |
|---|
getCandidateSolution, getFitness, getFitnessCalculator, getId, getProperties, setCandidateSolution, setFitnessCalculator, setProperties |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sourceforge.cilib.entity.Particle |
|---|
getFitness |
| Methods inherited from interface net.sourceforge.cilib.entity.Entity |
|---|
getCandidateSolution, getFitnessCalculator, getId, getProperties, initialise, reinitialise, setCandidateSolution, setProperties |
| Field Detail |
|---|
protected PositionUpdateStrategy positionUpdateStrategy
protected VelocityUpdateStrategy velocityUpdateStrategy
protected VelocityInitialisationStrategy velocityInitialisationStrategy
protected PositionInitialisationStrategy positionInitialisationStrategy
protected PersonalBestUpdateStrategy personalBestUpdateStrategy
protected NeighbourhoodBestUpdateStrategy neighbourhoodBestUpdateStrategy
| Constructor Detail |
|---|
public AbstractParticle()
public AbstractParticle(AbstractParticle copy)
copy - The instance to copy.| Method Detail |
|---|
public abstract Particle getClone()
getClone in interface EntitygetClone in interface ParticlegetClone in interface CloneableObject.clone()public boolean equals(Object object)
equals in class AbstractEntityobject - The object to compare equality.public int hashCode()
hashCode in class AbstractEntitypublic void calculateFitness()
Entity incrementing the
number of fitness evaluations for the algorithm.
calculateFitness in interface Entitypublic abstract void calculateFitness(boolean count)
Entity. This method may or may not
increment the number of fitness evaluations of the algorithm.
calculateFitness in interface Entitycount - Add or do not add this fitness evaluation to the algorithm global count.public abstract Fitness getBestFitness()
getBestFitness in interface EntitygetBestFitness in interface ParticlegetBestFitness in class AbstractEntitypublic abstract int getDimension()
getDimension in interface EntitygetDimension in interface Particlepublic abstract StructuredType getPosition()
getPosition in interface Particlepublic abstract StructuredType getBestPosition()
getBestPosition in interface Particlepublic abstract StructuredType getVelocity()
getVelocity in interface Particlepublic abstract void setNeighbourhoodBest(Particle particle)
setNeighbourhoodBest in interface Particleparticle - The particle to use as the current particle's neighhod best particlepublic abstract Particle getNeighbourhoodBest()
getNeighbourhoodBest in interface Particlepublic abstract void updatePosition()
updatePosition in interface Particlepublic abstract void updateVelocity()
updateVelocity in interface Particlepublic abstract void updateControlParameters()
updateControlParameters in interface Particlepublic PositionUpdateStrategy getPositionUpdateStrategy()
getPositionUpdateStrategy in interface Particlepublic void setPositionUpdateStrategy(PositionUpdateStrategy positionUpdateStrategy)
setPositionUpdateStrategy in interface ParticlepositionUpdateStrategy - The PositionUpdateStrategy to use.public VelocityUpdateStrategy getVelocityUpdateStrategy()
VelocityUpdateStrategy
of the current particle.
getVelocityUpdateStrategy in interface Particlepublic void setVelocityUpdateStrategy(VelocityUpdateStrategy velocityUpdateStrategy)
setVelocityUpdateStrategy in interface ParticlevelocityUpdateStrategy - The velocityUpdateStrategy to set.public VelocityInitialisationStrategy getVelocityInitialisationStrategy()
getVelocityInitialisationStrategy in interface Particlepublic void setVelocityInitialisationStrategy(VelocityInitialisationStrategy velocityInitialisationStrategy)
setVelocityInitialisationStrategy in interface ParticlevelocityInitialisationStrategy - The value to set.public PositionInitialisationStrategy getPositionInitialisationStrategy()
public void setPositionInitialisationStrategy(PositionInitialisationStrategy positionInitialisationStrategy)
positionInitialisationStrategy - The value to set.public NeighbourhoodBestUpdateStrategy getNeighbourhoodBestUpdateStrategy()
NeighbourhoodBestUpdateStrategy.
getNeighbourhoodBestUpdateStrategy in interface SocialEntityNeighbourhoodBestUpdateStrategy objectpublic void setNeighbourhoodBestUpdateStrategy(NeighbourhoodBestUpdateStrategy neighbourhoodBestUpdateStrategy)
NeighbourhoodBestUpdateStrategy to be used by the Entity.
setNeighbourhoodBestUpdateStrategy in interface SocialEntityneighbourhoodBestUpdateStrategy - The NeighbourhoodBestUpdateStrategy to be usedpublic Fitness getSocialBestFitness()
getSocialBestFitness in interface SocialEntitypublic int compareTo(Entity o)
compareTo in interface Comparable<Entity>compareTo in interface Entitypublic PersonalBestUpdateStrategy getPersonalBestUpdateStrategy()
getPersonalBestUpdateStrategy in interface ParticlePersonalBestUpdateStrategy.public void setPersonalBestUpdateStrategy(PersonalBestUpdateStrategy personalBestUpdateStrategy)
setPersonalBestUpdateStrategy in interface ParticlepersonalBestUpdateStrategy - The instance to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||