Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 14821 was 14777, checked in by pkimmesw, 8 years ago

#2665 simplifier, push solution results view, performance improvements, small bug fixes, ui fixes

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