Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/Example.cs @ 14733

Last change on this file since 14733 was 14733, checked in by pkimmesw, 7 years ago

#2665 Storable problem data, Renamings due to typos, Removed GP from class names

File size: 1.6 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2
3  using HeuristicLab.Common;
4  using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
5
6  [StorableClass]
7  public class Example : DeepCloneable {
8    public Example() {
9      InputInt = new long[0];
10      InputFloat = new double[0];
11      InputBoolean = new bool[0];
12      OutputInt = InputInt;
13      OutputFloat = InputFloat;
14      OutputBoolean = InputBoolean;
15    }
16
17    public Example(Example origin, Cloner cloner) : base(origin, cloner) {
18      origin.CopyTo(this);
19    }
20
21    [StorableConstructor]
22    public Example(bool deserializing) { }
23
24    public void CopyTo(Example example) {
25      example.InputArgs = this.InputArgs;
26      example.OutputArgs = this.OutputArgs;
27
28      example.InputBoolean = this.InputBoolean;
29      example.InputInt = this.InputInt;
30      example.InputFloat = this.InputFloat;
31
32      example.OutputBoolean = this.OutputBoolean;
33      example.OutputInt = this.OutputInt;
34      example.OutputFloat = this.OutputFloat;
35    }
36
37    [Storable]
38    public string[] InputArgs { get; set; }
39    [Storable]
40    public string[] OutputArgs { get; set; }
41    [Storable]
42    public long[] InputInt { get; set; }
43    [Storable]
44    public double[] InputFloat { get; set; }
45    [Storable]
46    public bool[] InputBoolean { get; set; }
47    [Storable]
48    public long[] OutputInt { get; set; }
49    [Storable]
50    public double[] OutputFloat { get; set; }
51    [Storable]
52    public bool[] OutputBoolean { get; set; }
53
54    public override IDeepCloneable Clone(Cloner cloner) {
55      return new Example(this, cloner);
56    }
57  }
58}
Note: See TracBrowser for help on using the repository browser.