org.encog.ml.prg.generator
Class PrgGrowGenerator
- java.lang.Object
-
- org.encog.ml.prg.generator.AbstractPrgGenerator
-
- org.encog.ml.prg.generator.PrgGrowGenerator
-
- All Implemented Interfaces:
- PopulationGenerator, PrgGenerator, MultiThreadable
public class PrgGrowGenerator extends AbstractPrgGenerator
The grow generator creates a random program by choosing a random node from both the "function and terminal" sets until the maximum depth is reached. Once the maximum depth is reached only nodes from terminal set are chosen. This algorithm was implemented as described in the following publication: Genetic programming: on the programming of computers by means of natural selection MIT Press Cambridge, MA, USA (c)1992 ISBN:0-262-11170-5
-
-
Constructor Summary
Constructors Constructor and Description PrgGrowGenerator(EncogProgramContext theContext, int theMaxDepth)Construct the grow generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ProgramNodecreateNode(java.util.Random rnd, EncogProgram program, int depthRemaining, java.util.List<ValueType> types)Create a random node for an Encog Program.-
Methods inherited from class org.encog.ml.prg.generator.AbstractPrgGenerator
addPopulationMember, attemptCreateGenome, createRandomNode, createTerminalNode, determineMaxDepth, generate, generate, generateRandomOpcode, getContext, getMaxConst, getMaxDepth, getMaxGenerationErrors, getMinConst, getRandomFactory, getScore, getThreadCount, isHasEnum, setMaxConst, setMaxGenerationErrors, setMinConst, setRandomFactory, setScore, setThreadCount
-
-
-
-
Constructor Detail
-
PrgGrowGenerator
public PrgGrowGenerator(EncogProgramContext theContext, int theMaxDepth)
Construct the grow generator.- Parameters:
theContext- The program context.theMaxDepth- The max depth.
-
-
Method Detail
-
createNode
public ProgramNode createNode(java.util.Random rnd, EncogProgram program, int depthRemaining, java.util.List<ValueType> types)
Create a random node for an Encog Program.- Parameters:
rnd- Random number generator.program- The program that the node should be generated for.depthRemaining- The depth remaining to generate.types- The types to generate.- Returns:
- The newly created node.
-
-
DMelt 3.0 © DataMelt by jWork.ORG