public class NEATSpecies extends GeneVectorSpecies
NEATSpecies must be used in combination with NEATBreeder, which will call it at appropriate times to reproduce new individuals for next generations. It must also be used in combination with NEATInitializer, which will use it to generate the initial population.
Parameters
base.weight-mut-power Floating-point value (default is 2.5) |
Mutation power of the link weights |
base.disjoint-coeff Floating-point value (default is 1.0) |
Coefficient for disjoint gene in compatibility computation |
base.excess-coeff Floating-point value (default is 1.0) |
Coefficient for excess genes in compatibility computation |
base.mutdiff-coeff Floating-point value (default is 0.4) |
Coefficient for mutational difference genes in compatibility computation |
base.compat-thresh Floating-point value (default is 3.0) |
Compatible threshold to determine if two individual are compatible |
base.age-significance Floating-point value (default is 1.0) |
How much does age matter? |
base.survival-thresh Floating-point value (default is 0.2) |
Percent of ave fitness for survival |
base.mutate-only-prob Floating-point value (default is 0.25) |
Probability of a non-mating reproduction |
base.mutate-link-weight-prob Floating-point value (default is 0.9) |
Probability of doing link weight mutate |
base.mutate-toggle-enable-prob Floating-point value (default is 0.0) |
Probability of changing the enable status of gene |
base.mutate-gene-reenable-prob Floating-point value (default is 0.0) |
Probability of reenable a disabled gene |
base.mutate-add-node-prob Floating-point value (default is 0.03) |
Probability of doing add-node mutation |
base.mutate-add-link-prob Floating-point value (default is 0.05) |
Probability of doing add-link mutation |
base.interspecies-mate-prob Floating-point value (default is 0.001) |
r Probability of doing interspecies crossover |
base.mate-multipoint-prob Floating-point value (default is 0.6) |
Probability of doing multipoint crossover |
base.mate-multipoint-avg-prob Floating-point value (default is 0.4) |
Probability of doing multipoint crossover with averaging two genes |
base.mate-singlepoint-prob Floating-point value (default is 0.0) |
Probability of doing single point crossover (not in used in this implementation, always set to 0) |
base.mate-only-prob Floating-point value (default is 0.2) |
Probability of mating without mutation |
base.recur-only-prob Floating-point value (default is 0.2) |
Probability of forcing selection of ONLY links that are naturally recurrent |
base.dropoff-age Integer (default is 15) |
Age where Species starts to be penalized |
base.new-link-tries Integer (default is 20) |
Number of tries mutateAddLink will attempt to find an open link | base.new-node-tries Integer (default is 20) |
Number of tries mutateAddNode will attempt to build a valid node. | base.add-node-max-genome-length Integer (default is 15) |
For genomes this size or larger, mutateAddNode will do a pure random split when adding the node. |
base.babies-stolen Integer (default is 0) |
The number of babies to siphen off to the champions |
base.node Classname, = ec.neat.NEATNode |
Class of node in a network |
base.subspecies Classname, = ec.neat.NEATSubspecies |
Class of subspecies in the species |
base.innovation Classname, = ec.neat.NEATInnovation |
Class of innovation in the species |
Default Base
neat.species
Parameter bases
base.species | species (the subpopulations' species) |
Modifier and Type | Class and Description |
---|---|
static class |
NEATSpecies.MutationType |
Modifier and Type | Field and Description |
---|---|
int |
addNodeMaxGenomeLength
Beyond this genome length, mutateAddNode does a pure random split rather than a bias.
|
double |
ageSignificance
How much does age matter?
|
int |
babiesStolen
The number of babies to siphen off to the champions.
|
Parameter |
base |
double |
compatThreshold
Compatible threshold to determine if two individual are compatible.
|
int |
currNodeId
Current node id that is available.
|
double |
disjointCoeff
Coefficient for disjoint gene in compatibility computation.
|
int |
dropoffAge
Age where Species starts to be penalized.
|
double |
excessCoeff
Coefficient for excess genes in compatibility computation.
|
double |
highestFitness
Used for delta coding, stagnation detector.
|
int |
highestLastChanged
Used for delta coding, If too high, leads to delta coding.
|
NEATInnovation |
innovationPrototype
The prototypical innovation for individuals in this species.
|
java.util.HashMap<NEATInnovation,NEATInnovation> |
innovations
A Hashmap for easy tracking the innovation within species.
|
double |
interspeciesMateRate
Probability of doing interspecies crossover.
|
double |
mateMultipointAvgProb
Probability of doing multipoint crossover with averaging two genes.
|
double |
mateMultipointProb
Probability of doing multipoint crossover.
|
double |
mateOnlyProb
Probability of mating without mutation.
|
double |
mateSinglepointProb
Probability of doing single point crossover (not in used in this
implementation, always set to 0).
|
int |
maxNetworkDepth
how deep a node can be in the network, measured by number of parents
|
double |
mutateAddLinkProb
Probability of doing add-link mutation.
|
double |
mutateAddNodeProb
Probability of doing add-node mutation.
|
double |
mutateGeneReenableProb
Probability of reenable a disabled gene.
|
double |
mutateLinkWeightsProb
Probability of doing link weight mutate.
|
double |
mutateOnlyProb
Probility of a non-mating reproduction.
|
double |
mutateToggleEnableProb
Probability of changing the enable status of gene.
|
double |
mutDiffCoeff
Coefficient for mutational difference genes in compatibility computation.
|
NEATNetwork |
networkPrototype
The prototypical network.
|
int |
newLinkTries
Number of tries mutateAddLink will attempt to find an open link.
|
int |
newNodeTries
Number of tries mutateAddNode will attempt to build a new node.
|
NEATNode |
nodePrototype
The prototypical node for individuals in this species.
|
static java.lang.String |
P_ADD_NODE_MAX_GENOME_LENGTH |
static java.lang.String |
P_AGE_SIGNIFICANCE |
static java.lang.String |
P_BABIES_STOLEN |
static java.lang.String |
P_COMPAT_THRESH |
static java.lang.String |
P_DISJOINT_COEFF |
static java.lang.String |
P_DROPOFF_AGE |
static java.lang.String |
P_EXCESS_COEFF |
static java.lang.String |
P_INNOVATION |
static java.lang.String |
P_INTERSPECIES_MATE_PROB |
static java.lang.String |
P_MATE_MULTIPOINT_AVG_PROB |
static java.lang.String |
P_MATE_MULTIPOINT_PROB |
static java.lang.String |
P_MATE_ONLY_PROB |
static java.lang.String |
P_MATE_SINGLE_POINT_PROB |
static java.lang.String |
P_MAX_NETWORK_DEPTH |
static java.lang.String |
P_MUT_DIFF_COEFF |
static java.lang.String |
P_MUTATE_ADD_LINK_PROB |
static java.lang.String |
P_MUTATE_ADD_NODE_PROB |
static java.lang.String |
P_MUTATE_GENE_REENABLE_PROB |
static java.lang.String |
P_MUTATE_LINK_WEIGHT_PROB |
static java.lang.String |
P_MUTATE_ONLY_PROB |
static java.lang.String |
P_MUTATE_TOGGLE_ENABLE_PROB |
static java.lang.String |
P_NETWORK |
static java.lang.String |
P_NEW_LINK_TRIES |
static java.lang.String |
P_NEW_NODE_TRIES |
static java.lang.String |
P_NODE |
static java.lang.String |
P_RECUR_ONLY_PROB |
static java.lang.String |
P_SPECIES |
static java.lang.String |
P_SUBSPECIES |
static java.lang.String |
P_SURVIVIAL_THRESH |
static java.lang.String |
P_WEIGHT_MUT_POWER |
double |
recurOnlyProb
Probability of forcing selection of ONLY links that are naturally
recurrent.
|
java.util.ArrayList<NEATSubspecies> |
subspecies
A list of the all the subspecies.
|
NEATSubspecies |
subspeciesPrototype
The prototypical subspecies for individuals in this species.
|
double |
survivalThreshold
Percent of ave fitness for survival.
|
double |
weightMutationPower
The Mutation power of the link's weights.
|
genePrototype, P_GENE
C_ANY_POINT, C_GEOMETRIC, C_INTERMED_RECOMB, C_LINE_RECOMB, C_NONE, C_ONE_POINT, C_ONE_POINT_NO_NOP, C_SIMULATED_BINARY, C_TWO_POINT, C_TWO_POINT_NO_NOP, C_UNIFORM, chunksize, crossoverDistributionIndex, crossoverProbability, crossoverType, duplicateRetries, dynamicInitialSize, genomeIncreaseProbability, genomeResizeAlgorithm, genomeSize, lineDistance, maxInitialSize, minInitialSize, mutationProbability, P_CHUNKSIZE, P_CROSSOVER_DISTRIBUTION_INDEX, P_CROSSOVERPROB, P_CROSSOVERTYPE, P_DUPLICATE_RETRIES, P_GENOMESIZE, P_GEOMETRIC_PROBABILITY, P_LINEDISTANCE, P_MUTATIONPROB, P_NUM_SEGMENTS, P_SEGMENT, P_SEGMENT_END, P_SEGMENT_START, P_SEGMENT_TYPE, P_UNIFORM_MAX, P_UNIFORM_MIN, P_VECTORSPECIES, V_ANY_POINT, V_GEOMETRIC, V_INTERMED_RECOMB, V_LINE_RECOMB, V_ONE_POINT, V_ONE_POINT_NO_NOP, V_SIMULATED_BINARY, V_TWO_POINT, V_TWO_POINT_NO_NOP, V_UNIFORM
f_prototype, i_prototype, P_FITNESS, P_INDIVIDUAL, P_PIPE, pipe_prototype
Constructor and Description |
---|
NEATSpecies() |
Modifier and Type | Method and Description |
---|---|
void |
addInnovation(NEATInnovation inno) |
void |
breedNewPopulation(EvolutionState state,
int subpop,
int thread)
Breed a new generation of population, this is done by first figure the
expected offsprings for each subspecies, and then calls each subspecies
to reproduce.
|
void |
clearEvaluationFlag(java.util.ArrayList<Individual> individuals)
Clear the evaluation flag in each individual.
|
double |
compatibility(NEATIndividual a,
NEATIndividual b)
This function gives a measure of compatibility between two Genomes by
computing a linear combination of 3 characterizing variables of their
compatibilty.
|
void |
countOffspring(EvolutionState state,
int subpop)
Determine the offsprings for all the subspecies.
|
Parameter |
defaultBase()
Returns the default base for this prototype.
|
void |
deltaCoding(EvolutionState state,
int subpop,
java.util.ArrayList<NEATSubspecies> sortedSubspecies)
Perform a delta coding.
|
NEATInnovation |
getInnovation(NEATInnovation inno) |
boolean |
hasInnovation(NEATInnovation inno) |
Individual |
newIndividual(EvolutionState state,
int thread,
java.util.ArrayList<NEATNode> nodes,
java.util.ArrayList<Gene> genes)
Create a new individual with given nodes and genes
|
int |
nextInnovationNumber() |
void |
populationStagnation(EvolutionState state,
int subpop,
java.util.ArrayList<NEATSubspecies> sortedSubspecies)
Determine if the whole subpopulation get into stagnation.
|
void |
setInnovationNumber(int num) |
void |
setup(EvolutionState state,
Parameter base)
The default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities.
|
NEATIndividual |
spawnWithTemplate(EvolutionState state,
NEATSpecies species,
int thread,
NEATIndividual ind)
Spawn a new individual with given individual as template.
|
void |
speciate(EvolutionState state,
Individual ind)
Assign the individual into a species, if not found, create a new one
|
void |
stealBabies(EvolutionState state,
int thread,
int subpop,
java.util.ArrayList<NEATSubspecies> sortedSubspecies)
Steal the babies from champion subspecies.
|
contains, contains, contains, contains, duplicateRetries, fill, fill, fill, fill, initializeGenomeSegmentsByEndIndices, initializeGenomeSegmentsByStartIndices, loadParametersForGene, mutationProbability, newIndividual, setupGenome
buildMisc, clone, newIndividual, newIndividual, updateIndividual, updateSubpopulation
public static final java.lang.String P_SPECIES
public static final java.lang.String P_NODE
public static final java.lang.String P_NETWORK
public static final java.lang.String P_SUBSPECIES
public static final java.lang.String P_INNOVATION
public static final java.lang.String P_WEIGHT_MUT_POWER
public static final java.lang.String P_DISJOINT_COEFF
public static final java.lang.String P_EXCESS_COEFF
public static final java.lang.String P_MUT_DIFF_COEFF
public static final java.lang.String P_COMPAT_THRESH
public static final java.lang.String P_AGE_SIGNIFICANCE
public static final java.lang.String P_SURVIVIAL_THRESH
public static final java.lang.String P_MUTATE_ONLY_PROB
public static final java.lang.String P_MUTATE_LINK_WEIGHT_PROB
public static final java.lang.String P_MUTATE_TOGGLE_ENABLE_PROB
public static final java.lang.String P_MUTATE_GENE_REENABLE_PROB
public static final java.lang.String P_MUTATE_ADD_NODE_PROB
public static final java.lang.String P_MUTATE_ADD_LINK_PROB
public static final java.lang.String P_INTERSPECIES_MATE_PROB
public static final java.lang.String P_MATE_MULTIPOINT_PROB
public static final java.lang.String P_MATE_MULTIPOINT_AVG_PROB
public static final java.lang.String P_MATE_SINGLE_POINT_PROB
public static final java.lang.String P_MATE_ONLY_PROB
public static final java.lang.String P_RECUR_ONLY_PROB
public static final java.lang.String P_DROPOFF_AGE
public static final java.lang.String P_NEW_LINK_TRIES
public static final java.lang.String P_NEW_NODE_TRIES
public static final java.lang.String P_BABIES_STOLEN
public static final java.lang.String P_MAX_NETWORK_DEPTH
public static final java.lang.String P_ADD_NODE_MAX_GENOME_LENGTH
public NEATNode nodePrototype
public NEATNetwork networkPrototype
public NEATSubspecies subspeciesPrototype
public NEATInnovation innovationPrototype
public int currNodeId
public double highestFitness
public int highestLastChanged
public double weightMutationPower
public double disjointCoeff
public double excessCoeff
public double mutDiffCoeff
public double compatThreshold
public double ageSignificance
public double survivalThreshold
public double mutateOnlyProb
public double mutateLinkWeightsProb
public double mutateToggleEnableProb
public double mutateGeneReenableProb
public double mutateAddNodeProb
public double mutateAddLinkProb
public double interspeciesMateRate
public double mateMultipointProb
public double mateMultipointAvgProb
public double mateSinglepointProb
public double mateOnlyProb
public double recurOnlyProb
public int dropoffAge
public int newLinkTries
public int newNodeTries
public int babiesStolen
public int maxNetworkDepth
public int addNodeMaxGenomeLength
public Parameter base
public java.util.ArrayList<NEATSubspecies> subspecies
public java.util.HashMap<NEATInnovation,NEATInnovation> innovations
public void setup(EvolutionState state, Parameter base)
Species
setup
in interface Prototype
setup
in interface Setup
setup
in class GeneVectorSpecies
Prototype.setup(EvolutionState,Parameter)
public Parameter defaultBase()
Prototype
defaultBase
in interface Prototype
defaultBase
in class VectorSpecies
public int nextInnovationNumber()
public void setInnovationNumber(int num)
public void speciate(EvolutionState state, Individual ind)
public NEATIndividual spawnWithTemplate(EvolutionState state, NEATSpecies species, int thread, NEATIndividual ind)
public double compatibility(NEATIndividual a, NEATIndividual b)
public void countOffspring(EvolutionState state, int subpop)
public void breedNewPopulation(EvolutionState state, int subpop, int thread)
public void deltaCoding(EvolutionState state, int subpop, java.util.ArrayList<NEATSubspecies> sortedSubspecies)
public void populationStagnation(EvolutionState state, int subpop, java.util.ArrayList<NEATSubspecies> sortedSubspecies)
public void stealBabies(EvolutionState state, int thread, int subpop, java.util.ArrayList<NEATSubspecies> sortedSubspecies)
public Individual newIndividual(EvolutionState state, int thread, java.util.ArrayList<NEATNode> nodes, java.util.ArrayList<Gene> genes)
public boolean hasInnovation(NEATInnovation inno)
public NEATInnovation getInnovation(NEATInnovation inno)
public void addInnovation(NEATInnovation inno)
public void clearEvaluationFlag(java.util.ArrayList<Individual> individuals)