|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.ai.geneticprogramming.AbstractFunctionGenerator
public abstract class AbstractFunctionGenerator
Provides base functionality for a function generator in genetic programming.
| Constructor Summary | |
|---|---|
AbstractFunctionGenerator()
Construct this object. |
|
AbstractFunctionGenerator(Class returnType)
Construct this object with the given parameters. |
|
AbstractFunctionGenerator(Class returnType,
int maxDepth)
Construct this object with the given parameters. |
|
| Method Summary | |
|---|---|
void |
addFunction(IFunction function)
Add a function exemplar to the function set. |
void |
addTerminal(ITerminal terminal)
Add a terminal exemplar to the terminal set. |
IFunction |
create()
Return a new populated function. |
protected IFunction |
createCompleteFunction(Class returnType,
int depth)
Create a new function and populate its argument nodes. |
protected IFunction |
createNewInstanceOfFunctionAt(Class returnType,
int index)
Return a new instance of the function at the given index. |
protected ITerminal |
createNewInstanceOfTerminalAt(Class returnType,
int index)
Return a new instance of the terminal exemplar at the given index. |
protected ITerminal |
createTerminal(Class returnType)
Create a new terminal. |
int |
getFunctionCount()
Return the function count. |
int |
getFunctionCount(Class returnType)
Return the function count. |
protected List |
getFunctionList(Class returnType)
Return the function list for the given return type. |
int |
getMaxDepth()
|
Class |
getReturnType()
|
int |
getTerminalCount()
Return the terminal count. |
int |
getTerminalCount(Class returnType)
Return the terminal count. |
protected List |
getTerminalList(Class returnType)
Return the terminal list for the given return type. |
void |
setMaxDepth(int maxDepth)
|
void |
setReturnType(Class returnType)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractFunctionGenerator()
public AbstractFunctionGenerator(Class returnType)
returnType - Return type.
public AbstractFunctionGenerator(Class returnType,
int maxDepth)
returnType - Return type.maxDepth - Maximum depth of created functions.| Method Detail |
|---|
public void addFunction(IFunction function)
addFunction in interface IFunctionGeneratorfunction - Function exemplar.public void addTerminal(ITerminal terminal)
addTerminal in interface IFunctionGeneratorterminal - Terminal exemplar.public IFunction create()
create in interface IFunctionGeneratorpublic int getFunctionCount()
getFunctionCount in interface IFunctionGeneratorpublic int getFunctionCount(Class returnType)
public int getMaxDepth()
getMaxDepth in interface IFunctionGeneratorpublic Class getReturnType()
getReturnType in interface IFunctionGeneratorpublic int getTerminalCount()
getTerminalCount in interface IFunctionGeneratorpublic int getTerminalCount(Class returnType)
public void setMaxDepth(int maxDepth)
setMaxDepth in interface IFunctionGeneratormaxDepth - the maxDepth to setpublic void setReturnType(Class returnType)
setReturnType in interface IFunctionGeneratorreturnType - the returnType to set
protected IFunction createCompleteFunction(Class returnType,
int depth)
returnType - Required function return type.depth - Current depth.
protected IFunction createNewInstanceOfFunctionAt(Class returnType,
int index)
returnType - Required function return type.index - Index.
protected ITerminal createNewInstanceOfTerminalAt(Class returnType,
int index)
returnType - Required terminal return type.index - Index.protected ITerminal createTerminal(Class returnType)
returnType - Required terminal return type.protected List getFunctionList(Class returnType)
returnType - Function return type.protected List getTerminalList(Class returnType)
returnType - Terminal return type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |