Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11928


Ignore:
Timestamp:
02/06/15 02:43:43 (10 years ago)
Author:
bburlacu
Message:

#1772: Added missing clone method to Fragment<T>, changed storable constructor access modifier to protected.

Location:
branches/HeuristicLab.EvolutionTracking
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Fragment.cs

    r11852 r11928  
    2828      Index2 = original.Index2;
    2929    }
     30
    3031    public override IDeepCloneable Clone(Cloner cloner) {
    3132      return new Fragment(this, cloner);
    3233    }
     34
    3335    public Fragment() { }
    3436  }
     
    4244    }
    4345
    44     protected Fragment(Fragment original, Cloner cloner)
     46    public override IDeepCloneable Clone(Cloner cloner) {
     47      return new Fragment<T>(this, cloner);
     48    }
     49
     50    protected Fragment(Fragment<T> original, Cloner cloner)
    4551      : base(original, cloner) {
    4652    }
    4753
    4854    [StorableConstructor]
    49     private Fragment(bool deserializable) : base(deserializable) { }
     55    protected Fragment(bool deserializable) : base(deserializable) { }
    5056
    5157    public Fragment() { }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r11926 r11928  
    235235      Operators.Add(new SymbolicExpressionTreeLengthAnalyzer());
    236236      Operators.Add(new SingleObjectivePopulationDiversityAnalyzer());
     237      Operators.Add(new SymbolicDataAnalysisPhenotypicDiversityAnalyzer());
     238      Operators.Add(new SymbolicDataAnalysisBottomUpDiversityAnalyzer());
     239      Operators.Add(new SymbolicDataAnalysisGenealogyAnalyzer());
    237240      ParameterizeOperators();
    238241    }
     
    361364        op.SimilarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator();
    362365      }
     366      // add tracking analyzer
     367      foreach (var op in operators.OfType<SymbolicDataAnalysisGenealogyAnalyzer>()) {
     368        op.BeforeCrossoverOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionBeforeCrossoverOperator();
     369        op.AfterCrossoverOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionAfterCrossoverOperator();
     370        op.BeforeManipulatorOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionBeforeManipulatorOperator();
     371        op.AfterManipulatorOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionAfterManipulatorOperator();
     372        // get crossover parameter names
     373        var crossover = operators.OfType<ISymbolicExpressionTreeCrossover>().FirstOrDefault();
     374        if (crossover != null) {
     375          op.BeforeCrossoverOperator.ParentsParameter.ActualName = crossover.ParentsParameter.Name;
     376          op.AfterCrossoverOperator.ParentsParameter.ActualName = crossover.ParentsParameter.Name;
     377          op.BeforeCrossoverOperator.ChildParameter.ActualName = crossover.ChildParameter.Name;
     378          op.AfterCrossoverOperator.ChildParameter.ActualName = crossover.ChildParameter.Name;
     379        }
     380        // get manipulator parameter names
     381        var manipulator = operators.OfType<ISymbolicExpressionTreeManipulator>().FirstOrDefault();
     382        if (manipulator != null) {
     383          op.BeforeManipulatorOperator.ChildParameter.ActualName = manipulator.SymbolicExpressionTreeParameter.Name;
     384          op.AfterManipulatorOperator.ChildParameter.ActualName = manipulator.SymbolicExpressionTreeParameter.Name;
     385        }
     386        var creator = operators.OfType<ISymbolicExpressionTreeCreator>().FirstOrDefault();
     387        if (creator != null) {
     388          op.PopulationParameter.ActualName = creator.SymbolicExpressionTreeParameter.ActualName;
     389        }
     390      }
    363391    }
    364392
Note: See TracChangeset for help on using the changeset viewer.