net.sourceforge.jswarm_pso
Class ParticleUpdate

java.lang.Object
  extended by net.sourceforge.jswarm_pso.ParticleUpdate
Direct Known Subclasses:
ParticleUpdateFullyRandom, ParticleUpdateRandomByParticle, ParticleUpdateRepulsive, ParticleUpdateSimple

public abstract class ParticleUpdate
extends java.lang.Object

Particle update strategy Every Swarm.evolve() itereation the following methods are called - begin(Swarm) : Once at the begining of each iteration - update(Swarm,Particle) : Once for each particle - end(Swarm) : Once at the end of each iteration

Author:
Pablo Cingolani

Constructor Summary
ParticleUpdate(Particle particle)
          Constructor
 
Method Summary
 void begin(Swarm swarm)
          This method is called at the begining of each iteration Initialize random vectors use for local and global updates (rlocal[] and rother[])
 void end(Swarm swarm)
          This method is called at the end of each iteration
abstract  void update(Swarm swarm, Particle particle)
          Update particle's velocity and position
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParticleUpdate

public ParticleUpdate(Particle particle)
Constructor

Parameters:
particle - : Sample of particles that will be updated later
Method Detail

begin

public void begin(Swarm swarm)
This method is called at the begining of each iteration Initialize random vectors use for local and global updates (rlocal[] and rother[])


update

public abstract void update(Swarm swarm,
                            Particle particle)
Update particle's velocity and position


end

public void end(Swarm swarm)
This method is called at the end of each iteration