net.sourceforge.cilib.pso.particle
Class StandardParticle

java.lang.Object
  extended by net.sourceforge.cilib.entity.AbstractEntity
      extended by net.sourceforge.cilib.pso.particle.AbstractParticle
          extended by net.sourceforge.cilib.pso.particle.StandardParticle
All Implemented Interfaces:
Serializable, Comparable<Entity>, CandidateSolution, Entity, Particle, SocialEntity, Cloneable
Direct Known Subclasses:
CoherenceParticle, DynamicParticle, MultiObjectiveParticle

public class StandardParticle
extends AbstractParticle

Author:
Edwin Peer, Gary Pampara
See Also:
Serialized Form

Field Summary
protected  Particle neighbourhoodBest
           
 
Fields inherited from class net.sourceforge.cilib.pso.particle.AbstractParticle
neighbourhoodBestUpdateStrategy, personalBestUpdateStrategy, positionInitialisationStrategy, positionUpdateStrategy, velocityInitialisationStrategy, velocityUpdateStrategy
 
Constructor Summary
StandardParticle()
          Creates a new instance of StandardParticle.
StandardParticle(StandardParticle copy)
          Create a copy of the provided instance.
 
Method Summary
 void calculateFitness(boolean count)
          Calculate the fitness of the Entity.
 boolean equals(Object object)
           It doesn;t make sense to compare the meta data of the entity.
 Type getBehaviouralParameters()
          
 Fitness getBestFitness()
          Return the best fitness associated with this Entity, provided a best fitness is defined on the Entity.
 Vector getBestPosition()
          Get the best position of the Particle.
 StandardParticle getClone()
          Make a clone of the Entity the exact semantics of the clone method will be defined by the classes that implements this interface.
 int getDimension()
          Returns the dimension of the Entity.
 Particle getNeighbourhoodBest()
          Get the current Particle's neighbourhood best.
 Vector getPosition()
          Get the position of the Particle.
 Vector getVelocity()
          Get the velocity representation of the Particle.
 int hashCode()
          
 void initialise(OptimisationProblem problem)
          Intialise the Entity to something meaningful and within the problem space.
 void reinitialise()
          Re-initialise the given Entity within the defined domain.
 void setBehaviouralParameters(Type type)
          
 void setDimension(int dim)
          
 void setNeighbourhoodBest(Particle particle)
          Set the neighbourhood best particle for the current Particle based on the topology of the current particle.
 void updateControlParameters()
          Update all the ControlParameters that are maintained within the Particle.
 void updatePosition()
          Update the position of the Particle.
 void updateVelocity()
          Update the velocity of the Particle.
 
Methods inherited from class net.sourceforge.cilib.pso.particle.AbstractParticle
calculateFitness, compareTo, getNeighbourhoodBestUpdateStrategy, getPersonalBestUpdateStrategy, getPositionInitialisationStrategy, getPositionUpdateStrategy, getSocialBestFitness, getVelocityInitialisationStrategy, getVelocityUpdateStrategy, setNeighbourhoodBestUpdateStrategy, setPersonalBestUpdateStrategy, setPositionInitialisationStrategy, setPositionUpdateStrategy, setVelocityInitialisationStrategy, setVelocityUpdateStrategy
 
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, setCandidateSolution, setProperties
 

Field Detail

neighbourhoodBest

protected Particle neighbourhoodBest
Constructor Detail

StandardParticle

public StandardParticle()
Creates a new instance of StandardParticle.


StandardParticle

public StandardParticle(StandardParticle copy)
Create a copy of the provided instance.

Parameters:
copy - The instance to copy.
Method Detail

getClone

public StandardParticle getClone()
Make a clone of the Entity the exact semantics of the clone method will be defined by the classes that implements this interface.

Specified by:
getClone in interface Entity
Specified by:
getClone in interface Particle
Specified by:
getClone in interface Cloneable
Specified by:
getClone in class AbstractParticle
Returns:
the cloned object
See Also:
Object.clone()

