Class BitVectorSpecies
- All Implemented Interfaces:
Prototype,Setup,Serializable,Cloneable
BitVectorSpecies can specify some parameters globally, per-segment, and per-gene. See VectorSpecies for information on how to this works.
BitVectorSpecies provides support for two ways of mutating a gene.
- reset Replacing the gene's value with a value uniformly drawn from the gene's range [true, false].
- flipFlipping the bit of the gene value. This is the default.
BitVectorSpecies provides support for two ways of initializing a gene. The initialization procedure is determined by the choice of mutation procedure as described above. If the mutation is floating-point (reset, gauss, polynomial), then initialization will be done by resetting the gene to uniformly chosen double floating-point value between the minimum and maximum legal gene values, inclusive. If the mutation is integer (integer-reset, integer-random-walk), then initialization will be done by performing the same kind of reset, but restricting values to integers only.
Parameters
| base.mutation-type or | |
| base.segment.segment-number.mutation-type or | |
| base.mutation-prob.gene-number reset, flip, (default=flip) |
(the mutation type) |
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intprotected int[]Mutation type, per gene.static final Stringstatic final Stringstatic final StringFields inherited from class ec.vector.VectorSpecies
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_UNIFORMFields inherited from class ec.Species
f_prototype, i_prototype, P_FITNESS, P_INDIVIDUAL, P_PIPE, pipe_prototype -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidloadParametersForGene(EvolutionState state, int index, Parameter base, Parameter def, String postfix) Called when VectorSpecies is setting up per-gene and per-segment parameters.intmutationType(int gene) voidsetup(EvolutionState state, Parameter base) The default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities.Methods inherited from class ec.vector.VectorSpecies
contains, contains, contains, contains, defaultBase, duplicateRetries, fill, fill, fill, fill, initializeGenomeSegmentsByEndIndices, initializeGenomeSegmentsByStartIndices, mutationProbability, newIndividual, setupGenomeMethods inherited from class ec.Species
buildMisc, clone, newIndividual, newIndividual, updateIndividual, updateSubpopulation
-
Field Details
-
P_MUTATIONTYPE
- See Also:
-
V_RESET_MUTATION
- See Also:
-
V_FLIP_MUTATION
- See Also:
-
C_RESET_MUTATION
public static final int C_RESET_MUTATION- See Also:
-
C_FLIP_MUTATION
public static final int C_FLIP_MUTATION- See Also:
-
mutationType
protected int[] mutationTypeMutation type, per gene. This array is one longer than the standard genome length. The top element in the array represents the parameters for genes in genomes which have extended beyond the genome length.
-
-
Constructor Details
-
BitVectorSpecies
public BitVectorSpecies()
-
-
Method Details
-
mutationType
public int mutationType(int gene) -
setup
Description copied from class:SpeciesThe default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities. If your individual prototype might need to know special things about the species (like parameters stored in it), then when you override this setup method, you'll need to set those parameters BEFORE you call super.setup(...), because the setup(...) code in Species sets up the prototype. -
loadParametersForGene
protected void loadParametersForGene(EvolutionState state, int index, Parameter base, Parameter def, String postfix) Called when VectorSpecies is setting up per-gene and per-segment parameters. The index is the current gene whose parameter is getting set up. The Parameters in question are the bases for the gene. The postfix should be appended to the end of any parameter looked up (it often contains a number indicating the gene in question), such as state.parameters.exists(base.push(P_PARAM).push(postfix), def.push(P_PARAM).push(postfix)If you override this method, be sure to call super(...) at some point, ideally first.
- Overrides:
loadParametersForGenein classVectorSpecies
-