ec.pso
Class PSOSubpopulation

java.lang.Object
  extended by ec.Subpopulation
      extended by ec.pso.PSOSubpopulation
All Implemented Interfaces:
Group, Setup, java.io.Serializable, java.lang.Cloneable

public class PSOSubpopulation
extends Subpopulation

PSOSubpopulation.java

Particle Swarm Optimization (PSO) is a population-oriented stochastic search technique similar to genetic algorithms, evolutionary strategies, and other evolutionary computation algorithms. The technique discovers solutions for N-dimensional parameterized problems: basically it discovers the point in N-dimensional space which maximizes some quality function.

PSOSubpopulation handles initialization and input/output of the swarm.

Parameters

base.neighborhood-size
integer
(the number of individuals per neighborhood)
base.clamp
boolean
(clamp the individual to stay within the bounds or not)
base.initial-velocity-scale
double
(particles are initialized with a random velocity and this value provides bounds. A value of 1.0 means that the velocity will be within +/- the range of the genotype.)
base.velocity-multiplier
double
(particle velocities are multiplied by this value before the particle is updated. Increasing this value helps particles to escape local optima, but slows convergence. The default value of 1.5 is geared toward multi-modal landscapes.)

Parameter bases

base.data Subpopulation

Version:
1.0
Author:
Joey Harrison, Ankur Desai
See Also:
Serialized Form

Field Summary
 boolean clampRange
           
static java.lang.String GLOBAL_BEST_PREAMBLE
           
 DoubleVectorIndividual globalBest
           
static java.lang.String INDIVIDUAL_EXISTS_PREAMBLE
           
 double initialVelocityScale
           
static java.lang.String NEIGHBORHOOD_BEST_PREAMBLE
           
 DoubleVectorIndividual[] neighborhoodBests
           
 int neighborhoodSize
           
static java.lang.String P_CLAMP_RANGE
           
static java.lang.String P_INITIAL_VELOCITY_SCALE
           
static java.lang.String P_NEIGHBORHOOD_SIZE
           
static java.lang.String P_VELOCITY_MULTIPLIER
           
static java.lang.String PERSONAL_BEST_PREAMBLE
           
 DoubleVectorIndividual[] personalBests
           
static java.lang.String PREVIOUS_INDIVIDUAL_PREAMBLE
           
 DoubleVectorIndividual[] previousIndividuals
           
 double velocityMultiplier
           
 
Fields inherited from class ec.Subpopulation
INDIVIDUAL_INDEX_PREAMBLE, individuals, loadInds, NUM_INDIVIDUALS_PREAMBLE, numDuplicateRetries, P_FILE, P_RETRIES, P_SPECIES, P_SUBPOPSIZE, species
 
Constructor Summary
PSOSubpopulation()
           
 
Method Summary
 void populate(EvolutionState state, int thread)
           
 void printSubpopulation(EvolutionState state, int log, int verbosity)
          Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream.
 void printSubpopulation(EvolutionState state, java.io.PrintWriter writer)
          Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream.
 void printSubpopulationForHumans(EvolutionState state, int log, int verbosity)
          Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream.
 void readSubpopulation(EvolutionState state, java.io.DataInput dataInput)
          Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream.
 void readSubpopulation(EvolutionState state, java.io.LineNumberReader reader)
          Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream.
 void setup(EvolutionState state, Parameter base)
          Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.
 void writeSubpopulation(EvolutionState state, java.io.DataOutput dataOutput)
          Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream.
 
Methods inherited from class ec.Subpopulation
emptyClone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

neighborhoodSize

public int neighborhoodSize

P_NEIGHBORHOOD_SIZE

public static final java.lang.String P_NEIGHBORHOOD_SIZE
See Also:
Constant Field Values

clampRange

public boolean clampRange

P_CLAMP_RANGE

public static final java.lang.String P_CLAMP_RANGE
See Also:
Constant Field Values

initialVelocityScale

public double initialVelocityScale

