Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (13 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Variable.cs

    r4089 r4722  
    9191    }
    9292    #endregion
     93
     94    [StorableConstructor]
     95    private Variable(bool deserializing) : base(deserializing) { }
     96    private Variable(Variable original, Cloner cloner)
     97      : base(original, cloner) {
     98      weightNu = original.weightNu;
     99      weightSigma = original.weightSigma;
     100      variableNames = new List<string>(original.variableNames);
     101      weightManipulatorNu = original.weightManipulatorNu;
     102      weightManipulatorSigma = original.weightManipulatorSigma;
     103    }
     104    public override IDeepCloneable Clone(Cloner cloner) {
     105      return new Variable(this, cloner);
     106    }
     107
    93108    public Variable()
    94109      : base("Variable", "Represents a variable value.") {
     
    103118      return new VariableTreeNode(this);
    104119    }
    105 
    106     public override IDeepCloneable Clone(Cloner cloner) {
    107       Variable clone = (Variable)base.Clone(cloner);
    108       clone.weightNu = weightNu;
    109       clone.weightSigma = weightSigma;
    110       clone.variableNames = new List<string>(variableNames);
    111       clone.weightManipulatorNu = weightManipulatorNu;
    112       clone.weightManipulatorSigma = weightManipulatorSigma;
    113       return clone;
    114     }
    115120  }
    116121}
Note: See TracChangeset for help on using the changeset viewer.