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:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.DataAnalysis

  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs

    r4068 r4722  
    9090    }
    9191    #endregion
     92    [StorableConstructor]
     93    protected Variable(bool deserializing) : base(deserializing) {
     94      variableNames = new List<string>();
     95    }
     96    protected 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    }
    92104    public Variable() : this("Variable", "Represents a variable value.") { }
    93105    public Variable(string name, string description)
     
    105117
    106118    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;
     119      return new Variable(this, cloner);
    114120    }
    115121  }
Note: See TracChangeset for help on using the changeset viewer.