Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/17/14 18:52:37 (10 years ago)
Author:
bburlacu
Message:

#1772: Fixed cloning in tracking operators for symbolic data analysis. Added unit tests (in progress).

Location:
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs

    r11350 r11694  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    2627using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2728using HeuristicLab.EvolutionTracking;
     29using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2830
    2931namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3032  public class SymbolicDataAnalysisExpressionAfterCrossoverOperator : AfterCrossoverOperator<ISymbolicExpressionTree> {
     33    public SymbolicDataAnalysisExpressionAfterCrossoverOperator() { }
     34
     35    protected SymbolicDataAnalysisExpressionAfterCrossoverOperator(SymbolicDataAnalysisExpressionAfterCrossoverOperator original, Cloner cloner)
     36      : base(original, cloner) {
     37    }
     38
     39    public override IDeepCloneable Clone(Cloner cloner) {
     40      return new SymbolicDataAnalysisExpressionAfterCrossoverOperator(this, cloner);
     41    }
     42
     43    [StorableConstructor]
     44    protected SymbolicDataAnalysisExpressionAfterCrossoverOperator(bool deserializing) : base(deserializing) { }
     45
    3146    public override IOperation Apply() {
    32       var childVertex = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetByContent(ChildParameter.ActualValue);
     47      var childVertex = GenealogyGraph.GetByContent(ChildParameter.ActualValue);
    3348      var arcs = childVertex.InArcs.ToList();
    3449      var nodes0 = (List<ISymbolicExpressionTreeNode>)arcs[0].Data;
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs

    r11387 r11694  
    2121
    2222using System.Linq;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2526using HeuristicLab.EvolutionTracking;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2628
    2729namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2830  public class SymbolicDataAnalysisExpressionAfterManipulatorOperator : AfterManipulatorOperator<ISymbolicExpressionTree> {
     31    public SymbolicDataAnalysisExpressionAfterManipulatorOperator() { }
     32
     33    protected SymbolicDataAnalysisExpressionAfterManipulatorOperator(SymbolicDataAnalysisExpressionAfterManipulatorOperator original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new SymbolicDataAnalysisExpressionAfterManipulatorOperator(this, cloner);
     39    }
     40
     41    [StorableConstructor]
     42    protected SymbolicDataAnalysisExpressionAfterManipulatorOperator(bool deserializing) : base(deserializing) { }
     43
    2944    public override IOperation Apply() {
    3045      var child = ChildParameter.ActualValue;
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs

    r11233 r11694  
    2121
    2222using System.Linq;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2526using HeuristicLab.EvolutionTracking;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2628
    2729namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2830  public class SymbolicDataAnalysisExpressionBeforeCrossoverOperator : BeforeCrossoverOperator<ISymbolicExpressionTree> {
     31    public SymbolicDataAnalysisExpressionBeforeCrossoverOperator() { }
     32
     33    protected SymbolicDataAnalysisExpressionBeforeCrossoverOperator(SymbolicDataAnalysisExpressionBeforeCrossoverOperator original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new SymbolicDataAnalysisExpressionBeforeCrossoverOperator(this, cloner);
     39    }
     40
     41    [StorableConstructor]
     42    protected SymbolicDataAnalysisExpressionBeforeCrossoverOperator(bool deserializing) : base(deserializing) { }
     43
    2944    public override IOperation Apply() {
    3045      var result = base.Apply(); // the base operator will add the child to the graph before the actual crossover operation takes place
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs

    r11387 r11694  
    2121
    2222using System.Linq;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2526using HeuristicLab.EvolutionTracking;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2628
    2729namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2830  public class SymbolicDataAnalysisExpressionBeforeManipulatorOperator : BeforeManipulatorOperator<ISymbolicExpressionTree> {
     31    public SymbolicDataAnalysisExpressionBeforeManipulatorOperator() { }
     32
     33    protected SymbolicDataAnalysisExpressionBeforeManipulatorOperator(SymbolicDataAnalysisExpressionBeforeManipulatorOperator original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new SymbolicDataAnalysisExpressionBeforeManipulatorOperator(this, cloner);
     39    }
     40
     41    [StorableConstructor]
     42    protected SymbolicDataAnalysisExpressionBeforeManipulatorOperator(bool deserializing) : base(deserializing) { }
     43
    2944    public override IOperation Apply() {
    3045      // the call below does the following things:
Note: See TracChangeset for help on using the changeset viewer.