Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/09/14 15:11:16 (10 years ago)
Author:
bburlacu
Message:

#1772: Fixed persistence errors in the GenealogyAnalyzer and the instrumented operators, tweaked display code in the GenealogyGraphChart.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeCrossoverOperator.cs

    r10675 r10830  
    3333  [Item("AfterCrossoverOperator", "A generic operator that can record genealogical relationships between crossover parents and children.")]
    3434  public class BeforeCrossoverOperator<T> : EvolutionTrackingOperator<T>, ICrossoverOperator<T> where T : class,IItem {
    35     private const string defaultParentsParameterName = "Parents";
    36     private const string defaultChildParameterName = "Child";
     35    private const string ParentsParameterName = "Parents";
     36    private const string ChildParameterName = "Child";
    3737
    38     public IScopeTreeLookupParameter<T> ParentsParameter { get; set; }
    39     public ILookupParameter<T> ChildParameter { get; set; }
     38    public IScopeTreeLookupParameter<T> ParentsParameter {
     39      get { return (IScopeTreeLookupParameter<T>)Parameters[ParentsParameterName]; }
     40    }
     41    public ILookupParameter<T> ChildParameter {
     42      get { return (ILookupParameter<T>)Parameters[ChildParameterName]; }
     43    }
    4044
    4145    protected BeforeCrossoverOperator(BeforeCrossoverOperator<T> original, Cloner cloner)
     
    4751
    4852    public BeforeCrossoverOperator() {
    49       ParentsParameter = new ScopeTreeLookupParameter<T>(defaultParentsParameterName);
    50       ChildParameter = new LookupParameter<T>(defaultChildParameterName);
    51       Parameters.Add(ParentsParameter);
    52       Parameters.Add(ChildParameter);
     53      Parameters.Add(new ScopeTreeLookupParameter<T>(ParentsParameterName));
     54      Parameters.Add(new LookupParameter<T>(ChildParameterName));
    5355    }
    5456
Note: See TracChangeset for help on using the changeset viewer.