equals

public boolean equals(Object object)
Description copied from class: AbstractParticle
It doesn;t make sense to compare the meta data of the entity. In other words, the properties of the entity may vary, but the entity is still the same entity.

Overrides:
equals in class AbstractParticle
Parameters:
object - The object to compare equality.

hashCode

public int hashCode()
Description copied from class: AbstractParticle

Overrides:
hashCode in class AbstractParticle

getBestFitness

public Fitness getBestFitness()
Return the best fitness associated with this Entity, provided a best fitness is defined on the Entity. If a best fitness is not defined, the current fitness is returned as it is the best current fitness. Entity objects that need to use this method need to override it in their implementation, for example with Particle objects.

Specified by:
getBestFitness in interface Entity
Specified by:
getBestFitness in interface Particle
Specified by:
getBestFitness in class AbstractParticle
Returns:
The associated best Fitness value.

getBestPosition

public Vector getBestPosition()
Get the best position of the Particle.

Specified by:
getBestPosition in interface Particle
Specified by:
getBestPosition in class AbstractParticle
Returns:
A Type representng the Particle's best position.

getDimension

public int getDimension()
Returns the dimension of the Entity.

Specified by:
getDimension in interface Entity
Specified by:
getDimension in interface Particle
Specified by:
getDimension in class AbstractParticle
Returns:
The dimension of the Entity.

getNeighbourhoodBest

public Particle getNeighbourhoodBest()
Get the current Particle's neighbourhood best.

Specified by:
getNeighbourhoodBest in interface Particle
Specified by:
getNeighbourhoodBest in class AbstractParticle
Returns:
The neighbourhood best of the Particle

getPosition

public Vector getPosition()
Get the position of the Particle.

Specified by:
getPosition in interface Particle
Specified by:
getPosition in class AbstractParticle
Returns:
A Type representing the Particle's position.

getVelocity

public Vector getVelocity()
Get the velocity representation of the Particle.

Specified by:
getVelocity in interface Particle
Specified by:
getVelocity in class AbstractParticle
Returns:
A Type representing the Particle's velocity.

initialise

public void initialise(OptimisationProblem problem)
Intialise the Entity to something meaningful and within the problem space. The exact semantics of this method is defined by the classes that implements this interface. Take note. The Intialiser is obsolete the new Type System handles it now. Init can be left out now.

Parameters:
problem - The OptimisationProblem to based the initialisation on.

updatePosition

public void updatePosition()
Update the position of the Particle.

Specified by:
updatePosition in interface Particle
Specified by:
updatePosition in class AbstractParticle

calculateFitness

public void calculateFitness(boolean count)
Calculate the fitness of the Entity. This method may or may not increment the number of fitness evaluations of the algorithm.

Specified by:
calculateFitness in interface Entity
Specified by:
calculateFitness in class AbstractParticle
Parameters:
count - Add or do not add this fitness evaluation to the algorithm global count.

setNeighbourhoodBest

public void setNeighbourhoodBest(Particle particle)
Set the neighbourhood best particle for the current Particle based on the topology of the current particle.

Specified by:
setNeighbourhoodBest in interface Particle
Specified by:
setNeighbourhoodBest in class AbstractParticle
Parameters:
particle - The particle to use as the current particle's neighhod best particle

updateVelocity

public void updateVelocity()
Update the velocity of the Particle.

Specified by:
updateVelocity in interface Particle
Specified by:
updateVelocity in class AbstractParticle

updateControlParameters

public void updateControlParameters()
Update all the ControlParameters that are maintained within the Particle.

Specified by:
updateControlParameters in interface Particle
Specified by:
updateControlParameters in class AbstractParticle

setDimension

public void setDimension(int dim)


getBehaviouralParameters

public Type getBehaviouralParameters()


setBehaviouralParameters

public void setBehaviouralParameters(Type type)


reinitialise

public void reinitialise()
Re-initialise the given Entity within the defined domain.



Copyright © 2009 CIRG. All Rights Reserved.