ec.select
Class RandomSelection
- java.lang.Object
-
- ec.BreedingSource
-
- ec.SelectionMethod
-
- ec.select.RandomSelection
-
- All Implemented Interfaces:
- Prototype, Setup, SteadyStateBSourceForm, RandomChoiceChooserD, java.io.Serializable, java.lang.Cloneable
public class RandomSelection extends SelectionMethod implements SteadyStateBSourceForm
Picks a random individual in the subpopulation. This is mostly for testing purposes.Default Base
select.random- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringP_RANDOMdefault base-
Fields inherited from class ec.SelectionMethod
INDS_PRODUCED
-
Fields inherited from class ec.BreedingSource
NO_PROBABILITY, P_PROB, probability
-
-
Constructor Summary
Constructors Constructor and Description RandomSelection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ParameterdefaultBase()Returns the default base for this prototype.voidindividualReplaced(SteadyStateEvolutionState state, int subpopulation, int thread, int individual)Called whenever an individual has been replaced by another in the population.intproduce(int subpopulation, EvolutionState state, int thread)An alternative form of "produce" special to Selection Methods; selects an individual from the given subpopulation and returns its position in that subpopulation.intproduce(int min, int max, int start, int subpopulation, Individual[] inds, EvolutionState state, int thread)Produces n individuals from the given subpopulation and puts them into inds[start...start+n-1], where n = Min(Max(q,min),max), where q is the "typical" number of individuals the BreedingSource produces in one shot, and returns n.voidsourcesAreProperForm(SteadyStateEvolutionState state)Issue an error (not a fatal -- we guarantee that callers of this method will also call exitIfErrors) if any of your sources, or their sources, etc., are not of SteadyStateBSourceForm.-
Methods inherited from class ec.SelectionMethod
finishProducing, prepareToProduce, produces, typicalIndsProduced
-
Methods inherited from class ec.BreedingSource
clone, getProbability, pickRandom, preparePipeline, setProbability, setup, setupProbabilities
-
-
-
-
Field Detail
-
P_RANDOM
public static final java.lang.String P_RANDOM
default base- See Also:
- Constant Field Values
-
-
Method Detail
-
defaultBase
public Parameter defaultBase()
Description copied from interface:PrototypeReturns the default base for this prototype. This should generally be implemented by building off of the static base() method on the DefaultsForm object for the prototype's package. This should be callable during setup(...).- Specified by:
defaultBasein interfacePrototype
-
produce
public int produce(int subpopulation, EvolutionState state, int thread)Description copied from class:SelectionMethodAn alternative form of "produce" special to Selection Methods; selects an individual from the given subpopulation and returns its position in that subpopulation.- Specified by:
producein classSelectionMethod
-
produce
public int produce(int min, int max, int start, int subpopulation, Individual[] inds, EvolutionState state, int thread)Description copied from class:BreedingSourceProduces n individuals from the given subpopulation and puts them into inds[start...start+n-1], where n = Min(Max(q,min),max), where q is the "typical" number of individuals the BreedingSource produces in one shot, and returns n. max must be >= min, and min must be >= 1. For example, crossover might typically produce two individuals, tournament selection might typically produce a single individual, etc.- Overrides:
producein classSelectionMethod
-
individualReplaced
public void individualReplaced(SteadyStateEvolutionState state, int subpopulation, int thread, int individual)
Description copied from interface:SteadyStateBSourceFormCalled whenever an individual has been replaced by another in the population.- Specified by:
individualReplacedin interfaceSteadyStateBSourceForm
-
sourcesAreProperForm
public void sourcesAreProperForm(SteadyStateEvolutionState state)
Description copied from interface:SteadyStateBSourceFormIssue an error (not a fatal -- we guarantee that callers of this method will also call exitIfErrors) if any of your sources, or their sources, etc., are not of SteadyStateBSourceForm.- Specified by:
sourcesAreProperFormin interfaceSteadyStateBSourceForm
-
-
DMelt 3.0 © DataMelt by jWork.ORG