lio.search.pso.contchain
Class StdContParticleGenerator

java.lang.Object
  extended by lio.search.pso.contchain.StdContParticleGenerator
All Implemented Interfaces:
LiODependentResource, LiOResource, SwarmGenerator

public class StdContParticleGenerator
extends java.lang.Object
implements SwarmGenerator, LiODependentResource

This class allows generating StdContParticles. It also provides access to configure the common properties of the particles.

See Also:
StdContParticle

Constructor Summary
StdContParticleGenerator()
           
 
Method Summary
 Particle[] generateSwarm(int nParticles)
          Generates a swarm of standard real particles
 double getCognitive()
           
 double getConstraint()
           
 LiOResourceDefinition getDefinition()
          Return a LiOResDescription object which holds the name and all parameters that describe the resource.
 Generator getGenerator()
           
 double getInertia()
           
 double getSocial()
           
 void getTaskInformation(LiOTask task)
          Gets the necessary information from the task
 double getVmax()
           
 void setCognitive(double cognitive)
           
 void setConstraint(double constraint)
           
 void setGenerator(Generator generator)
           
 void setInertia(double inertia)
           
 void setSocial(double social)
           
 void setVmax(double vmax)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdContParticleGenerator

public StdContParticleGenerator()
Method Detail

getTaskInformation

public void getTaskInformation(LiOTask task)
Gets the necessary information from the task

Specified by:
getTaskInformation in interface LiODependentResource
Parameters:
task - Information concerning to the problem which is being solved.

generateSwarm

public Particle[] generateSwarm(int nParticles)
Generates a swarm of standard real particles

Specified by:
generateSwarm in interface SwarmGenerator
Parameters:
nParticles - Number of particles to be generated.
Returns:
A Swarm of particles.

getDefinition

public LiOResourceDefinition getDefinition()
Return a LiOResDescription object which holds the name and all parameters that describe the resource.

Specified by:
getDefinition in interface LiOResource
Returns:
A definition of the resource.

getCognitive

public double getCognitive()
Returns:
the cognitive component of velocity updating.

setCognitive

public void setCognitive(double cognitive)
Parameters:
cognitive - the cognitive component of velocity updating.

getConstraint

public double getConstraint()
Returns:
Constraint for velocity updating

setConstraint

public void setConstraint(double constraint)
Parameters:
inertia - Constraint for velocity updating

getSocial

public double getSocial()
Returns:
Social component of velocity updating

setSocial

public void setSocial(double social)
Parameters:
social - Social component of velocity updating

getVmax

public double getVmax()
Returns:
Max velocity factor. If 1, it is equal to the range

setVmax

public void setVmax(double vmax)
Parameters:
vmax - Max velocity factor. If 1, it is equal to the range

getInertia

public double getInertia()
Returns:
the Inertia

setInertia

public void setInertia(double inertia)
Parameters:
inertia - Weight of the current velocity in velocity updating

getGenerator

public Generator getGenerator()
Returns:
The gerator of positions.

setGenerator

public void setGenerator(Generator generator)
Parameters:
Generator - of positions