Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/26/14 01:56:35 (10 years ago)
Author:
bburlacu
Message:

#1772: Introduced separate class for FragmentNodes and adjusted tracing code. Fixed small bug creating the genealogy graph.

File:
1 edited

Legend:

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

    r10886 r10888  
    4343    }
    4444
     45    public IValueParameter<IntValue> ExecutionCountParameter {
     46      get { return (IValueParameter<IntValue>)Parameters["ExecutionCount"]; }
     47    }
     48
    4549    protected BeforeCrossoverOperator(BeforeCrossoverOperator<T> original, Cloner cloner)
    4650      : base(original, cloner) {
     
    5357      Parameters.Add(new ScopeTreeLookupParameter<T>(ParentsParameterName));
    5458      Parameters.Add(new LookupParameter<T>(ChildParameterName));
     59      Parameters.Add(new ValueParameter<IntValue>("ExecutionCount", new IntValue(0)));
    5560    }
    5661
     
    6570    private readonly Func<IScope, string> getScopeId = s => ((StringValue)s.Variables["Id"].Value).Value;
    6671    public override IOperation Apply() {
    67       if (CurrentGeneration == null) throw new Exception();
     72      ExecutionCountParameter.Value.Value++;
     73
    6874      var subScopes = ExecutionContext.Scope.SubScopes;
    6975      var parentVertices = subScopes.Select(x => (GenealogyGraphNode<T>)GenealogyGraph.GetVertex(getScopeId(x))).ToList();
     
    7581        // but the first parent is actually the future child so we use this
    7682        Content = parents[0],
     83        //        Rank = Generations.Value + 1
    7784        Rank = parentVertices[0].Rank + 1
    7885      };
     86
    7987      GenealogyGraph.AddVertex(childVertex);
     88
    8089      foreach (var parentVertex in parentVertices) {
    8190        GenealogyGraph.AddArc(parentVertex, childVertex);
Note: See TracChangeset for help on using the changeset viewer.