net.sourceforge.jswarm_pso
Class ParticleUpdateSimple

java.lang.Object
  extended by net.sourceforge.jswarm_pso.ParticleUpdate
      extended by net.sourceforge.jswarm_pso.ParticleUpdateSimple

public class ParticleUpdateSimple
extends ParticleUpdate

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

Field Summary
(package private)  double[] rglobal
          Random vector for global update
(package private)  double[] rlocal
          Random vector for local update
 
Constructor Summary
ParticleUpdateSimple(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
 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
 

Field Detail

rlocal

double[] rlocal
Random vector for local update


rglobal

double[] rglobal
Random vector for global update

Constructor Detail

ParticleUpdateSimple

public ParticleUpdateSimple(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[])

Overrides:
begin in class ParticleUpdate

update

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

Specified by:
update in class ParticleUpdate

end

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

Overrides:
end in class ParticleUpdate