/// <summary>
 /// Constructor
 /// </summary>
 /// <param name="os">The function set of the GP</param>
 /// <param name="ts">The named variable set of the GP, part of the terminal set</param>
 /// <param name="cs">The part of the terminal  set that contains constants and 0-arity functions</param>
 public TGPProgram(TGPOperatorSet os, TGPVariableSet ts, TGPConstantSet cs, List <KeyValuePair <TGPPrimitive, double> > primitives)
 {
     mOperatorSet  = os;
     mVariableSet  = ts;
     mConstantSet  = cs;
     mPrimitiveSet = primitives;
 }
Beispiel #2
0
        public TGPVariableSet Clone()
        {
            TGPVariableSet clone = new TGPVariableSet();

            clone.mWeightSum = mWeightSum;
            foreach (KeyValuePair <TGPTerminal, double> point in mTerminals.Values)
            {
                clone.mTerminals[point.Key.Symbol] = new KeyValuePair <TGPTerminal, double>(point.Key.Clone(), point.Value);
            }
            return(clone);
        }