Changeset 10888


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

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

Location:
branches/HeuristicLab.EvolutionTracking
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs

    r10833 r10888  
    208208
    209209        DrawLineage(visualNode, n => SimpleLineages ? n.IncomingArcs.Take(1) : n.IncomingArcs, a => a.Source);
     210        ((SolidBrush)visualNode.Brush).Color = Color.Transparent;
    210211        DrawLineage(visualNode, n => n.OutgoingArcs, a => a.Target);
    211212      }
     
    242243    }
    243244
     245    public void HighlightHotPaths() {
     246      Chart.UpdateEnabled = false;
     247      ClearPrimitives();
     248      var arcs = GenealogyGraph.Nodes.SelectMany(n => n.InArcs).ToList();
     249      foreach (var arc in arcs) { arc.Weight = 1.0; } // reset weights
     250      var rank = GenealogyGraph.Ranks.Keys.Max();
     251      foreach (var ggn in GenealogyGraph.Ranks[rank]) {
     252        foreach (var ancestor in ggn.Ancestors) {
     253          foreach (var arc in ancestor.InArcs) {
     254            arc.Weight++;
     255          }
     256        }
     257      }
     258      double max = arcs.Max(a => a.Weight);
     259      double min = arcs.Min(a => a.Weight);
     260
     261      if (min.IsAlmost(max)) return;
     262      //translate interval (min,max) to interval (0,255)
     263      foreach (var arc in arcs) {
     264        var vArc = GetMappedArc(arc.Source, arc.Target);
     265        int colorIndex = (int)Math.Round((arc.Weight - min) * 255 / (max - min));
     266        if (colorIndex > 254) colorIndex = 254;
     267        vArc.Pen = new Pen(ColorGradient.Colors[colorIndex]);
     268        //        vArc.Pen.Brush = new SolidBrush(ColorGradient.Colors[colorIndex]);
     269      }
     270      Chart.UpdateEnabled = true;
     271      Chart.EnforceUpdate();
     272    }
     273
    244274    void MarkSelectedNode() {
    245275      var center = SelectedVisualNode.Center;
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/HeuristicLab.EvolutionTracking.Views-3.4.csproj

    r10886 r10888  
    113113    <Compile Include="VisualGenealogyGraphArc.cs" />
    114114    <Compile Include="VisualGenealogyGraphNode.cs" />
    115     <Compile Include="VisualGenealogyGraphTextLabel.cs" />
    116115  </ItemGroup>
    117116  <ItemGroup>
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs

    r10886 r10888  
    252252        for (int i = 0; i < population.Count; ++i) {
    253253          var individual = population[i];
    254           var vertex = new GenealogyGraphNode<T> { Content = individual, Rank = Generations.Value, };
     254          var vertex = new GenealogyGraphNode<T> { Content = individual, Rank = Generations.Value };
    255255          GenealogyGraph.AddVertex(vertex);
    256256          // save the vertex id in the individual scope (so that we can identify graph indices)
     
    258258        }
    259259      } else {
    260         // TODO: eliminate from the graph extra vertices added by the recombination operators when filling the pool of offspring with offspring selection
    261 
    262260        var elite = population.FirstOrDefault(x => GenealogyGraph.Contains(x));
    263261        if (elite != null) {
     262          var prevVertex = (IGenealogyGraphNode<T>)GenealogyGraph[elite];
     263          prevVertex.IsElite = true; // mark elites in the graph retroactively
     264
     265          var clone = (T)elite.Clone();
     266
    264267          var vertex = new GenealogyGraphNode<T> {
    265             Content = (T)elite.Clone(),
     268            Content = prevVertex.Content,
    266269            Rank = Generations.Value,
    267             IsElite = true
     270            Quality = prevVertex.Quality,
     271            IsElite = false
    268272          };
     273
     274          GenealogyGraph.SetContent(prevVertex, clone);
     275          // swap id
     276          var id = prevVertex.Id;
     277          GenealogyGraph.SetId(prevVertex, vertex.Id);
     278
    269279          // add new vertex to the graph
     280          vertex.Id = id;
    270281          GenealogyGraph.AddVertex(vertex);
    271           // swap content between current vertex and previous vertex
    272           var previousVertex = (IGenealogyGraphNode<T>)GenealogyGraph[elite];
    273           var tmp = vertex.Content;
    274           vertex.Content = previousVertex.Content;
    275           previousVertex.Content = tmp;
    276           // adjust graph content map
    277           GenealogyGraph[vertex.Content] = vertex;
    278           GenealogyGraph[previousVertex.Content] = previousVertex;
    279           GenealogyGraph.AddArc(previousVertex, vertex); // connect current elite with previous elite
    280           vertex.Id = previousVertex.Id; // another way would be to introduce the vertex.Id into the scope of the elite
    281           vertex.Quality = previousVertex.Quality;
    282 
    283           if (previousVertex.InArcs.Any()) {
    284             vertex.InArcs.Last().Data = previousVertex.InArcs.Last().Data; // save the fragment in case there is one
     282
     283          GenealogyGraph.AddArc(prevVertex, vertex); // connect current elite with previous elite
     284
     285          if (prevVertex.InArcs.Any()) {
     286            vertex.InArcs.Last().Data = prevVertex.InArcs.Last().Data; // save the fragment in case there is one
    285287          }
    286288        }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Arc.cs

    r10278 r10888  
    5454    public Arc() { }
    5555
     56    public Arc(IVertex source, IVertex target) {
     57      Source = source;
     58      Target = target;
     59    }
     60
    5661    protected Arc(Arc original, Cloner cloner)
    5762      : base(original, cloner) {
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/DirectedGraph.cs

    r10884 r10888  
    3232  [StorableClass]
    3333  public class DirectedGraph : Item, IDirectedGraph {
     34    public bool AllowDuplicateContent { get; set; }
     35
    3436    [Storable]
    3537    private readonly List<IVertex> nodes; // for performance reasons, maybe this should be a linked list (fast remove)
     
    101103    }
    102104    public virtual void AddVertex(IVertex vertex) {
    103       if (contentMap.ContainsKey(vertex.Content)) {
     105      if (!AllowDuplicateContent && contentMap.ContainsKey(vertex.Content)) {
    104106        throw new Exception("Content already exists in the graph.");
    105107      }
     
    109111    }
    110112
     113    public virtual IArc AddArc(IVertex source, IVertex target) {
     114      var arc = new Arc(source, target);
     115      source.AddForwardArc(arc);
     116      target.AddReverseArc(arc);
     117      return arc;
     118    }
     119
    111120    public virtual void RemoveVertex(IVertex vertex) {
    112121      nodes.Remove(vertex);
    113122    }
     123
    114124    public override Image ItemImage {
    115125      get { return Common.Resources.VSImageLibrary.Graph; }
    116126    }
     127
     128    public void SetContent(IVertex vertex, object content) {
     129      var oldContent = vertex.Content;
     130      contentMap.Remove(oldContent);
     131      vertex.Content = content;
     132      contentMap[content] = vertex;
     133    }
     134
     135    public void SetId(IVertex vertex, string id) {
     136      var oldId = vertex.Id;
     137      idMap.Remove(oldId);
     138      vertex.Id = id;
     139      idMap[id] = vertex;
     140    }
    117141  }
    118142}
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Interfaces/IArc.cs

    r10278 r10888  
    2020#endregion
    2121
     22
    2223namespace HeuristicLab.EvolutionTracking {
    2324  public interface IArc {
    2425    IVertex Source { get; set; }
    2526    IVertex Target { get; set; }
     27    string Label { get; set; }
     28    double Weight { get; set; }
     29    object Data { get; set; }
     30  }
     31
     32  public interface IArc<T> : IArc where T : class,IVertex {
     33    new T Source { get; set; }
     34    new T Target { get; set; }
    2635  }
    2736}
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Interfaces/IDirectedGraph.cs

    r10884 r10888  
    3030    void Clear();
    3131    void AddVertex(IVertex vertex);
     32    IArc AddArc(IVertex source, IVertex target);
    3233    void RemoveVertex(IVertex vertex);
    3334    IEnumerable<IVertex> Nodes { get; }
     
    3536    bool Contains(object content);
    3637    IVertex GetVertex(string id);
     38    void SetContent(IVertex vertex, object content);
     39    void SetId(IVertex vertex, string id);
    3740  }
    3841}
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Interfaces/IVertex.cs

    r10886 r10888  
    2525namespace HeuristicLab.EvolutionTracking {
    2626  public interface IVertex : IItem {
    27     string Id { get; }
    28     IEnumerable<IArc> InArcs { get; set; }
    29     IEnumerable<IArc> OutArcs { get; set; }
     27    string Id { get; set; }
     28    IEnumerable<IArc> InArcs { get; }
     29    IEnumerable<IArc> OutArcs { get; }
    3030
    3131    int InDegree { get; }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Vertex.cs

    r10886 r10888  
    4646    public IEnumerable<IArc> InArcs {
    4747      get { return inArcs ?? Enumerable.Empty<IArc>(); }
    48       set { inArcs = value.ToList(); }
    4948    }
    5049    [Storable]
     
    5251    public IEnumerable<IArc> OutArcs {
    5352      get { return outArcs ?? Enumerable.Empty<IArc>(); }
    54       set { outArcs = value.ToList(); }
    5553    }
    56 
    5754    [Storable]
    5855    public object Content { get; set; }
     
    6966      Id = Guid.NewGuid().ToString();
    7067      Label = original.Label;
    71       inArcs = new List<IArc>(original.InArcs);
    72       outArcs = new List<IArc>(original.OutArcs);
     68      inArcs = new List<IArc>(original.inArcs);
     69      outArcs = new List<IArc>(original.outArcs);
    7370    }
    7471
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs

    r10886 r10888  
    2929namespace HeuristicLab.EvolutionTracking {
    3030  [StorableClass]
    31   [Item("GenealogyGraph", "")]
     31  [Item("GenealogyGraph", "A class representing a genealogy graph")]
    3232  public class GenealogyGraph : DirectedGraph, IGenealogyGraph {
    3333    [Storable]
     
    4141    }
    4242
    43     public IGenealogyGraphArc AddArc(IGenealogyGraphNode source, IGenealogyGraphNode target) {
    44       var arc = new GenealogyGraphArc(source, target);
    45       source.AddForwardArc(arc);
    46       target.AddReverseArc(arc);
    47       return arc;
    48     }
    49 
    5043    protected GenealogyGraph(GenealogyGraph original, Cloner cloner)
    5144      : base(original, cloner) {
     45      Ranks = new Dictionary<double, List<IGenealogyGraphNode>>(original.Ranks);
    5246    }
    5347    public override IDeepCloneable Clone(Cloner cloner) {
     
    5953      Ranks = new Dictionary<double, List<IGenealogyGraphNode>>();
    6054    }
     55
     56    public override IArc AddArc(IVertex source, IVertex target) {
     57      var arc = new GenealogyGraphArc((IGenealogyGraphNode)source, (IGenealogyGraphNode)target);
     58      source.AddForwardArc(arc);
     59      target.AddReverseArc(arc);
     60      return arc;
     61    }
     62
    6163    public override void AddVertex(IVertex vertex) {
     64      base.AddVertex(vertex);
    6265      var node = (IGenealogyGraphNode)vertex;
    6366      if (!Ranks.ContainsKey(node.Rank))
    6467        Ranks[node.Rank] = new List<IGenealogyGraphNode>();
    6568      Ranks[node.Rank].Add(node);
    66       base.AddVertex(vertex);
    6769    }
    6870    public override void RemoveVertex(IVertex vertex) {
     
    9496
    9597  [StorableClass]
    96   [Item("GenealogyGraph", "")]
     98  [Item("GenealogyGraph", "A class representing a genealogy graph")]
    9799  public class GenealogyGraph<T> : DirectedGraph, IGenealogyGraph<T> where T : class, IItem {
    98100    // members and properties
     
    106108      get { return from n in base.Nodes select (IGenealogyGraphNode<T>)n; }
    107109    }
    108 
    109     public IGenealogyGraphArc AddArc(IGenealogyGraphNode source, IGenealogyGraphNode target) {
    110       var arc = new GenealogyGraphArc(source, target);
    111       source.AddForwardArc(arc);
    112       target.AddReverseArc(arc);
    113       return arc;
    114     }
    115 
    116110    // contructors
    117111    protected GenealogyGraph(GenealogyGraph<T> original, Cloner cloner)
     
    128122    // methods
    129123    public override void AddVertex(IVertex vertex) {
     124      base.AddVertex(vertex);
    130125      var node = (IGenealogyGraphNode<T>)vertex;
    131126      if (!Ranks.ContainsKey(node.Rank)) {
     
    133128      }
    134129      Ranks[node.Rank].Add(node);
    135       base.AddVertex(vertex);
    136130    }
    137131    public override void RemoveVertex(IVertex vertex) {
     
    142136      base.RemoveVertex(vertex);
    143137    }
    144 
     138    public override IArc AddArc(IVertex source, IVertex target) {
     139      var arc = new GenealogyGraphArc((IGenealogyGraphNode)source, (IGenealogyGraphNode)target);
     140      source.AddForwardArc(arc);
     141      target.AddReverseArc(arc);
     142      return arc;
     143    }
    145144    IEnumerable<IGenealogyGraphNode> IGenealogyGraph.Nodes {
    146145      get { return Nodes; }
    147146    }
    148 
    149147    public event EventHandler GraphUpdated;
    150148    private void OnGraphUpdated(object sender, EventArgs args) {
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphArc.cs

    r10886 r10888  
    6969    protected GenealogyGraphArc(GenealogyGraphArc<T> original, Cloner cloner)
    7070      : base(original, cloner) {
    71       Data = (T)original.Data.Clone();
     71      Data = (T)original.Data;
    7272    }
    7373
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs

    r10886 r10888  
    4242
    4343    public new IEnumerable<IGenealogyGraphArc> InArcs {
    44       get { return base.InArcs.Cast<IGenealogyGraphArc>().ToList(); }
    45       set { base.InArcs = value; }
     44      get { return base.InArcs.Cast<IGenealogyGraphArc>(); }
    4645    }
    4746    public new IEnumerable<IGenealogyGraphArc> OutArcs {
    48       get { return base.OutArcs.Cast<IGenealogyGraphArc>().ToList(); }
    49       set { base.InArcs = value; }
     47      get { return base.OutArcs.Cast<IGenealogyGraphArc>(); }
    5048    }
    5149    public IEnumerable<IGenealogyGraphNode> Ancestors {
     
    131129    }
    132130    public new IEnumerable<IGenealogyGraphNode<T>> Parents {
    133       get { return base.Parents.Select(p => (IGenealogyGraphNode<T>)p); }
     131      get { return base.Parents.Cast<IGenealogyGraphNode<T>>(); }
    134132    }
    135133    public new IEnumerable<IGenealogyGraphNode<T>> Children {
    136       get { return base.Children.Select(c => (IGenealogyGraphNode<T>)c); }
     134      get { return base.Children.Cast<IGenealogyGraphNode<T>>(); }
    137135    }
    138136    public new IEnumerable<IGenealogyGraphNode<T>> Ancestors {
    139       get { return base.Ancestors.Select(x => (IGenealogyGraphNode<T>)x); }
     137      get { return base.Ancestors.Cast<IGenealogyGraphNode<T>>(); }
    140138    }
    141139    public new IEnumerable<IGenealogyGraphNode<T>> Descendants {
    142       get { return base.Descendants.Select(x => (IGenealogyGraphNode<T>)x); }
     140      get { return base.Descendants.Cast<IGenealogyGraphNode<T>>(); }
    143141    }
    144142  }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraph.cs

    r10886 r10888  
    2727    Dictionary<double, List<IGenealogyGraphNode>> Ranks { get; }
    2828    new IEnumerable<IGenealogyGraphNode> Nodes { get; }
    29     IGenealogyGraphArc AddArc(IGenealogyGraphNode source, IGenealogyGraphNode target);
    3029  }
    3130
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphArc.cs

    r10347 r10888  
    2626    new IGenealogyGraphNode Source { get; set; }
    2727    new IGenealogyGraphNode Target { get; set; }
    28     object Data { get; set; }
    2928  }
    3029
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphNode.cs

    r10677 r10888  
    3333    IEnumerable<IGenealogyGraphNode> Ancestors { get; }
    3434    IEnumerable<IGenealogyGraphNode> Descendants { get; }
    35     new IEnumerable<IGenealogyGraphArc> InArcs { get; set; }
    36     new IEnumerable<IGenealogyGraphArc> OutArcs { get; set; }
     35    new IEnumerable<IGenealogyGraphArc> InArcs { get; }
     36    new IEnumerable<IGenealogyGraphArc> OutArcs { get; }
    3737  }
    3838
  • 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);
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs

    r10886 r10888  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using System.Linq;
    2423using HeuristicLab.Common;
     
    5049
    5150    public override IOperation Apply() {
    52       if (GenealogyGraph.Contains(ChildParameter.ActualValue)) {
     51      var vChild = (IGenealogyGraphNode<T>)GenealogyGraph[ChildParameter.ActualValue];
     52      if (vChild.Rank.IsAlmost(Generations.Value + 1)) {
    5353        // if the graph already contains a vertex representing the child, it means that the child is a product of crossover
    5454        // when mutation follows after crossover, some changes need to be made to the graph to maintain consistency
    55         var child = ChildParameter.ActualValue;
    56         var clone = (T)child.Clone();
    57         var vChild = (IGenealogyGraphNode<T>)GenealogyGraph[child];
    58         var vClone = new GenealogyGraphNode<T> { Content = clone, Rank = vChild.Rank - 0.5 };
     55        var vClone = new GenealogyGraphNode<T> {
     56          Content = (T)ChildParameter.ActualValue.Clone(),
     57          Rank = vChild.Parents.Last().Rank + 0.5
     58        };
    5959        GenealogyGraph.AddVertex(vClone);
    60         var parents = vChild.Parents; // parents of child become parents of clone
    61         foreach (var p in parents) {
    62           var arc = p.OutArcs.First(a => a.Target == vChild);
     60
     61        foreach (var arc in vChild.InArcs) {
    6362          arc.Target = vClone;
    6463          vClone.AddReverseArc(arc);
     
    6665
    6766        vClone.InArcs.Last().Data = vChild.InArcs.Last().Data; // fragment of child becomes fragment of clone
    68         vChild.InArcs = new List<IGenealogyGraphArc>(); // child will be connected to clone
    6967        GenealogyGraph.AddArc(vClone, vChild);
    7068
     
    7573        GenealogyGraph[parent.Content] = parent;
    7674
    77       } else { // this needs to be checked
    78         var vChild = new GenealogyGraphNode<T> { Content = ChildParameter.ActualValue, Rank = Generations.Value };
    79         GenealogyGraph.AddVertex(vChild);
     75      } else if (vChild.Rank.IsAlmost(Generations.Value)) {
     76        var clone = (T)ChildParameter.ActualValue.Clone();
     77        GenealogyGraph.SetContent(vChild, clone);
     78        var xx = new GenealogyGraphNode<T> { Content = ChildParameter.ActualValue, Rank = Generations.Value + 1 };
     79        GenealogyGraph.AddVertex(xx);
     80        GenealogyGraph.AddArc(vChild, xx);
    8081      }
    8182      return base.Apply();
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj

    r10884 r10888  
    279279      <DependentUpon>SymboldDataAnalysisGenealogyView.cs</DependentUpon>
    280280    </Compile>
    281     <Compile Include="Tracking\SymbolicDataAnalysisExpressionGenealogyGraphChart.cs" />
     281    <Compile Include="Tracking\SymbolicDataAnalysisExpressionGenealogyGraphChart.cs">
     282      <SubType>UserControl</SubType>
     283    </Compile>
    282284    <Compile Include="Tracking\SymbolicDataAnalysisExpressionGenealogyGraphChart.Designer.cs">
    283285      <DependentUpon>SymbolicDataAnalysisExpressionGenealogyGraphChart.cs</DependentUpon>
     
    366368    </Content>
    367369  </ItemGroup>
    368   <ItemGroup />
     370  <ItemGroup>
     371    <EmbeddedResource Include="Tracking\SymboldDataAnalysisGenealogyView.resx">
     372      <DependentUpon>SymboldDataAnalysisGenealogyView.cs</DependentUpon>
     373    </EmbeddedResource>
     374  </ItemGroup>
    369375  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    370376  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/FragmentGraphView.cs

    r10884 r10888  
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    3434  [View("FragmentGraphView")]
    35   [Content(typeof(IGenealogyGraph<IFragment<ISymbolicExpressionTreeNode>>), IsDefaultView = true)]
     35  [Content(typeof(FragmentGraph), IsDefaultView = true)]
    3636  public sealed partial class FragmentGraphView : ItemView {
    3737    private const int PreferredHorizontalSpacing = 10;
     
    4141    private ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> symbolicExpressionEngine;
    4242
    43     private Dictionary<IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>, TileLayoutNode> tileDictionary;
     43    private Dictionary<FragmentNode, TileLayoutNode> tileDictionary;
    4444
    4545    private SymbolicExpressionTreeTile Root { get; set; }
    4646
    47     public new IGenealogyGraph<IFragment<ISymbolicExpressionTreeNode>> Content {
    48       get { return (IGenealogyGraph<IFragment<ISymbolicExpressionTreeNode>>)base.Content; }
     47    public new FragmentGraph Content {
     48      get { return (FragmentGraph)base.Content; }
    4949      set { base.Content = value; }
    5050    }
     
    6363        NodeHeight = 40
    6464      };
    65       tileDictionary = new Dictionary<IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>, TileLayoutNode>();
     65      tileDictionary = new Dictionary<FragmentNode, TileLayoutNode>();
    6666    }
    6767
     
    7070      tileDictionary.Clear();
    7171      foreach (var node in Content.Nodes) {
     72        var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)node.Content;
    7273        var tile = new SymbolicExpressionTreeTile(chart);
    7374        tile.LayoutEngine = symbolicExpressionEngine;
    74         tile.Label = "Generation " + node.Rank + Environment.NewLine +
    75                      "Quality " + String.Format("{0:0.000}", node.Quality);
    76         tile.Root = node.Content.Root;
     75        tile.Label = "Generation " + node.Content.Rank + Environment.NewLine +
     76                     "Quality " + String.Format("{0:0.000}", node.Content.Quality);
     77        tile.Root = graphNode.Content.Root;
    7778        var tileNode = new TileLayoutNode { Tile = tile };
    7879        tileDictionary.Add(node, tileNode);
    7980      }
    80       foreach (var node in Content.Nodes.Where(n => n.Children.Any())) {
     81      foreach (var node in Content.Nodes.Where(n => n.OutArcs.Any())) {
    8182        var layoutNode = tileDictionary[node];
    82         layoutNode.Children = new List<TileLayoutNode>(node.Children.Select(x => tileDictionary[x]));
     83        layoutNode.Children = new List<TileLayoutNode>(node.OutArcs.Select(a => tileDictionary[(FragmentNode)a.Target]));
    8384      }
    8485    }
     
    116117        var aSize = aTile.Size;
    117118        var aPos = aTile.Position;
    118 
    119         var fragment = node.Content;
    120         if (fragment.Index1 > 0) {
    121           var subtree = fragment.Root.NodeAt(fragment.Index1);
     119        var graphNode = node.Content;
     120
     121        if (node.SubtreeIndex > 0) {
     122          var subtree = graphNode.Content.Root.NodeAt(node.SubtreeIndex);
    122123          foreach (var s in subtree.IterateNodesPrefix()) {
    123124            var primitive = aTile.GetPrimitive(s);
     
    130131          }
    131132        }
    132         if (fragment.Index2 > 0) {
    133           var subtree = fragment.Root.NodeAt(fragment.Index2);
     133        if (node.FragmentIndex > 0) {
     134          var subtree = graphNode.Content.Root.NodeAt(node.FragmentIndex);
    134135          foreach (var s in subtree.IterateNodesPrefix()) {
    135136            var primitive = aTile.GetPrimitive(s);
     
    143144        }
    144145
    145         if (node.Parents.Any() && node == node.Parents.First().Children.First()) {
    146           var parent = node.Parents.First();
    147           var index = fragment.Index1 + (parent.Content.Index2 - parent.Content.Index1);
    148           // some mutations create discontinuities which invalidate the index
    149           if (index >= 0 && index < fragment.Root.GetLength()) {
    150             var subtree = fragment.Root.NodeAt(index);
    151             var primitive = aTile.GetPrimitive(subtree);
    152             primitive.Brush = new SolidBrush(Color.LightCoral);
     146        if (node.InArcs.Any()) {
     147          var parent = (FragmentNode)node.InArcs.First().Source;
     148          if (parent.OutArcs.First().Target == node) {
     149            var index = node.SubtreeIndex + (parent.FragmentIndex - parent.SubtreeIndex);
     150            // some mutations create discontinuities which invalidate the index
     151            if (index >= 0 && index < graphNode.Content.Length) {
     152              var subtree = graphNode.Content.NodeAt(index);
     153              var primitive = aTile.GetPrimitive(subtree);
     154              primitive.Brush = new SolidBrush(Color.LightCoral);
     155            }
    153156          }
    154157        }
    155158
    156         foreach (var child in node.Children) {
     159        foreach (var child in node.OutArcs.Select(x => (FragmentNode)x.Target)) {
    157160          var bTile = tileDictionary[child].Tile;
    158161          var bSize = bTile.Size;
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymboldDataAnalysisGenealogyView.Designer.cs

    r10833 r10888  
    5151      this.genealogyGraphChart = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.SymbolicDataAnalysisExpressionGenealogyGraphChart();
    5252      this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
     53      this.groupBox1 = new System.Windows.Forms.GroupBox();
     54      this.simpleLineages_checkBox = new System.Windows.Forms.CheckBox();
     55      this.lockGraph_checkBox = new System.Windows.Forms.CheckBox();
    5356      this.trace_checkBox = new System.Windows.Forms.CheckBox();
    54       this.lockGraph_checkBox = new System.Windows.Forms.CheckBox();
    55       this.simpleLineages_checkBox = new System.Windows.Forms.CheckBox();
     57      this.hotPaths_button = new System.Windows.Forms.Button();
    5658      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
    5759      this.splitContainer1.Panel1.SuspendLayout();
    5860      this.splitContainer1.Panel2.SuspendLayout();
    5961      this.splitContainer1.SuspendLayout();
     62      this.groupBox1.SuspendLayout();
    6063      this.SuspendLayout();
    6164      //
    6265      // splitContainer1
    6366      //
    64       this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Bottom;
    65       this.splitContainer1.Location = new System.Drawing.Point(0, 33);
     67      this.splitContainer1.Location = new System.Drawing.Point(0, 57);
    6668      this.splitContainer1.Name = "splitContainer1";
    6769      //
     
    7375      //
    7476      this.splitContainer1.Panel2.Controls.Add(this.symbolicExpressionTreeChart);
    75       this.splitContainer1.Size = new System.Drawing.Size(1247, 722);
     77      this.splitContainer1.Size = new System.Drawing.Size(1247, 698);
    7678      this.splitContainer1.SplitterDistance = 607;
    7779      this.splitContainer1.TabIndex = 0;
     
    8789      this.genealogyGraphChart.ScaleOnResize = true;
    8890      this.genealogyGraphChart.SimpleLineages = false;
    89       this.genealogyGraphChart.Size = new System.Drawing.Size(607, 722);
     91      this.genealogyGraphChart.Size = new System.Drawing.Size(607, 698);
    9092      this.genealogyGraphChart.TabIndex = 0;
    9193      this.genealogyGraphChart.TraceFragments = false;
     
    98100      this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0);
    99101      this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart";
    100       this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(636, 722);
     102      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(636, 698);
    101103      this.symbolicExpressionTreeChart.Spacing = 5;
    102104      this.symbolicExpressionTreeChart.SuspendRepaint = false;
    103105      this.symbolicExpressionTreeChart.TabIndex = 0;
    104       this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font(FontFamily.GenericSansSerif, 10);
     106      this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Microsoft Sans Serif", 10F);
    105107      this.symbolicExpressionTreeChart.Tree = null;
     108      //
     109      // groupBox1
     110      //
     111      this.groupBox1.Controls.Add(this.hotPaths_button);
     112      this.groupBox1.Controls.Add(this.simpleLineages_checkBox);
     113      this.groupBox1.Controls.Add(this.lockGraph_checkBox);
     114      this.groupBox1.Controls.Add(this.trace_checkBox);
     115      this.groupBox1.Location = new System.Drawing.Point(3, 3);
     116      this.groupBox1.Name = "groupBox1";
     117      this.groupBox1.Size = new System.Drawing.Size(1195, 48);
     118      this.groupBox1.TabIndex = 4;
     119      this.groupBox1.TabStop = false;
     120      this.groupBox1.Text = "Controls";
     121      //
     122      // simpleLineages_checkBox
     123      //
     124      this.simpleLineages_checkBox.AutoSize = true;
     125      this.simpleLineages_checkBox.Location = new System.Drawing.Point(94, 19);
     126      this.simpleLineages_checkBox.Name = "simpleLineages_checkBox";
     127      this.simpleLineages_checkBox.Size = new System.Drawing.Size(103, 17);
     128      this.simpleLineages_checkBox.TabIndex = 6;
     129      this.simpleLineages_checkBox.Text = "Simple Lineages";
     130      this.simpleLineages_checkBox.UseVisualStyleBackColor = true;
     131      this.simpleLineages_checkBox.CheckedChanged += new System.EventHandler(this.simpleLineages_checkBox_CheckedChanged);
     132      //
     133      // lockGraph_checkBox
     134      //
     135      this.lockGraph_checkBox.AutoSize = true;
     136      this.lockGraph_checkBox.Location = new System.Drawing.Point(6, 19);
     137      this.lockGraph_checkBox.Name = "lockGraph_checkBox";
     138      this.lockGraph_checkBox.Size = new System.Drawing.Size(82, 17);
     139      this.lockGraph_checkBox.TabIndex = 5;
     140      this.lockGraph_checkBox.Text = "Lock Graph";
     141      this.lockGraph_checkBox.UseVisualStyleBackColor = true;
     142      this.lockGraph_checkBox.CheckedChanged += new System.EventHandler(this.lockGraph_checkBox_CheckedChanged);
    106143      //
    107144      // trace_checkBox
    108145      //
    109146      this.trace_checkBox.AutoSize = true;
    110       this.trace_checkBox.Location = new System.Drawing.Point(611, 10);
     147      this.trace_checkBox.Location = new System.Drawing.Point(203, 19);
    111148      this.trace_checkBox.Name = "trace_checkBox";
    112149      this.trace_checkBox.Size = new System.Drawing.Size(54, 17);
    113       this.trace_checkBox.TabIndex = 1;
     150      this.trace_checkBox.TabIndex = 4;
    114151      this.trace_checkBox.Text = "Trace";
    115152      this.trace_checkBox.UseVisualStyleBackColor = true;
    116153      this.trace_checkBox.CheckedChanged += new System.EventHandler(this.trace_checkBox_CheckedChanged);
    117154      //
    118       // lockGraph_checkBox
     155      // hotPaths_button
    119156      //
    120       this.lockGraph_checkBox.AutoSize = true;
    121       this.lockGraph_checkBox.Location = new System.Drawing.Point(4, 10);
    122       this.lockGraph_checkBox.Name = "lockGraph_checkBox";
    123       this.lockGraph_checkBox.Size = new System.Drawing.Size(82, 17);
    124       this.lockGraph_checkBox.TabIndex = 2;
    125       this.lockGraph_checkBox.Text = "Lock Graph";
    126       this.lockGraph_checkBox.UseVisualStyleBackColor = true;
    127       this.lockGraph_checkBox.CheckedChanged += new System.EventHandler(this.lockGraph_checkBox_CheckedChanged);
    128       //
    129       // simpleLineages_checkBox
    130       //
    131       this.simpleLineages_checkBox.AutoSize = true;
    132       this.simpleLineages_checkBox.Location = new System.Drawing.Point(91, 10);
    133       this.simpleLineages_checkBox.Name = "simpleLineages_checkBox";
    134       this.simpleLineages_checkBox.Size = new System.Drawing.Size(103, 17);
    135       this.simpleLineages_checkBox.TabIndex = 3;
    136       this.simpleLineages_checkBox.Text = "Simple Lineages";
    137       this.simpleLineages_checkBox.UseVisualStyleBackColor = true;
    138       this.simpleLineages_checkBox.CheckedChanged += new System.EventHandler(this.simpleLineages_checkBox_CheckedChanged);
     157      this.hotPaths_button.Location = new System.Drawing.Point(263, 15);
     158      this.hotPaths_button.Name = "hotPaths_button";
     159      this.hotPaths_button.Size = new System.Drawing.Size(75, 23);
     160      this.hotPaths_button.TabIndex = 7;
     161      this.hotPaths_button.Text = "Hot paths";
     162      this.hotPaths_button.UseVisualStyleBackColor = true;
     163      this.hotPaths_button.Click += new System.EventHandler(this.hotPaths_button_Click);
    139164      //
    140165      // SymboldDataAnalysisGenealogyView
     
    142167      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    143168      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    144       this.Controls.Add(this.simpleLineages_checkBox);
    145       this.Controls.Add(this.lockGraph_checkBox);
    146       this.Controls.Add(this.trace_checkBox);
     169      this.Controls.Add(this.groupBox1);
    147170      this.Controls.Add(this.splitContainer1);
    148171      this.Name = "SymboldDataAnalysisGenealogyView";
     
    152175      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
    153176      this.splitContainer1.ResumeLayout(false);
     177      this.groupBox1.ResumeLayout(false);
     178      this.groupBox1.PerformLayout();
    154179      this.ResumeLayout(false);
    155       this.PerformLayout();
    156180
    157181    }
     
    162186    private SymbolicDataAnalysisExpressionGenealogyGraphChart genealogyGraphChart;
    163187    private Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart symbolicExpressionTreeChart;
     188    private System.Windows.Forms.GroupBox groupBox1;
     189    private System.Windows.Forms.CheckBox simpleLineages_checkBox;
     190    private System.Windows.Forms.CheckBox lockGraph_checkBox;
    164191    private System.Windows.Forms.CheckBox trace_checkBox;
    165     private System.Windows.Forms.CheckBox lockGraph_checkBox;
    166     private System.Windows.Forms.CheckBox simpleLineages_checkBox;
     192    private System.Windows.Forms.Button hotPaths_button;
    167193
    168194  }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymboldDataAnalysisGenealogyView.cs

    r10755 r10888  
    3030using HeuristicLab.EvolutionTracking.Views;
    3131using HeuristicLab.MainForm;
    32 
    3332
    3433namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
     
    161160    }
    162161    #endregion
     162
     163    private void hotPaths_button_Click(object sender, System.EventArgs e) {
     164      genealogyGraphChart.HighlightHotPaths();
     165    }
    163166  }
    164167}
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r10752 r10888  
    300300    <Compile Include="Symbols\VariableConditionTreeNode.cs" />
    301301    <Compile Include="Symbols\VariableTreeNode.cs" />
     302    <Compile Include="Tracking\FragmentGraph\FragmentGraph.cs" />
    302303    <Compile Include="Tracking\SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs" />
    303304    <Compile Include="Tracking\SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs" />
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolGraph/FPGraph.cs

    r10886 r10888  
    3232    [Storable]
    3333    public Dictionary<int, List<SymbolNode>> Levels { get { return levels; } }
    34     private Dictionary<int, List<SymbolNode>> levels = new Dictionary<int, List<SymbolNode>>();
     34    private readonly Dictionary<int, List<SymbolNode>> levels = new Dictionary<int, List<SymbolNode>>();
    3535
    3636    public void AddNode(SymbolNode node, int level) {
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolGraph/SymbolGraph.cs

    r10886 r10888  
    7373    public IVertex Target { get; set; }
    7474    public double Weight { get; set; }
    75 
     75    public string Label { get; set; }
    7676    public object Data { get; set; }
    7777  }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs

    r10833 r10888  
    3737      }
    3838
    39       //      var parentVertices = childVertex.Parents.ToList();
    40       //
    41       //      if (parents[0].Length != parentVertices[0].Content.Length || parents[1].Length != parentVertices[1].Content.Length) {
    42       //        throw new Exception("Inconsistency detected in GenealogyGraph.");
    43       //      }
    44 
    4539      return result;
    4640    }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs

    r10837 r10888  
    3131
    3232      var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph[ChildParameter.ActualValue];
    33       var vClone = (IGenealogyGraphNode<ISymbolicExpressionTree>)vChild.InArcs.Last().Source;
     33      var vClone = vChild.Parents.Last();
    3434      vChild.InArcs.First().Data = vClone.Content.IterateNodesPrefix().ToList();
    3535
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs

    r10886 r10888  
    2626using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2727using HeuristicLab.EvolutionTracking;
    28 using FragmentNode = HeuristicLab.EvolutionTracking.GenealogyGraphNode<HeuristicLab.EvolutionTracking.IFragment<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTreeNode>>;
    29 using IFragmentNode = HeuristicLab.EvolutionTracking.IGenealogyGraphNode<HeuristicLab.EvolutionTracking.IFragment<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTreeNode>>;
    30 using IGraphNode = HeuristicLab.EvolutionTracking.IGenealogyGraphNode<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTree>;
    3128
    3229namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3330  public static class SymbolicDataAnalysisExpressionTracing {
    34     public static IGenealogyGraph<IFragment<ISymbolicExpressionTreeNode>> TraceSubtree(IGenealogyGraphNode<ISymbolicExpressionTree> graphNode, int subtreeIndex) {
    35       var graph = new GenealogyGraph<IFragment<ISymbolicExpressionTreeNode>>();
     31    public static FragmentGraph TraceSubtree(IGenealogyGraphNode<ISymbolicExpressionTree> graphNode, int subtreeIndex) {
     32      var graph = new FragmentGraph { AllowDuplicateContent = true };
    3633      var nodes = Trace(graphNode, subtreeIndex);
    3734      foreach (var n in nodes) {
     
    4037      return graph;
    4138    }
    42 
    43     private static IEnumerable<IFragmentNode> Trace(IGraphNode graphNode, int subtreeIndex, FragmentNode parentNode = null) {
     39    /// <summary>
     40    /// Traces a subtree in a genealogy of individuals, tracking down it's genetic components
     41    /// </summary>
     42    /// <param name="graphNode">The point in the genealogy where to start the tracing from</param>
     43    /// <param name="subtreeIndex">The traced subtree preorder index in the current tree</param>
     44    /// <param name="parentNode">The parent node in the fragment graph if there is any</param>
     45    /// <returns></returns>
     46    private static IEnumerable<FragmentNode> Trace(IGenealogyGraphNode<ISymbolicExpressionTree> graphNode, int subtreeIndex, FragmentNode parentNode = null) {
    4447      var node = graphNode; // current node
    4548      var index = subtreeIndex; // current index
     
    4952        if (!node.Parents.Any()) {
    5053          var fragmentNode = new FragmentNode {
    51             Content = new Fragment<ISymbolicExpressionTreeNode> {
    52               Root = node.Content.Root,
    53               //              Root = node.Content.NodeAt(index)
    54               Index1 = index
    55             },
    56             Rank = node.Rank,
    57             Quality = node.Quality
     54            Content = node,
     55            SubtreeIndex = index,
    5856          };
    5957          if (parent != null) {
    60             var arc = new GenealogyGraphArc(parent, fragmentNode);
     58            var arc = new Arc(parent, fragmentNode);
    6159            parent.AddForwardArc(arc);
    6260            fragmentNode.AddReverseArc(arc);
     
    7876        var subtreeLength = subtree.GetLength();
    7977
     78        #region mutation tracing
    8079        if (parents.Count == 1) {
    8180          // we are tracing a mutation operation
    8281          var fragmentNode = new FragmentNode {
    83             Content = new Fragment<ISymbolicExpressionTreeNode> {
    84               Root = tree.Root,
    85               //              Root = subtree
    86               Index1 = index,
    87               Index2 = fragment.Index1
    88             },
    89             Rank = node.Rank,
    90             Quality = node.Quality
     82            Content = node,
     83            SubtreeIndex = index,
     84            FragmentIndex = fragment.Index1
    9185          };
    9286          if (parent != null) {
    93             var arc = new GenealogyGraphArc(parent, fragmentNode);
     87            var arc = new Arc(parent, fragmentNode);
    9488            parent.AddForwardArc(arc);
    9589            fragmentNode.AddReverseArc(arc);
    9690          }
     91          node = parents[0];
     92          if (subtreeIndex == fragment.Index1) {
     93            // index stays the same
     94          } else if (fragment.Index1 < subtreeIndex) {
     95            if (subtreeIndex < fragment.Index1 + fragmentLength) {
     96              // subtree contained in fragment, index stays the same
     97            } else {
     98              index += node.Content.NodeAt(fragment.Index1).GetLength() - fragmentLength;
     99            }
     100          } else if (subtreeIndex < fragment.Index1) {
     101            if (fragment.Index1 < subtreeIndex + subtreeLength) {
     102              // subtree contains fragment
     103              index = fragment.Index1;
     104            } else {
     105              // index stays the same
     106            }
     107          }
     108
    97109          yield return fragmentNode;
    98           var up = Trace(parents[0], fragment.Index1, fragmentNode);
     110          var up = Trace(node, index, fragmentNode);
    99111          foreach (var v in up) { yield return v; }
    100112          break;
    101113        }
     114        #endregion
    102115
     116        #region crossover tracing
    103117        if (parents.Count == 2) {
    104118          // we are tracing a crossover operation
     
    125139              // subtree contains fragment => bifurcation point in the fragment graph
    126140              var fragmentNode = new FragmentNode {
    127                 Content = new Fragment<ISymbolicExpressionTreeNode> {
    128                   Root = tree.Root,
    129                   Index1 = index,
    130                   Index2 = fragment.Index1
    131                 },
    132                 Rank = node.Rank,
    133                 Quality = node.Quality
     141                Content = node,
     142                SubtreeIndex = index,
     143                FragmentIndex = fragment.Index1
    134144              };
    135145              if (parent != null) {
    136                 var arc = new GenealogyGraphArc(parent, fragmentNode);
     146                var arc = new Arc(parent, fragmentNode);
    137147                parent.AddForwardArc(arc);
    138148                fragmentNode.AddReverseArc(arc);
    139149              }
    140               //              fragmentNode.Content.Index1 = fragment.Index1 - index;
    141150              yield return fragmentNode;
    142151
     
    154163          }
    155164        }
     165        #endregion
    156166      }
    157167    }
Note: See TracChangeset for help on using the changeset viewer.