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

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

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

Initialisation implementation which produces full program trees.


Constructor Summary
FullInitialiser(GPModel<TYPE> model)
          Constructor for the full initialiser.
 
Method Summary
 Node<TYPE> buildFullNodeTree(int depth)
          Build a full node tree with a given depth.
 java.util.List<CandidateProgram<TYPE>> getInitialPopulation()
          Generate a population of new CandidatePrograms constructed from the function and terminal sets defined by the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FullInitialiser

public FullInitialiser(GPModel<TYPE> model)
Constructor for the full initialiser.

Parameters:
model - The current controlling model. Run parameters such as the population size will be obtained from this.
Method Detail

getInitialPopulation

public java.util.List<CandidateProgram<TYPE>> getInitialPopulation()
Generate a population of new CandidatePrograms constructed from the function and terminal sets defined by the model. The size of the population will be equal to the result of calling getPopulationSize() on the controlling model. All programs in the population will be unique. Each candidate program will have a full node tree with a depth as given by a call to getInitialMaxDepth() on the model.

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

buildFullNodeTree

public Node<TYPE> buildFullNodeTree(int depth)
Build a full node tree with a given depth. As the node tree will be full the maximum and minimum depths of the returned node tree should be equal to the depth argument. The internal and leaf nodes will be selected from the function and terminal sets respectively, as provided by the model.

Parameters:
depth - The depth of the full node tree, where the depth is the number of nodes from the root.
Returns:
The root node of a randomly generated full node tree of the requested depth.