1 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
2 | using System.Linq;
|
---|
3 |
|
---|
4 | using HeuristicLab.Common;
|
---|
5 | using HeuristicLab.Core;
|
---|
6 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
7 |
|
---|
8 | [StorableClass]
|
---|
9 | public class Data : NamedItem {
|
---|
10 |
|
---|
11 | public Data() { }
|
---|
12 |
|
---|
13 | [StorableConstructor]
|
---|
14 | protected Data(bool deserializing) : base(deserializing) { }
|
---|
15 |
|
---|
16 | public Data(Data origin, Cloner cloner) : base(origin, cloner) {
|
---|
17 | OriginalTrainingCount = origin.OriginalTrainingCount;
|
---|
18 | OriginalTestCount = origin.OriginalTestCount;
|
---|
19 | BestResult = origin.BestResult;
|
---|
20 | WorstResult = origin.WorstResult;
|
---|
21 | InputArgumentTypes = origin.InputArgumentTypes;
|
---|
22 | OutputArgumentTypes = origin.OutputArgumentTypes;
|
---|
23 |
|
---|
24 | if (origin.Examples != null)
|
---|
25 | Examples = origin.Examples.Select(e => (Example)e.Clone(cloner)).ToArray();
|
---|
26 |
|
---|
27 | EnabledDataTypes = origin.EnabledDataTypes;
|
---|
28 | }
|
---|
29 |
|
---|
30 | [Storable]
|
---|
31 | public int OriginalTrainingCount { get; set; }
|
---|
32 | [Storable]
|
---|
33 | public int OriginalTestCount { get; set; }
|
---|
34 | [Storable]
|
---|
35 | public double BestResult { get; set; }
|
---|
36 | [Storable]
|
---|
37 | public double WorstResult { get; set; }
|
---|
38 | [Storable]
|
---|
39 | public ExampleArgumentType[] InputArgumentTypes { get; set; }
|
---|
40 | [Storable]
|
---|
41 | public ExampleArgumentType[] OutputArgumentTypes { get; set; }
|
---|
42 | public int TotalArgumentCount { get { return InputArgumentTypes.Length + OutputArgumentTypes.Length; } }
|
---|
43 | [Storable]
|
---|
44 | public Example[] Examples { get; set; }
|
---|
45 | [Storable]
|
---|
46 | public DataTypes EnabledDataTypes { get; set; }
|
---|
47 |
|
---|
48 | /// <summary>
|
---|
49 | /// Max Size” gives the maximum number of instructions that can appear in an individual’s genome
|
---|
50 | /// </summary>
|
---|
51 | [Storable]
|
---|
52 | public int MaxSize { get; set; }
|
---|
53 |
|
---|
54 | /// <summary>
|
---|
55 | /// “Eval Limit” is the number of steps of the Push interpreter that are executed before stopping a
|
---|
56 | /// program’s execution; programs halted in this way may still achieve good results if they print or
|
---|
57 | /// return results before they are stopped
|
---|
58 | /// </summary>
|
---|
59 | [Storable]
|
---|
60 | public int EvalLimit { get; set; }
|
---|
61 |
|
---|
62 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
63 | return new Data(this, cloner);
|
---|
64 | }
|
---|
65 | }
|
---|
66 | }
|
---|