Free cookie consent management tool by TermsFeed Policy Generator

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

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

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

File size: 1.5 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 inherited genetic information.")]
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    [StorableConstructor]
23    protected Fragment(bool deserializable) : base(deserializable) { }
24
25    protected Fragment(Fragment original, Cloner cloner)
26      : base(original, cloner) {
27      Root = original.Root;
28      Index1 = original.Index1;
29      Index2 = original.Index2;
30    }
31    public override IDeepCloneable Clone(Cloner cloner) {
32      return new Fragment(this, cloner);
33    }
34    public Fragment() { }
35  }
36
37  [StorableClass]
38  [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")]
39  public class Fragment<T> : Fragment, IFragment<T> where T : class {
40    public new T Root {
41      get { return (T)base.Root; }
42      set { base.Root = value; }
43    }
44
45    protected Fragment(Fragment original, Cloner cloner)
46      : base(original, cloner) {
47    }
48
49    [StorableConstructor]
50    private Fragment(bool deserializable) : base(deserializable) { }
51
52    public Fragment() { }
53  }
54}
Note: See TracBrowser for help on using the repository browser.