net.sourceforge.cilib.pso.velocityupdatestrategies
Class StandardVelocityUpdate

java.lang.Object
  extended by net.sourceforge.cilib.pso.velocityupdatestrategies.StandardVelocityUpdate
All Implemented Interfaces:
Serializable, VelocityUpdateStrategy, Cloneable
Direct Known Subclasses:
ChargedVelocityUpdateStrategy, CoherenceVelocityUpdate, FDRVelocityUpdateStrategy, FIPSVelocityUpdate, GCVelocityUpdateStrategy, LinearVelocityUpdate, MOVelocityUpdateStrategy, QuantumVelocityUpdateStrategy

public class StandardVelocityUpdate
extends Object
implements VelocityUpdateStrategy

Implementation of the standard / default velocity update equation.

Author:
Edwin Peer
See Also:
Serialized Form

Field Summary
protected  ControlParameter cognitiveAcceleration
           
protected  ControlParameter inertiaWeight
           
protected  ControlParameter socialAcceleration
           
protected  ControlParameter vMax
           
 
Constructor Summary
StandardVelocityUpdate()
          Creates a new instance of StandardVelocityUpdate.
StandardVelocityUpdate(StandardVelocityUpdate copy)
          Copy constructor.
 
Method Summary
protected  void clamp(Vector velocity, int i)
          TODO: Need to have a VMax strategy.
 StandardVelocityUpdate getClone()
          Clone the VelocityUpdateStrategy object.
 ControlParameter getCognitiveAcceleration()
          Gets the ControlParameter representing the cognitive component within this VelocityUpdateStrategy.
 ControlParameter getInertiaWeight()
          Get the ControlParameter representing the inerti weight of the VelocityUpdateStrategy.
 ControlParameter getSocialAcceleration()
          Get the ControlParameter representing the social component of the velocity update equation.
 ControlParameter getVMax()
          Get the ControlParameter representing the vMax component.
 void setCognitiveAcceleration(ControlParameter cognitiveComponent)
          Set the cognitive component ControlParameter.
 void setInertiaWeight(ControlParameter inertiaWeight)
          Set the ControlParameter for the inertia weight of the velocity update equation.
 void setSocialAcceleration(ControlParameter socialComponent)
          Set the ControlParameter for the social component.
 void setVMax(ControlParameter max)
          Set the ControlParameter for the vMax parameter.
 void updateControlParameters(Particle particle)
          Update the associated ControlParameters for the VelocityUpdateStrategy.
 void updateVelocity(Particle particle)
          Perform the velocity update for the given Particle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inertiaWeight

protected ControlParameter inertiaWeight

socialAcceleration

protected ControlParameter socialAcceleration

cognitiveAcceleration

protected ControlParameter cognitiveAcceleration

vMax

protected ControlParameter vMax
Constructor Detail

StandardVelocityUpdate

public StandardVelocityUpdate()
Creates a new instance of StandardVelocityUpdate.


StandardVelocityUpdate

public StandardVelocityUpdate(StandardVelocityUpdate copy)
Copy constructor.

Parameters:
copy - The object to copy.
Method Detail

getClone

public StandardVelocityUpdate getClone()
Clone the VelocityUpdateStrategy object.

Specified by:
getClone in interface VelocityUpdateStrategy
Specified by:
getClone in interface Cloneable
Returns:
A cloned VelocityUpdateStrategy
See Also:
Object.clone()

updateVelocity

public void updateVelocity(Particle particle)
Perform the velocity update for the given Particle.

Specified by:
updateVelocity in interface VelocityUpdateStrategy
Parameters:
particle - The Particle velocity that should be updated.

updateControlParameters

public void updateControlParameters(Particle particle)
Update the associated ControlParameters for the VelocityUpdateStrategy. Update the needed control parameters for the VelocityUpdate, if needed.

Specified by:
updateControlParameters in interface VelocityUpdateStrategy
Parameters:
particle - The particle for whom the VelocityUpdateStrategy parameters need to be updated.

clamp

protected void clamp(Vector velocity,
                     int i)
TODO: Need to have a VMax strategy.

Parameters:
velocity - The Vector to be clamped.
i - The dimension index to be clamped

getCognitiveAcceleration

public ControlParameter getCognitiveAcceleration()
Gets the ControlParameter representing the cognitive component within this VelocityUpdateStrategy.

Returns:
Returns the cognitiveComponent.

setCognitiveAcceleration

public void setCognitiveAcceleration(ControlParameter cognitiveComponent)
Set the cognitive component ControlParameter.

Parameters:
cognitiveComponent - The cognitiveComponent to set.

getInertiaWeight

public ControlParameter getInertiaWeight()
Get the ControlParameter representing the inerti weight of the VelocityUpdateStrategy.

Returns:
Returns the inertia component ControlParameter.

setInertiaWeight

public void setInertiaWeight(ControlParameter inertiaWeight)
Set the ControlParameter for the inertia weight of the velocity update equation.

Parameters:
inertiaComponent - The inertiaComponent to set.

getSocialAcceleration

public ControlParameter getSocialAcceleration()
Get the ControlParameter representing the social component of the velocity update equation.

Returns:
Returns the socialComponent.

setSocialAcceleration

public void setSocialAcceleration(ControlParameter socialComponent)
Set the ControlParameter for the social component.

Parameters:
socialComponent - The socialComponent to set.

getVMax

public ControlParameter getVMax()
Get the ControlParameter representing the vMax component.

Returns:
The ControlParameter for the vMax.

setVMax

public void setVMax(ControlParameter max)
Set the ControlParameter for the vMax parameter.

Parameters:
max - The ControlParameter to set.


Copyright © 2009 CIRG. All Rights Reserved.