P_INITIAL_VELOCITY_SCALE

public static final java.lang.String P_INITIAL_VELOCITY_SCALE
See Also:
Constant Field Values

velocityMultiplier

public double velocityMultiplier

P_VELOCITY_MULTIPLIER

public static final java.lang.String P_VELOCITY_MULTIPLIER
See Also:
Constant Field Values

globalBest

public DoubleVectorIndividual globalBest

neighborhoodBests

public DoubleVectorIndividual[] neighborhoodBests

personalBests

public DoubleVectorIndividual[] personalBests

previousIndividuals

public DoubleVectorIndividual[] previousIndividuals

GLOBAL_BEST_PREAMBLE

public static final java.lang.String GLOBAL_BEST_PREAMBLE
See Also:
Constant Field Values

NEIGHBORHOOD_BEST_PREAMBLE

public static final java.lang.String NEIGHBORHOOD_BEST_PREAMBLE
See Also:
Constant Field Values

PERSONAL_BEST_PREAMBLE

public static final java.lang.String PERSONAL_BEST_PREAMBLE
See Also:
Constant Field Values

PREVIOUS_INDIVIDUAL_PREAMBLE

public static final java.lang.String PREVIOUS_INDIVIDUAL_PREAMBLE
See Also:
Constant Field Values

INDIVIDUAL_EXISTS_PREAMBLE

public static final java.lang.String INDIVIDUAL_EXISTS_PREAMBLE
See Also:
Constant Field Values
Constructor Detail

PSOSubpopulation

public PSOSubpopulation()
Method Detail

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from interface: Setup
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.

Specified by:
setup in interface Setup
Overrides:
setup in class Subpopulation

populate

public void populate(EvolutionState state,
                     int thread)
Overrides:
populate in class Subpopulation

printSubpopulationForHumans

public void printSubpopulationForHumans(EvolutionState state,
                                        int log,
                                        int verbosity)
Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream. The neighborhood size, clamp range, and initial velocity scale are not included -- it's assumed you're using the same values for them on reading, or understand that the values are revised.

Overrides:
printSubpopulationForHumans in class Subpopulation

printSubpopulation

public void printSubpopulation(EvolutionState state,
                               int log,
                               int verbosity)
Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream. The neighborhood size, clamp range, and initial velocity scale are not included -- it's assumed you're using the same values for them on reading, or understand that the values are revised.

Overrides:
printSubpopulation in class Subpopulation

printSubpopulation

public void printSubpopulation(EvolutionState state,
                               java.io.PrintWriter writer)
Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream. The neighborhood size, clamp range, and initial velocity scale are not included -- it's assumed you're using the same values for them on reading, or understand that the values are revised.

Overrides:
printSubpopulation in class Subpopulation

readSubpopulation

public void readSubpopulation(EvolutionState state,
                              java.io.LineNumberReader reader)
                       throws java.io.IOException
Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream. The neighborhood size, clamp range, and initial velocity scale are not included -- it's assumed you're using the same values for them on reading, or understand that the values are revised.

Overrides:
readSubpopulation in class Subpopulation
Throws:
java.io.IOException

writeSubpopulation

public void writeSubpopulation(EvolutionState state,
                               java.io.DataOutput dataOutput)
                        throws java.io.IOException
Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream. The neighborhood size, clamp range, and initial velocity scale are not included -- it's assumed you're using the same values for them on reading, or understand that the values are revised.

Overrides:
writeSubpopulation in class Subpopulation
Throws:
java.io.IOException

readSubpopulation

public void readSubpopulation(EvolutionState state,
                              java.io.DataInput dataInput)
                       throws java.io.IOException
Overridden to include the global best, neighborhood bests, personal bests, and previous individuals in the stream. The neighborhood size, clamp range, and initial velocity scale are not included -- it's assumed you're using the same values for them on reading, or understand that the values are revised.

Overrides:
readSubpopulation in class Subpopulation
Throws:
java.io.IOException