|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgap.Configuration
org.jgap.gp.impl.GPConfiguration
public class GPConfiguration
Configuration for a GP.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
GPConfiguration()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addGeneticOperator(GeneticOperator a_operatorToAdd)
Adds a genetic operator for use in this algorithm. |
void |
clearMemory()
Clears the memory. |
void |
clearStack()
|
CrossMethod |
getCrossMethod()
|
double |
getCrossoverProb()
|
IGPFitnessEvaluator |
getGPFitnessEvaluator()
|
GPFitnessFunction |
getGPFitnessFunction()
|
int |
getMaxCrossoverDepth()
|
int |
getMaxInitDepth()
|
double |
getNewChromsPercent()
|
INodeValidator |
getNodeValidator()
|
int |
getProgramCreationMaxtries()
|
double |
getReproductionProb()
|
INaturalGPSelector |
getSelectionMethod()
|
boolean |
isStrictProgramCreation()
|
java.lang.Object |
peekStack()
|
java.lang.Object |
popFromStack()
|
void |
pushToStack(java.lang.Object a_value)
|
java.lang.Object |
readFromMemory(java.lang.String a_name)
Reads a value from the internal memory. |
void |
setCrossoverProb(float a_crossoverProb)
|
void |
setFitnessFunction(GPFitnessFunction a_functionToSet)
Sets the fitness function to be used for this genetic algorithm. |
void |
setMaxCrossoverDepth(int a_maxCrossoverDepth)
|
void |
setMaxInitDepth(int a_maxDepth)
|
void |
setNewChromsPercent(double a_newChromsPercent)
|
void |
setNodeValidator(INodeValidator a_nodeValidator)
Sets the node validator. |
void |
setProgramCreationMaxTries(int a_maxtries)
|
void |
setReproductionProb(float a_reproductionProb)
|
void |
setStrictProgramCreation(boolean a_strict)
|
int |
stackSize()
|
void |
storeInMemory(java.lang.String a_name,
java.lang.Object a_value)
Stores a value in the internal memory. |
boolean |
validateNode(ProgramChromosome a_chrom,
CommandGene a_node,
int a_tries,
int a_num,
int a_recursLevel,
java.lang.Class a_type,
CommandGene[] a_functionSet,
int a_depth,
boolean a_grow)
Validates a_node in the context of a_chrom. |
void |
verifyStateIsValid()
Tests the state of this Configuration object to make sure it's valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GPConfiguration()
throws InvalidConfigurationException
InvalidConfigurationException| Method Detail |
|---|
public void verifyStateIsValid()
throws InvalidConfigurationException
Configuration
verifyStateIsValid in class ConfigurationInvalidConfigurationException - if the state of this Configuration
is not valid. The error message in the exception will detail the reason
for invalidity
public void addGeneticOperator(GeneticOperator a_operatorToAdd)
throws InvalidConfigurationException
Configuration
addGeneticOperator in class Configurationa_operatorToAdd - The genetic operator to add.
InvalidConfigurationException - if the genetic operator is null or
if this Configuration object is lockedpublic double getCrossoverProb()
public void setCrossoverProb(float a_crossoverProb)
public double getReproductionProb()
public void setReproductionProb(float a_reproductionProb)
public void setNewChromsPercent(double a_newChromsPercent)
public double getNewChromsPercent()
public int getMaxCrossoverDepth()
public void setMaxCrossoverDepth(int a_maxCrossoverDepth)
public INaturalGPSelector getSelectionMethod()
public CrossMethod getCrossMethod()
public int getMaxInitDepth()
public void setMaxInitDepth(int a_maxDepth)
public void pushToStack(java.lang.Object a_value)
public java.lang.Object popFromStack()
public java.lang.Object peekStack()
public int stackSize()
public void clearStack()
public void storeInMemory(java.lang.String a_name,
java.lang.Object a_value)
a_name - named index of the memory cella_value - the value to storepublic java.lang.Object readFromMemory(java.lang.String a_name)
a_name - named index of the memory cell to read out
public void clearMemory()
public GPFitnessFunction getGPFitnessFunction()
public void setFitnessFunction(GPFitnessFunction a_functionToSet)
throws InvalidConfigurationException
a_functionToSet - fitness function to be used
InvalidConfigurationException - if the fitness function is null, or
if this Configuration object is locked.public boolean isStrictProgramCreation()
public void setStrictProgramCreation(boolean a_strict)
public int getProgramCreationMaxtries()
public void setProgramCreationMaxTries(int a_maxtries)
public IGPFitnessEvaluator getGPFitnessEvaluator()
public boolean validateNode(ProgramChromosome a_chrom,
CommandGene a_node,
int a_tries,
int a_num,
int a_recursLevel,
java.lang.Class a_type,
CommandGene[] a_functionSet,
int a_depth,
boolean a_grow)
a_chrom - the chromosome that will contain the node, if valida_node - the node selected and to be validateda_tries - number of times the validator has been called, useful for
stopping by returning true if the number exceeds a limita_num - the chromosome's index in the individual of this chromosomea_recursLevel - level of recursiona_type - the return type of the node neededa_functionSet - the array of available functionsa_depth - the needed depth of the program chromosomea_grow - true: use grow mode, false: use full mode
public void setNodeValidator(INodeValidator a_nodeValidator)
a_nodeValidator - sicpublic INodeValidator getNodeValidator()
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||