com.epochx.op.initialisation
Class RampedHalfAndHalfInitialiser<TYPE>

java.lang.Object
  extended by com.epochx.op.initialisation.RampedHalfAndHalfInitialiser<TYPE>
All Implemented Interfaces:
Initialiser<TYPE>

public class RampedHalfAndHalfInitialiser<TYPE>
extends java.lang.Object
implements Initialiser<TYPE>

Initialisation implementation which uses a combination of full and grow initialisers to create an initial population of CandidatePrograms.

Depths are equally split between depths of 2 up to the maximum initial depth as specified by the model. Initialisation of individuals at each of these depths is then alternated between full and grow initialisers.

There will not always be an equal number of programs created to each depth, this will depend on if the population size is exactly divisible by the range of depths (initial maximum depth - 2). If the range of depths is greater than the population size then some depths will not occur at all in order to ensure as wide a spread of depths up to the maximum as possible.


Constructor Summary
RampedHalfAndHalfInitialiser(GPModel<TYPE> model)
          Construct a RampedHalfAndHalfInitialiser.
 
Method Summary
 java.util.List<CandidateProgram<TYPE>> getInitialPopulation()
          Will use grow initialisation on half the population and full on the other half.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RampedHalfAndHalfInitialiser

public RampedHalfAndHalfInitialiser(GPModel<TYPE> model)
Construct a RampedHalfAndHalfInitialiser.

Parameters:
model - The model being assessed
Method Detail

getInitialPopulation

public java.util.List<CandidateProgram<TYPE>> getInitialPopulation()
Will use grow initialisation on half the population and full on the other half. If the population size is an odd number then the extra individual will be initialised with grow.

Specified by:
getInitialPopulation in interface Initialiser<TYPE>
Returns:
A List of newly generated CandidatePrograms which will form the initial population for a GP run.