ec.gp.build
Interface PTCFunctionSetForm

All Known Implementing Classes:
PTCFunctionSet

public interface PTCFunctionSetForm

PTCFunctionSetForm defines the methods that the PTC1 and PTC2 tree-creation algorithms require of function sets. Your GPFunctionSet must adhere to this form in order to be used by these algorithms; the PTCFunctionSet class is provided to simplify matters for you (it's a direct subclass of GPFunctionSet which adheres to this form).

Version:
1.0
Author:
Sean Luke

Method Summary
 float[] nonterminalProbabilities(int type)
          Returns an organized distribution (see ec.util.RandomChoice) of likelihoods that various nonterminals in the function set will be chosen over other nonterminals with the same return type.
 float[] nonterminalSelectionProbabilities(int expectedTreeSize)
          Returns an array (by return type) of the probability that PTC1 must pick a nonterminal over a terminal in order to guarantee the expectedTreeSize.
 float[] terminalProbabilities(int type)
          Returns an organized distribution (see ec.util.RandomChoice) of likelihoods that various terminals in the function set will be chosen over other terminals with the same return type.
 

Method Detail

terminalProbabilities

float[] terminalProbabilities(int type)
Returns an organized distribution (see ec.util.RandomChoice) of likelihoods that various terminals in the function set will be chosen over other terminals with the same return type. The ordering of the array is the same as the terminals[type][...] array in GPFunctionSet.


nonterminalProbabilities

float[] nonterminalProbabilities(int type)
Returns an organized distribution (see ec.util.RandomChoice) of likelihoods that various nonterminals in the function set will be chosen over other nonterminals with the same return type. The ordering of the array is the same as the nonterminals[type][...] array in GPFunctionSet.


nonterminalSelectionProbabilities

float[] nonterminalSelectionProbabilities(int expectedTreeSize)
Returns an array (by return type) of the probability that PTC1 must pick a nonterminal over a terminal in order to guarantee the expectedTreeSize. Only used by PTC1, not by PTC2.