net.sourceforge.jswarm_pso
Class ParticleUpdateRepulsive

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

public class ParticleUpdateRepulsive
extends ParticleUpdate

Particle update strategy Warning: It's designed to be used with SwarmRepulsive swarms

Author:
Pablo Cingolani

Field Summary
(package private)  double randRand
          Random factor for random velocity update
(package private)  double[] rlocal
          Random vector for local update
(package private)  double[] rother
          Random vector for global update
 
Constructor Summary
ParticleUpdateRepulsive(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 update(Swarm swarm, Particle particle)
          Update particle's position and velocity using repulsive algorithm
 
Methods inherited from class net.sourceforge.jswarm_pso.ParticleUpdate
end
 
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


rother

double[] rother
Random vector for global update


randRand

double randRand
Random factor for random velocity update

Constructor Detail

ParticleUpdateRepulsive

public ParticleUpdateRepulsive(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 position and velocity using repulsive algorithm

Specified by:
update in class ParticleUpdate