Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Fragment.cs @ 10755

Last change on this file since 10755 was 10755, checked in by bburlacu, 10 years ago

#1772: Simplified genealogy graph and fragment graph creation:

  • the genealogy graph now has a 1-1 mapping between content and vertices (as opposed to 1-n as it was previously, to account for elites); this required changes to the directed graph implementation
  • the fragment graph only contains bifurcation points (where the subtree contains the fragment so tracing must be done both ways (in the root parent AND in the other parent). in the other cases, tracing is restarted from the parent genealogy graph node.
File size: 1.1 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
4
5namespace HeuristicLab.EvolutionTracking {
6  [StorableClass]
7  [Item("Fragment", "A fragment is an object that represents a piece of genetic information that was transferred from parent to child.")]
8  public class Fragment : Item, IFragment {
9    [Storable]
10    public int Index1 { get; set; }
11
12    [Storable]
13    public int Index2 { get; set; }
14
15    [Storable]
16    private object root;
17    public object Root {
18      get { return root; }
19      set { root = value; }
20    }
21
22    protected Fragment(Fragment original, Cloner cloner)
23      : base(original, cloner) {
24      Root = original.Root;
25      Index1 = original.Index1;
26      Index2 = original.Index2;
27    }
28    public override IDeepCloneable Clone(Cloner cloner) {
29      return new Fragment(this, cloner);
30    }
31    public Fragment() { }
32  }
33
34  public class Fragment<T> : Fragment, IFragment<T> where T : class {
35    public new T Root {
36      get { return (T)base.Root; }
37      set { base.Root = value; }
38    }
39  }
40}
Note: See TracBrowser for help on using the repository browser.