コード例 #1
0
 /// <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;
 }
コード例 #2
0
        public TGPConstantSet Clone()
        {
            TGPConstantSet clone = new TGPConstantSet();

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