Free cookie consent management tool by TermsFeed Policy Generator

source: addons/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/Example.cs @ 16101

Last change on this file since 16101 was 14744, checked in by pkimmesw, 8 years ago

#2665 Renamings due to typos, ManagedPool tests, Skip Noops in Debugger

File size: 1.8 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  using System;
3
4  using HeuristicLab.Common;
5  using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
6
7  [StorableClass]
8  public class Example : DeepCloneable {
9    public Example() {
10      InputInt = new long[0];
11      InputFloat = new double[0];
12      InputBoolean = new bool[0];
13      OutputInt = InputInt;
14      OutputFloat = InputFloat;
15      OutputBoolean = 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      Array.Copy(InputArgs, example.InputArgs, InputArgs.Length);
27      Array.Copy(OutputArgs, example.OutputArgs, OutputArgs.Length);
28
29      Array.Copy(InputBoolean, example.InputBoolean, InputBoolean.Length);
30      Array.Copy(InputInt, example.InputInt, InputInt.Length);
31      Array.Copy(InputFloat, example.InputFloat, InputFloat.Length);
32
33      Array.Copy(OutputBoolean, example.OutputBoolean, OutputBoolean.Length);
34      Array.Copy(OutputInt, example.OutputInt, OutputInt.Length);
35      Array.Copy(OutputFloat, example.OutputFloat, OutputFloat.Length);
36    }
37
38    [Storable]
39    public string[] InputArgs { get; set; }
40    [Storable]
41    public string[] OutputArgs { get; set; }
42    [Storable]
43    public long[] InputInt { get; set; }
44    [Storable]
45    public double[] InputFloat { get; set; }
46    [Storable]
47    public bool[] InputBoolean { get; set; }
48    [Storable]
49    public long[] OutputInt { get; set; }
50    [Storable]
51    public double[] OutputFloat { get; set; }
52    [Storable]
53    public bool[] OutputBoolean { get; set; }
54
55    public override IDeepCloneable Clone(Cloner cloner) {
56      return new Example(this, cloner);
57    }
58  }
59}
Note: See TracBrowser for help on using the repository browser.