Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/13/16 19:47:41 (8 years ago)
Author:
gkronber
Message:

#2650 Merged r14282:14322 from trunk to branch (fixing conflicts)

Location:
branches/symbreg-factors-2650
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650

  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis

  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineDirectionalSymmetryCalculator.cs

    r14185 r14330  
    2626
    2727namespace HeuristicLab.Problems.DataAnalysis {
    28   public class OnlineDirectionalSymmetryCalculator : IOnlineTimeSeriesCalculator {
     28  public class OnlineDirectionalSymmetryCalculator : IOnlineTimeSeriesCalculator, IDeepCloneable {
    2929    private int n;
    3030    private int nCorrect;
     
    3939    public OnlineDirectionalSymmetryCalculator() {
    4040      Reset();
     41    }
     42
     43    protected OnlineDirectionalSymmetryCalculator(OnlineDirectionalSymmetryCalculator other, Cloner cloner = null) {
     44      n = other.n;
     45      nCorrect = other.nCorrect;
     46      errorState = other.errorState;
    4147    }
    4248
     
    94100      return dsCalculator.DirectionalSymmetry;
    95101    }
    96    
     102
    97103    public static double Calculate(IEnumerable<double> startValues, IEnumerable<IEnumerable<double>> actualContinuations, IEnumerable<IEnumerable<double>> predictedContinuations, out OnlineCalculatorError errorState) {
    98104      IEnumerator<double> startValueEnumerator = startValues.GetEnumerator();
     
    116122      }
    117123    }
     124
     125    // IDeepCloneable interface members
     126    public object Clone() {
     127      return new OnlineDirectionalSymmetryCalculator(this);
     128    }
     129
     130    public IDeepCloneable Clone(Cloner cloner) {
     131      var clone = cloner.GetClone(this);
     132      if (clone == null) {
     133        clone = new OnlineDirectionalSymmetryCalculator(this);
     134        cloner.RegisterClonedObject(this, clone);
     135      }
     136      return clone;
     137    }
    118138  }
    119139}
Note: See TracChangeset for help on using the changeset viewer.