examples.gp.tictactoe
Class SingleNodeValidator
java.lang.Object
examples.gp.tictactoe.SingleNodeValidator
- All Implemented Interfaces:
- ISingleNodeValidator
public class SingleNodeValidator
- extends java.lang.Object
- implements ISingleNodeValidator
Valides single nodes during GP program creation to make this process more
efficient.
- Since:
- 3.6
Method Summary |
boolean |
isAllowed(int a_chromIndex,
ProgramChromosome a_pc,
CommandGene[] a_functionSet,
CommandGene a_function,
java.lang.Class a_returnType,
int a_subReturnTyp,
int m_index)
Checks if the given a_function is allowed in the current context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingleNodeValidator
public SingleNodeValidator()
isAllowed
public boolean isAllowed(int a_chromIndex,
ProgramChromosome a_pc,
CommandGene[] a_functionSet,
CommandGene a_function,
java.lang.Class a_returnType,
int a_subReturnTyp,
int m_index)
- Checks if the given a_function is allowed in the current context.
- Specified by:
isAllowed
in interface ISingleNodeValidator
- Parameters:
a_chromIndex
- index of the chromosome within the GP programa_pc
- the instance of the ProgramChromosomea_functionSet
- the current function set within the program chromosome
(given as input parameter for convenience, could also be determined via
a_pc.m_genes)a_function
- the function that should be added, if alloweda_returnType
- the class the return type is required to havea_subReturnTyp
- the sub return type the return type is required to
havem_index
- the index of the up-to-date last command gene in the
program chromosome
- Returns:
- true if a_function's class exists within a_functionSet
- Since:
- 3.6