|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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 Entity
getClone
in interface Particle
getClone
in interface Cloneable
Object.clone()
public boolean equals(Object object)
equals
in class AbstractEntity
object
- The object to compare equality.public int hashCode()
hashCode
in class AbstractEntity
public void calculateFitness()
Entity
incrementing the
number of fitness evaluations for the algorithm.
calculateFitness
in interface Entity
public abstract void calculateFitness(boolean count)
Entity
. This method may or may not
increment the number of fitness evaluations of the algorithm.
calculateFitness
in interface Entity
count
- Add or do not add this fitness evaluation to the algorithm global count.public abstract Fitness getBestFitness()
getBestFitness
in interface Entity
getBestFitness
in interface Particle
getBestFitness
in class AbstractEntity
public abstract int getDimension()
getDimension
in interface Entity
getDimension
in interface Particle
public abstract StructuredType getPosition()
getPosition
in interface Particle
public abstract StructuredType getBestPosition()
getBestPosition
in interface Particle
public abstract StructuredType getVelocity()
getVelocity
in interface Particle
public abstract void setNeighbourhoodBest(Particle particle)
setNeighbourhoodBest
in interface Particle
particle
- The particle to use as the current particle's neighhod best particlepublic abstract Particle getNeighbourhoodBest()
getNeighbourhoodBest
in interface Particle
public abstract void updatePosition()
updatePosition
in interface Particle
public abstract void updateVelocity()
updateVelocity
in interface Particle
public abstract void updateControlParameters()
updateControlParameters
in interface Particle
public PositionUpdateStrategy getPositionUpdateStrategy()
getPositionUpdateStrategy
in interface Particle
public void setPositionUpdateStrategy(PositionUpdateStrategy positionUpdateStrategy)
setPositionUpdateStrategy
in interface Particle
positionUpdateStrategy
- The PositionUpdateStrategy to use.public VelocityUpdateStrategy getVelocityUpdateStrategy()
VelocityUpdateStrategy
of the current particle.
getVelocityUpdateStrategy
in interface Particle
public void setVelocityUpdateStrategy(VelocityUpdateStrategy velocityUpdateStrategy)
setVelocityUpdateStrategy
in interface Particle
velocityUpdateStrategy
- The velocityUpdateStrategy to set.public VelocityInitialisationStrategy getVelocityInitialisationStrategy()
getVelocityInitialisationStrategy
in interface Particle
public void setVelocityInitialisationStrategy(VelocityInitialisationStrategy velocityInitialisationStrategy)
setVelocityInitialisationStrategy
in interface Particle
velocityInitialisationStrategy
- The value to set.public PositionInitialisationStrategy getPositionInitialisationStrategy()
public void setPositionInitialisationStrategy(PositionInitialisationStrategy positionInitialisationStrategy)
positionInitialisationStrategy
- The value to set.public NeighbourhoodBestUpdateStrategy getNeighbourhoodBestUpdateStrategy()
NeighbourhoodBestUpdateStrategy
.
getNeighbourhoodBestUpdateStrategy
in interface SocialEntity
NeighbourhoodBestUpdateStrategy
objectpublic void setNeighbourhoodBestUpdateStrategy(NeighbourhoodBestUpdateStrategy neighbourhoodBestUpdateStrategy)
NeighbourhoodBestUpdateStrategy
to be used by the Entity.
setNeighbourhoodBestUpdateStrategy
in interface SocialEntity
neighbourhoodBestUpdateStrategy
- The NeighbourhoodBestUpdateStrategy
to be usedpublic Fitness getSocialBestFitness()
getSocialBestFitness
in interface SocialEntity
public int compareTo(Entity o)
compareTo
in interface Comparable<Entity>
compareTo
in interface Entity
public PersonalBestUpdateStrategy getPersonalBestUpdateStrategy()
getPersonalBestUpdateStrategy
in interface Particle
PersonalBestUpdateStrategy
.public void setPersonalBestUpdateStrategy(PersonalBestUpdateStrategy personalBestUpdateStrategy)
setPersonalBestUpdateStrategy
in interface Particle
personalBestUpdateStrategy
- The instance to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |