Package ec.pso
Class PSOBreeder
java.lang.Object
ec.Breeder
ec.pso.PSOBreeder
- All Implemented Interfaces:
Setup,Singleton,Serializable
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intdouble[][]Fitness[]doublebooleandoubleintintstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringdoublestatic final Stringstatic final Stringstatic final StringdoubleFields inherited from class ec.Breeder
sequentialBreeding -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbreedPopulation(EvolutionState state) Breeds state.population, returning a new population.voidsetup(EvolutionState state, Parameter base) Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.Methods inherited from class ec.Breeder
shouldBreedSubpop
-
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
- See Also:
-
P_PERSONAL_COEFFICIENT
- See Also:
-
P_INFORMANT_COEFFICIENT
- See Also:
-
P_GLOBAL_COEFFICIENT
- See Also:
-
P_INCLUDE_SELF
- See Also:
-
P_NEIGHBORHOOD
- See Also:
-
P_NEIGHBORHOOD_SIZE
- See Also:
-
V_NEIGHBORHOOD_RANDOM
- See Also:
-
V_NEIGHBORHOOD_TOROIDAL
- See Also:
-
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
-
-
Constructor Details
-
PSOBreeder
public PSOBreeder()
-
-
Method Details
-
setup
Description copied from interface:SetupSets 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
Description copied from class:BreederBreeds state.population, returning a new population. In general, state.population should not be modified.- Specified by:
breedPopulationin classBreeder
-