net.sourceforge.cilib.pso.particle
Class ParticleDecorator

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.ParticleDecorator
All Implemented Interfaces:
Serializable, Comparable<Entity>, CandidateSolution, Entity, Particle, SocialEntity, Cloneable
Direct Known Subclasses:
DeviationDecorator, LFDecorator

public abstract class ParticleDecorator
extends AbstractParticle

Author:
Edwin Peer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.pso.particle.AbstractParticle
neighbourhoodBestUpdateStrategy, personalBestUpdateStrategy, positionInitialisationStrategy, positionUpdateStrategy, velocityInitialisationStrategy, velocityUpdateStrategy
 
Constructor Summary
ParticleDecorator()
           
ParticleDecorator(Particle target)
           
 
Method Summary
 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.
 Type getBehaviouralParameters()
           
 Fitness getBestFitness()
          Return the best fitness associated with this Entity, provided a best fitness is defined on the Entity.
 StructuredType getBestPosition()
          Get the best position of the Particle.
 StructuredType getCandidateSolution()
          Get the value of the CandidateSolution maintained by this Entity.
abstract  ParticleDecorator 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.
 Fitness getFitness()
          Get the fitness of the CandidateSolution maintained by this Entity.
 long getId()
          Get the identifier associated with the Entity instance.
 Particle getNeighbourhoodBest()
          Get the current Particle's neighbourhood best.
 StructuredType getPosition()
          Get the position of the Particle.
 Particle getTarget()
           
 StructuredType getVelocity()
          Get the velocity representation of the Particle.
 VelocityUpdateStrategy getVelocityUpdateStrategy()
          Get the VelocityUpdateStrategy of the current 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 setCandidateSolution(StructuredType type)
          Set the Type maintained by this Entitys CandidateSolution.
 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 setTarget(Particle target)
           
 void setVelocityUpdateStrategy(VelocityUpdateStrategy velocityUpdateStrategy)
          Set the velocity updating strategy for the 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, getNeighbourhoodBestUpdateStrategy, getPersonalBestUpdateStrategy, getPositionInitialisationStrategy, getPositionUpdateStrategy, getSocialBestFitness, getVelocityInitialisationStrategy, setNeighbourhoodBestUpdateStrategy, setPersonalBestUpdateStrategy, setPositionInitialisationStrategy, setPositionUpdateStrategy, setVelocityInitialisationStrategy
 
Methods inherited from class net.sourceforge.cilib.entity.AbstractEntity
getFitnessCalculator, getProperties, 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.Entity
getFitnessCalculator, getProperties, setProperties
 

Constructor Detail

ParticleDecorator

public ParticleDecorator()

ParticleDecorator

public ParticleDecorator(Particle target)
Method Detail

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

setTarget

public void setTarget(Particle target)

getTarget

public Particle getTarget()

getClone

public abstract ParticleDecorator getClone()
Description copied from class: AbstractParticle
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()

getBestFitness

public Fitness getBestFitness()
Description copied from class: AbstractParticle
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 StructuredType getBestPosition()
Description copied from class: AbstractParticle
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()
Description copied from class: AbstractParticle
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.

getFitness

public Fitness getFitness()
Description copied from class: AbstractEntity
Get the fitness of the CandidateSolution maintained by this Entity.

Specified by:
getFitness in interface CandidateSolution
Specified by:
getFitness in interface Entity
Specified by:
getFitness in interface Particle
Overrides:
getFitness in class AbstractEntity
Returns:
The Fitness of the candidate solution.

getId

public long getId()
Description copied from class: AbstractEntity
Get the identifier associated with the Entity instance.

Specified by:
getId in interface Entity
Overrides:
getId in class AbstractEntity
Returns:
The associated identifier.

getNeighbourhoodBest

public Particle getNeighbourhoodBest()
Description copied from class: AbstractParticle
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 StructuredType getPosition()
Description copied from class: AbstractParticle
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 StructuredType getVelocity()
Description copied from class: AbstractParticle
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)
Description copied from interface: Entity
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()
Description copied from class: AbstractParticle
Update the position of the Particle.

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

calculateFitness

public void calculateFitness(boolean count)
Description copied from class: AbstractParticle
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)
Description copied from class: AbstractParticle
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()
Description copied from class: AbstractParticle
Update the velocity of the Particle.

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

updateControlParameters

public void updateControlParameters()
Description copied from class: AbstractParticle
Update all the ControlParameters that are maintained within the Particle.

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

getVelocityUpdateStrategy

public VelocityUpdateStrategy getVelocityUpdateStrategy()
Description copied from class: AbstractParticle
Get the VelocityUpdateStrategy of the current particle.

Specified by:
getVelocityUpdateStrategy in interface Particle
Overrides:
getVelocityUpdateStrategy in class AbstractParticle
Returns:
Returns the velocityUpdateStrategy.

setVelocityUpdateStrategy

public void setVelocityUpdateStrategy(VelocityUpdateStrategy velocityUpdateStrategy)
Description copied from class: AbstractParticle
Set the velocity updating strategy for the particle.

Specified by:
setVelocityUpdateStrategy in interface Particle
Overrides:
setVelocityUpdateStrategy in class AbstractParticle
Parameters:
velocityUpdateStrategy - The velocityUpdateStrategy to set.

getCandidateSolution

public StructuredType getCandidateSolution()
Description copied from class: AbstractEntity
Get the value of the CandidateSolution maintained by this Entity.

Specified by:
getCandidateSolution in interface CandidateSolution
Specified by:
getCandidateSolution in interface Entity
Overrides:
getCandidateSolution in class AbstractEntity
Returns:
The candidate solution as a Type.

setCandidateSolution

public void setCandidateSolution(StructuredType type)
Description copied from class: AbstractEntity
Set the Type maintained by this Entitys CandidateSolution.

Specified by:
setCandidateSolution in interface CandidateSolution
Specified by:
setCandidateSolution in interface Entity
Overrides:
setCandidateSolution in class AbstractEntity
Parameters:
type - The Type that will be the new value of the Entity CandidateSolution.

compareTo

public int compareTo(Entity o)
Description copied from class: AbstractParticle

Specified by:
compareTo in interface Comparable<Entity>
Specified by:
compareTo in interface Entity
Overrides:
compareTo in class AbstractParticle

setDimension

public void setDimension(int dim)

getBehaviouralParameters

public Type getBehaviouralParameters()

setBehaviouralParameters

public void setBehaviouralParameters(Type type)

reinitialise

public void reinitialise()
Description copied from interface: Entity
Re-initialise the given Entity within the defined domain.



Copyright © 2009 CIRG. All Rights Reserved.