Package ec.pso

Class PSOBreeder

java.lang.Object
ec.Breeder
ec.pso.PSOBreeder
All Implemented Interfaces:
Setup, Singleton, Serializable

public class PSOBreeder extends Breeder
PSOBreeder is a simple single-threaded Breeder which performs Particle Swarm Optimization using the Particle class as individuals. PSOBreeder relies on a number of parameters which define weights for various vectors computed during Particle Swarm Optimization, plus a few flags:
  • Neighborhoods for particles have a size S determined by the parameter neighborhood-size. It's best if S were even.
  • Neighborhoods for particles are constructed in one of three ways:
    • random: pick S informants randomly without replacement within the subpopulation, not including the particle itself, once at the beginning of the run.
    • random-each-time: pick S informants randomly without replacement within the subpopulation, not including the particle itself, every single generation.
    • toroidal: pick the floor(S/2) informants to the left of the particle's location within the subpopulation and the ceiling(S/2) informants to the right of the particle's location in the subpopulation, once at the beginning of the run.
  • To this you can add the particle itself to the neighborhood, with include-self.
  • The basic velocity update equation is VELOCITY invalid input: '<'-- (VELOCITY * velocity-coefficent) + (VECTOR-TO-GLOBAL-BEST * global-coefficient) + (VECTOR-TO-NEIGHBORHOOD-BEST * informant-coefficient) + (VECTOR-TO-PERSONAL-BEST * personal-coefficient)
  • The basic particle update equation is PARTICLE invalid input: '<'-- PARTICLE + VELOCITY

Parameters

base.velocity-coefficient
float ≥ 0
(The weight for the velocity)
base.personal-coefficient
float ≥ 0
(The weight for the personal-best vector)
base.informant-coefficient
float ≥ 0
(The weight for the neighborhood/informant-best vector)
base.global-coefficient
float ≥ 0
(The weight for the global-best vector)
base.neighborhood-size
int > 0
(The size of the neighborhood of informants, not including the particle)
base.neighborhood-style
String, one of: random toroidal random-each-time
(The method of generating the neighborhood of informants, not including the particle)
base.include-self
true or false (default)
(Whether to include the particle itself as a member of the neighborhood after building the neighborhood)
See Also:
  • Field Details

    • C_NEIGHBORHOOD_RANDOM

      public static final int C_NEIGHBORHOOD_RANDOM
      See Also:
    • C_NEIGHBORHOOD_TOROIDAL

      public static final int C_NEIGHBORHOOD_TOROIDAL
      See Also:
    • C_NEIGHBORHOOD_RANDOM_EACH_TIME

      public static final int C_NEIGHBORHOOD_RANDOM_EACH_TIME
      See Also:
    • P_VELOCITY_COEFFICIENT

      public static final String P_VELOCITY_COEFFICIENT
      See Also:
    • P_PERSONAL_COEFFICIENT

      public static final String P_PERSONAL_COEFFICIENT
      See Also:
    • P_INFORMANT_COEFFICIENT

      public static final String P_INFORMANT_COEFFICIENT
      See Also:
    • P_GLOBAL_COEFFICIENT

      public static final String P_GLOBAL_COEFFICIENT
      See Also:
    • P_INCLUDE_SELF

      public static final String P_INCLUDE_SELF
      See Also:
    • P_NEIGHBORHOOD

      public static final String P_NEIGHBORHOOD
      See Also:
    • P_NEIGHBORHOOD_SIZE

      public static final String P_NEIGHBORHOOD_SIZE
      See Also:
    • V_NEIGHBORHOOD_RANDOM

      public static final String V_NEIGHBORHOOD_RANDOM
      See Also:
    • V_NEIGHBORHOOD_TOROIDAL

      public static final String V_NEIGHBORHOOD_TOROIDAL
      See Also:
    • V_NEIGHBORHOOD_RANDOM_EACH_TIME

      public static final String V_NEIGHBORHOOD_RANDOM_EACH_TIME
      See Also:
    • neighborhood

      public int neighborhood
    • velCoeff

      public double velCoeff
    • personalCoeff

      public double personalCoeff
    • informantCoeff

      public double informantCoeff
    • globalCoeff

      public double globalCoeff
    • neighborhoodSize

      public int neighborhoodSize
    • includeSelf

      public boolean includeSelf
    • globalBest

      public double[][] globalBest
    • globalBestFitness

      public Fitness[] globalBestFitness
  • Constructor Details

    • PSOBreeder

      public PSOBreeder()
  • Method Details

    • 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.
    • breedPopulation

      public Population breedPopulation(EvolutionState state)
      Description copied from class: Breeder
      Breeds state.population, returning a new population. In general, state.population should not be modified.
      Specified by:
      breedPopulation in class Breeder