public class PTCFunctionSet extends GPFunctionSet implements PTCFunctionSetForm
Modifier and Type | Field and Description |
---|---|
static int |
CACHE_SIZE |
double[][] |
p_y
cache of nonterminal selection probabilities -- dense array
[size-1][type].
|
double[][] |
q_ny
nonterminal probabilities[type][thenodes], in organized form
|
double[][] |
q_ty
terminal probabilities[type][thenodes], in organized form
|
name, nodes, nodes_h, nodesByArity, nodesByName, nonterminals, nonterminals_h, nonterminalsOverArity, nonterminalsUnderArity, P_FUNC, P_NAME, P_SIZE, terminals, terminals_h
Constructor and Description |
---|
PTCFunctionSet() |
Modifier and Type | Method and Description |
---|---|
double[] |
computeNonterminalSelectionProbabilities(int expectedTreeSize) |
double[] |
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.
|
double[] |
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.
|
void |
setup(EvolutionState state,
Parameter base)
Must be done after GPType and GPNodeConstraints have been set up
|
double[] |
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.
|
functionSetFor, postProcessFunctionSet, toString
public double[][] q_ty
public double[][] q_ny
public static final int CACHE_SIZE
public double[][] p_y
public double[] terminalProbabilities(int type)
PTCFunctionSetForm
terminalProbabilities
in interface PTCFunctionSetForm
public double[] nonterminalProbabilities(int type)
PTCFunctionSetForm
nonterminalProbabilities
in interface PTCFunctionSetForm
public void setup(EvolutionState state, Parameter base)
GPFunctionSet
setup
in interface Setup
setup
in class GPFunctionSet
public double[] nonterminalSelectionProbabilities(int expectedTreeSize)
PTCFunctionSetForm
nonterminalSelectionProbabilities
in interface PTCFunctionSetForm
public double[] computeNonterminalSelectionProbabilities(int expectedTreeSize)