Last change
on this file since 16003 was
15771,
checked in by bburlacu, 7 years ago
|
#2895: Add solution skeleton for PushGP with genealogy analysis.
|
File size:
1.7 KB
|
Rev | Line | |
---|
[10347] | 1 | using HeuristicLab.Common;
|
---|
| 2 | using HeuristicLab.Core;
|
---|
| 3 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 4 |
|
---|
[15771] | 5 | namespace HeuristicLab.Problems.ProgramSynthesis {
|
---|
[10347] | 6 | [StorableClass]
|
---|
[10830] | 7 | [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")]
|
---|
[10347] | 8 | public class Fragment : Item, IFragment {
|
---|
| 9 | [Storable]
|
---|
[10755] | 10 | public int Index1 { get; set; }
|
---|
[10347] | 11 |
|
---|
| 12 | [Storable]
|
---|
[10755] | 13 | public int Index2 { get; set; }
|
---|
[10347] | 14 |
|
---|
| 15 | [Storable]
|
---|
| 16 | private object root;
|
---|
| 17 | public object Root {
|
---|
| 18 | get { return root; }
|
---|
| 19 | set { root = value; }
|
---|
| 20 | }
|
---|
[10830] | 21 | [StorableConstructor]
|
---|
| 22 | protected Fragment(bool deserializable) : base(deserializable) { }
|
---|
| 23 |
|
---|
[10347] | 24 | protected Fragment(Fragment original, Cloner cloner)
|
---|
| 25 | : base(original, cloner) {
|
---|
| 26 | Root = original.Root;
|
---|
[10755] | 27 | Index1 = original.Index1;
|
---|
| 28 | Index2 = original.Index2;
|
---|
[10347] | 29 | }
|
---|
[11928] | 30 |
|
---|
[10347] | 31 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 32 | return new Fragment(this, cloner);
|
---|
| 33 | }
|
---|
[11928] | 34 |
|
---|
[10347] | 35 | public Fragment() { }
|
---|
| 36 | }
|
---|
| 37 |
|
---|
[10830] | 38 | [StorableClass]
|
---|
| 39 | [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")]
|
---|
[10347] | 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 | }
|
---|
[10830] | 45 |
|
---|
[11928] | 46 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 47 | return new Fragment<T>(this, cloner);
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | protected Fragment(Fragment<T> original, Cloner cloner)
|
---|
[10830] | 51 | : base(original, cloner) {
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | [StorableConstructor]
|
---|
[11928] | 55 | protected Fragment(bool deserializable) : base(deserializable) { }
|
---|
[10830] | 56 |
|
---|
| 57 | public Fragment() { }
|
---|
[10347] | 58 | }
|
---|
| 59 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.