lio.search.pso
Class Particle

java.lang.Object
  extended by lio.search.pso.Particle
Direct Known Subclasses:
StdContParticle

public abstract class Particle
extends java.lang.Object

This class implement the basic components of a particle. Since the way of representing the velocity depends on the kind of data each subclass must define it.


Field Summary
protected  Particle bestNeighbour
          Reference to other particle that is the best of the neighbourhood
protected  Individual bestPosition
          Best position and fitness of the particle
protected  Individual currentPosition
          Current position and fitness of the particle
 
Constructor Summary
Particle()
           
 
Method Summary
 double bestValue()
           
 Particle getBestNeighbour()
           
 Individual getBestPosition()
           
 Individual getCurrentPosition()
           
 void move()
          Moves the particle according to its velocity
abstract  void newPoint()
          Calculates the new point
 void setBestNeighbour(Particle bestNeighbour)
           
 void setBestPosition(Individual bestPosition)
           
 void setCurrentPosition(Individual currentPosition)
           
 double value()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentPosition

protected Individual currentPosition
Current position and fitness of the particle


bestPosition

protected Individual bestPosition
Best position and fitness of the particle


bestNeighbour

protected Particle bestNeighbour
Reference to other particle that is the best of the neighbourhood

Constructor Detail

Particle

public Particle()
Method Detail

move

public void move()
Moves the particle according to its velocity


newPoint

public abstract void newPoint()
Calculates the new point


value

public double value()
Returns:
the current fitness of the particle

bestValue

public double bestValue()
Returns:
The best value reached by the particle

getBestNeighbour

public Particle getBestNeighbour()
Returns:
the bestNeighbour

setBestNeighbour

public void setBestNeighbour(Particle bestNeighbour)
Parameters:
bestNeighbour - the bestNeighbour to set

getBestPosition

public Individual getBestPosition()
Returns:
the bestPosition

setBestPosition

public void setBestPosition(Individual bestPosition)
Parameters:
bestPosition - the bestPosition to set

getCurrentPosition

public Individual getCurrentPosition()
Returns:
the currentPosition

setCurrentPosition

public void setCurrentPosition(Individual currentPosition)
Parameters:
currentPosition - the currentPosition to set