Operator
Class RampedHalfAndHalfInitialiser
java.lang.Object
Operator.OperatorModule
Operator.SourceModule
Operator.Initialiser
Operator.RampedHalfAndHalfInitialiser
- All Implemented Interfaces:
- Creator, Module, Operator, ParameterI, Stochastic
public class RampedHalfAndHalfInitialiser
- extends Initialiser
Class for performing ramped full and grow initialization.
The population is divided(ramped) between minimum depth(shortest possible depth of a derivationTree)
and maximum depth(Maximum allowed depth of a derivationTree).
For each individual the full or the grow operation is chosen.
Method Summary |
int |
getDepthInterval(int populationSize)
Calculates how the population should be partitioned between the different
initialisation depths |
void |
perform()
The population is divided(ramped) between minimum depth(shortest possible depth of a derivationTree)
and maximum depth(Maximum allowed depth of a derivationTree). |
void |
setOperations(java.util.List<CreationOperation> ops)
First item in collection is set as fullInitalion. |
void |
setProperties(java.util.Properties p)
Set properties |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
growInitialisation
protected CreationOperation growInitialisation
growProb
protected double growProb
currentDepth
protected int currentDepth
maxDepth
protected int maxDepth
depthInterval
protected int depthInterval
RampedHalfAndHalfInitialiser
public RampedHalfAndHalfInitialiser(RandomNumberGenerator rng,
int size,
CreationOperation op,
CreationOperation op2,
double growProb,
int maxDepth)
- New instance
- Parameters:
rng
- random number generatorsize
- sizeop
- operationop2
- operationgrowProb
- probability of chosing grow operationmaxDepth
- max depth of initalised trees
RampedHalfAndHalfInitialiser
public RampedHalfAndHalfInitialiser()
- New instance
setProperties
public void setProperties(java.util.Properties p)
- Description copied from interface:
ParameterI
- Set properties
- Specified by:
setProperties
in interface ParameterI
- Overrides:
setProperties
in class Initialiser
- Parameters:
p
- object containing properties
perform
public void perform()
- The population is divided(ramped) between minimum depth(shortest possible depth of a derivationTree)
and maximum depth(Maximum allowed depth of a derivationTree).
For each individual the full or the grow operation is chosen.
- Specified by:
perform
in interface Module
- Overrides:
perform
in class Initialiser
getDepthInterval
public int getDepthInterval(int populationSize)
- Calculates how the population should be partitioned between the different
initialisation depths
- Parameters:
populationSize
- Size of the population
- Returns:
- The interval for each depth
setOperations
public void setOperations(java.util.List<CreationOperation> ops)
- First item in collection is set as fullInitalion.
Second item is set as growInitialisation.
- Parameters:
ops
- List of the operations to be set