Documentation of 'ec.gp.build.PTCFunctionSet' Java class
PTCFunctionSet
ec.gp.build

Class PTCFunctionSet

  • All Implemented Interfaces:
    Clique, PTCFunctionSetForm, Setup, java.io.Serializable


    public class PTCFunctionSet
    extends GPFunctionSet
    implements PTCFunctionSetForm
    PTCFunctionSet is a GPFunctionSet which adheres to PTCFunctionSetForm, and thus can be used with the PTC1 and PTC2 methods. Terminal and nonterminal probabilities for nodes used in this function set are determined by the prob parameter for the nodes' GPNodeConstraints object. That's not the greatest solution, because it could require making a lot of different GPNodeConstraints, customized for each node, but it's the best I can do for now. The nonterminalSelectionProbabilities() method computes nonterminal selection probability using the probabilities above, per type, for the size requested. If the size is small enough (smaller than CACHE_SIZE), then the result is memoized so it doesn't need to be computed again next time.
    See Also:
    Serialized Form
    • Field Detail

      • q_ty

        public double[][] q_ty
        terminal probabilities[type][thenodes], in organized form
      • q_ny

        public double[][] q_ny
        nonterminal probabilities[type][thenodes], in organized form
      • p_y

        public double[][] p_y
        cache of nonterminal selection probabilities -- dense array [size-1][type]. If any items are null, they're not in the dense cache.
    • Constructor Detail

      • PTCFunctionSet

        public PTCFunctionSet()
    • Method Detail

      • terminalProbabilities

        public double[] terminalProbabilities(int type)
        Description copied from interface: PTCFunctionSetForm
        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.
        Specified by:
        terminalProbabilities in interface PTCFunctionSetForm
      • nonterminalProbabilities

        public double[] nonterminalProbabilities(int type)
        Description copied from interface: PTCFunctionSetForm
        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.
        Specified by:
        nonterminalProbabilities in interface PTCFunctionSetForm
      • nonterminalSelectionProbabilities

        public double[] nonterminalSelectionProbabilities(int expectedTreeSize)
        Description copied from interface: PTCFunctionSetForm
        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.
        Specified by:
        nonterminalSelectionProbabilities in interface PTCFunctionSetForm
      • computeNonterminalSelectionProbabilities

        public double[] computeNonterminalSelectionProbabilities(int expectedTreeSize)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.