org.encog.ml.prg.generator
Class AbstractGenerator
java.lang.Object
org.encog.ml.prg.generator.AbstractGenerator
- All Implemented Interfaces:
- PopulationGenerator, MultiThreadable
- Direct Known Subclasses:
- PrgGrowGenerator
public abstract class AbstractGenerator
- extends Object
- implements PopulationGenerator, MultiThreadable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractGenerator
public AbstractGenerator(EncogProgramContext theContext,
int theMaxDepth)
addPopulationMember
public void addPopulationMember(PrgPopulation population,
EncogProgram prg)
attemptCreateGenome
public EncogProgram attemptCreateGenome(Random rnd,
Population pop)
createLeafNode
public ProgramNode createLeafNode(Random rnd,
EncogProgram program)
createNode
public abstract ProgramNode createNode(Random rnd,
EncogProgram program,
int depth)
generate
public EncogProgram generate(Random rnd)
- Description copied from interface:
PopulationGenerator
- Generate a random genome.
- Specified by:
generate
in interface PopulationGenerator
- Parameters:
rnd
- A random number generator.
- Returns:
- A random genome.
generate
public ProgramNode generate(Random rnd,
EncogProgram program)
- Generate a new random branch that can be used with the specified program.
Does not actually attach the new branch anywhere.
- Parameters:
rnd
- Random number generator.program
- The program to generate a branch for.
- Returns:
- The new branch.
generate
public void generate(Random rnd,
Population pop)
- Description copied from interface:
PopulationGenerator
- Generate a random population.
- Specified by:
generate
in interface PopulationGenerator
- Parameters:
rnd
- Random number generator.pop
- The population to generate into.
generateRandomOpcode
public ProgramExtensionTemplate generateRandomOpcode(Random rnd,
List<ProgramExtensionTemplate> opcodes)
getContext
public EncogProgramContext getContext()
- Returns:
- the context
getLeaves
public List<ProgramExtensionTemplate> getLeaves()
- Returns:
- the leaves
getMaxConst
public double getMaxConst()
- Returns:
- the maxConst
getMaxDepth
public int getMaxDepth()
- Returns:
- the maxDepth
getMinConst
public double getMinConst()
- Returns:
- the minConst
getRandomFactory
public RandomFactory getRandomFactory()
- Returns:
- the randomFactory
getScore
public CalculateScore getScore()
- Returns:
- the score
getThreadCount
public int getThreadCount()
- Specified by:
getThreadCount
in interface MultiThreadable
- Returns:
- The desired number of threads.
isHasEnum
public boolean isHasEnum()
- Returns:
- the hasEnum
setMaxConst
public void setMaxConst(double maxConst)
- Parameters:
maxConst
- the maxConst to set
setMinConst
public void setMinConst(double minConst)
- Parameters:
minConst
- the minConst to set
setRandomFactory
public void setRandomFactory(RandomFactory randomFactory)
- Parameters:
randomFactory
- the randomFactory to set
setScore
public void setScore(CalculateScore score)
- Parameters:
score
- the score to set
setThreadCount
public void setThreadCount(int numThreads)
- Description copied from interface:
MultiThreadable
- Set the number of threads to use.
- Specified by:
setThreadCount
in interface MultiThreadable
- Parameters:
numThreads
- The desired thread count.
Copyright © 2013. All Rights Reserved.