Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2895_PushGP_GenealogyAnalysis/HeuristicLab.Problems.ProgramSynthesis.GenealogyAnalysis/Fragment.cs @ 16189

Last change on this file since 16189 was 15771, checked in by bburlacu, 7 years ago

#2895: Add solution skeleton for PushGP with genealogy analysis.

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