org.encog.ml.prg.opp
Class LevelHolder
- java.lang.Object
-
- org.encog.ml.prg.opp.LevelHolder
-
public class LevelHolder extends java.lang.ObjectThe level holder class is passed down as a tree is mutated. The level holder class is initially given the desired output of the program and tracks the desired output for each of the nodes. This allows for type-safe crossovers and mutations.
-
-
Constructor Summary
Constructors Constructor and Description LevelHolder(int currentLevel)Construct the level holder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static booleancompatibleTypes(java.util.List<ValueType> parentTypes, java.util.List<ValueType> childTypes)Determine if the specified child types are compatible with the parent types.voiddecreaseLevel()Decrease the level.intgetCurrentLevel()ProgramNodegetNodeFound()java.util.List<ValueType>getTypes()voidsetCurrentLevel(int currentLevel)voidsetNodeFound(ProgramNode nodeFound)voidsetTypes(java.util.List<ValueType> types)
-
-
-
Constructor Detail
-
LevelHolder
public LevelHolder(int currentLevel)
Construct the level holder.- Parameters:
currentLevel- The level to construct the holder for.
-
-
Method Detail
-
compatibleTypes
public static boolean compatibleTypes(java.util.List<ValueType> parentTypes, java.util.List<ValueType> childTypes)
Determine if the specified child types are compatible with the parent types.- Parameters:
parentTypes- The parent types.childTypes- The child types.- Returns:
- True, if compatible.
-
decreaseLevel
public void decreaseLevel()
Decrease the level.
-
getCurrentLevel
public int getCurrentLevel()
- Returns:
- the currentLevel
-
getNodeFound
public ProgramNode getNodeFound()
- Returns:
- the nodeFound
-
getTypes
public java.util.List<ValueType> getTypes()
- Returns:
- the types
-
setCurrentLevel
public void setCurrentLevel(int currentLevel)
- Parameters:
currentLevel- the currentLevel to set
-
setNodeFound
public void setNodeFound(ProgramNode nodeFound)
- Parameters:
nodeFound- the nodeFound to set
-
setTypes
public void setTypes(java.util.List<ValueType> types)
- Parameters:
types- the types to set
-
-
DMelt 3.0 © DataMelt by jWork.ORG