lio.search.pso
Class PSO

java.lang.Object
  extended by lio.search.LiOSearch
      extended by lio.search.pso.PSO
All Implemented Interfaces:
java.lang.Runnable, LiOResource

public class PSO
extends LiOSearch

This class implements the frame for different Particle Swarm Optimization algorithms.


Field Summary
protected  SwarmGenerator generator
          Swarm generator
protected  Neighbourhood neighbourhood
          Neighbourhood
protected  int numParticles
          Number of particles
protected  Particle[] swarm
          Swarm of particles
 
Fields inherited from class lio.search.LiOSearch
listenerList, searchOutput, stopCondition, stopFlag
 
Constructor Summary
PSO()
           
 
Method Summary
 LiOResourceDefinition getDefinition()
          Return a LiOResDescription object which holds the name and all parameters that describe the resource.
 SwarmGenerator getGenerator()
           
 Neighbourhood getNeighbourhood()
           
 int getNumParticles()
           
static void main(java.lang.String[] args)
           
 void run()
          Main cycle
 void setGenerator(SwarmGenerator generator)
           
 void setNeighbourhood(Neighbourhood neighbourhood)
           
 void setNumParticles(int particles)
           
 boolean worksWith(LiOTask task)
          Allows knowing if the specified algorithm is able to process the task.
 
Methods inherited from class lio.search.LiOSearch
addLiOEventListener, build, cleanExecution, execute, fireFinishEvent, getSearchOutput, getStopCondition, initialize, initialize, loadSearchOutput, loadStatistics, loadStopCondition, removeLiOEventListener, setOptions, setSearchOutput, setStopCondition, setTask, showOptions, stopCondition, stopSearching, updateTaskDependentResources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

swarm

protected Particle[] swarm
Swarm of particles


generator

protected SwarmGenerator generator
Swarm generator


neighbourhood

protected Neighbourhood neighbourhood
Neighbourhood


numParticles

protected int numParticles
Number of particles

Constructor Detail

PSO

public PSO()
Method Detail

run

public void run()
Main cycle


getDefinition

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

Returns:
A definition of the resource.

worksWith

public boolean worksWith(LiOTask task)
Description copied from class: LiOSearch
Allows knowing if the specified algorithm is able to process the task.

Specified by:
worksWith in class LiOSearch
Returns:
true if the search algorithm can deal with this kind of task and the corresponding data-type

main

public static void main(java.lang.String[] args)
Parameters:
args - the command line arguments

getGenerator

public SwarmGenerator getGenerator()
Returns:
the generator

setGenerator

public void setGenerator(SwarmGenerator generator)
Parameters:
generator - the generator to set

getNeighbourhood

public Neighbourhood getNeighbourhood()
Returns:
the neighbourhood

setNeighbourhood

public void setNeighbourhood(Neighbourhood neighbourhood)
Parameters:
neighbourhood - the neighbourhood to set

getNumParticles

public int getNumParticles()
Returns:
the nParticles

setNumParticles

public void setNumParticles(int particles)
Parameters:
particles - the nParticles to set