[14777] | 1 | namespace HeuristicLab.BenchmarkSuite {
|
---|
[15017] | 2 | using System;
|
---|
[14727] | 3 |
|
---|
[14777] | 4 | using HeuristicLab.Common;
|
---|
| 5 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 6 |
|
---|
| 7 | [StorableClass]
|
---|
| 8 | public class Example : DeepCloneable {
|
---|
[14834] | 9 | private static readonly long[] emptyIntegers = new long[0];
|
---|
| 10 | private static readonly double[] emptyFloats = new double[0];
|
---|
| 11 | private static readonly bool[] emptyBooleans = new bool[0];
|
---|
| 12 | private static readonly char[] emptyChars = new char[0];
|
---|
| 13 | private static readonly string[] emptyStrings = new string[0];
|
---|
[14875] | 14 | private static readonly long[][] emptyIntegerVectors = new long[0][];
|
---|
| 15 | private static readonly double[][] emptyFloatVectors = new double[0][];
|
---|
| 16 | private static readonly bool[][] emptyBooleanVectors = new bool[0][];
|
---|
| 17 | private static readonly string[][] emptyStringVectors = new string[0][];
|
---|
[14834] | 18 |
|
---|
[14907] | 19 | public Example() {
|
---|
| 20 | InputArgs = emptyStrings;
|
---|
| 21 | OutputArgs = emptyStrings;
|
---|
[14834] | 22 |
|
---|
[14897] | 23 | InputInteger = emptyIntegers;
|
---|
[14834] | 24 | InputFloat = emptyFloats;
|
---|
| 25 | InputBoolean = emptyBooleans;
|
---|
| 26 | InputChar = emptyChars;
|
---|
| 27 | InputString = emptyStrings;
|
---|
[14875] | 28 | InputIntegerVector = emptyIntegerVectors;
|
---|
| 29 | InputFloatVector = emptyFloatVectors;
|
---|
| 30 | InputBooleanVector = emptyBooleanVectors;
|
---|
| 31 | InputStringVector = emptyStringVectors;
|
---|
[14834] | 32 |
|
---|
[14897] | 33 | OutputInteger = emptyIntegers;
|
---|
[14834] | 34 | OutputFloat = emptyFloats;
|
---|
| 35 | OutputBoolean = emptyBooleans;
|
---|
| 36 | OutputChar = emptyChars;
|
---|
| 37 | OutputString = emptyStrings;
|
---|
[14875] | 38 | OutputIntegerVector = emptyIntegerVectors;
|
---|
| 39 | OutputFloatVector = emptyFloatVectors;
|
---|
| 40 | OutputBooleanVector = emptyBooleanVectors;
|
---|
| 41 | OutputStringVector = emptyStringVectors;
|
---|
[14897] | 42 | OutputPrint = string.Empty;
|
---|
[15017] | 43 | OutputFloatPrecision = 15;
|
---|
| 44 | OutputFloatVectorPrecision = 15;
|
---|
[14777] | 45 | }
|
---|
| 46 |
|
---|
| 47 | public Example(Example origin, Cloner cloner) : base(origin, cloner) {
|
---|
[14834] | 48 | InputArgs = (string[])origin.InputArgs.Clone();
|
---|
| 49 | OutputArgs = (string[])origin.OutputArgs.Clone();
|
---|
| 50 |
|
---|
| 51 | InputBoolean = (bool[])origin.InputBoolean.Clone();
|
---|
[14875] | 52 | InputInteger = (long[])origin.InputInteger.Clone();
|
---|
[14834] | 53 | InputFloat = (double[])origin.InputFloat.Clone();
|
---|
| 54 | InputChar = (char[])origin.InputChar.Clone();
|
---|
| 55 | InputString = (string[])origin.InputString.Clone();
|
---|
[14875] | 56 | InputIntegerVector = (long[][])origin.InputIntegerVector.Clone();
|
---|
| 57 | InputFloatVector = (double[][])origin.InputFloatVector.Clone();
|
---|
| 58 | InputBooleanVector = (bool[][])origin.InputBooleanVector.Clone();
|
---|
| 59 | InputStringVector = (string[][])origin.InputStringVector.Clone();
|
---|
[14834] | 60 |
|
---|
| 61 | OutputBoolean = (bool[])origin.OutputBoolean.Clone();
|
---|
[14897] | 62 | OutputInteger = (long[])origin.OutputInteger.Clone();
|
---|
[14834] | 63 | OutputFloat = (double[])origin.OutputFloat.Clone();
|
---|
| 64 | OutputChar = (char[])origin.OutputChar.Clone();
|
---|
| 65 | OutputString = (string[])origin.OutputString.Clone();
|
---|
[14875] | 66 | OutputIntegerVector = (long[][])origin.OutputIntegerVector.Clone();
|
---|
| 67 | OutputFloatVector = (double[][])origin.OutputFloatVector.Clone();
|
---|
| 68 | OutputBooleanVector = (bool[][])origin.OutputBooleanVector.Clone();
|
---|
| 69 | OutputStringVector = (string[][])origin.OutputStringVector.Clone();
|
---|
[14897] | 70 | OutputPrint = origin.OutputPrint;
|
---|
[14952] | 71 | OutputPrintLineCount = origin.OutputPrintLineCount;
|
---|
[15017] | 72 | OutputFloatPrecision = origin.OutputFloatPrecision;
|
---|
| 73 | OutputFloatVectorPrecision = origin.OutputFloatVectorPrecision;
|
---|
[14777] | 74 | }
|
---|
| 75 |
|
---|
| 76 | [StorableConstructor]
|
---|
| 77 | public Example(bool deserializing) { }
|
---|
| 78 |
|
---|
| 79 | [Storable]
|
---|
| 80 | public string[] InputArgs { get; set; }
|
---|
| 81 | [Storable]
|
---|
| 82 | public string[] OutputArgs { get; set; }
|
---|
| 83 |
|
---|
| 84 | [Storable]
|
---|
[14875] | 85 | public long[] InputInteger { get; set; }
|
---|
[14777] | 86 | [Storable]
|
---|
| 87 | public double[] InputFloat { get; set; }
|
---|
| 88 | [Storable]
|
---|
| 89 | public bool[] InputBoolean { get; set; }
|
---|
| 90 | [Storable]
|
---|
| 91 | public char[] InputChar { get; set; }
|
---|
| 92 | [Storable]
|
---|
| 93 | public string[] InputString { get; set; }
|
---|
[14875] | 94 | [Storable]
|
---|
| 95 | public long[][] InputIntegerVector { get; set; }
|
---|
| 96 | [Storable]
|
---|
| 97 | public double[][] InputFloatVector { get; set; }
|
---|
| 98 | [Storable]
|
---|
| 99 | public bool[][] InputBooleanVector { get; set; }
|
---|
| 100 | [Storable]
|
---|
| 101 | public string[][] InputStringVector { get; set; }
|
---|
[14777] | 102 |
|
---|
| 103 | [Storable]
|
---|
[14875] | 104 | public long[] OutputInteger { get; set; }
|
---|
[14777] | 105 | [Storable]
|
---|
| 106 | public double[] OutputFloat { get; set; }
|
---|
| 107 | [Storable]
|
---|
| 108 | public bool[] OutputBoolean { get; set; }
|
---|
| 109 | [Storable]
|
---|
| 110 | public char[] OutputChar { get; set; }
|
---|
| 111 | [Storable]
|
---|
| 112 | public string[] OutputString { get; set; }
|
---|
[14875] | 113 | [Storable]
|
---|
| 114 | public long[][] OutputIntegerVector { get; set; }
|
---|
| 115 | [Storable]
|
---|
| 116 | public double[][] OutputFloatVector { get; set; }
|
---|
| 117 | [Storable]
|
---|
| 118 | public bool[][] OutputBooleanVector { get; set; }
|
---|
| 119 | [Storable]
|
---|
| 120 | public string[][] OutputStringVector { get; set; }
|
---|
[14897] | 121 | [Storable]
|
---|
[15017] | 122 | private string outputPrint;
|
---|
| 123 | private static readonly string[] NewLineSeparator = { "\r\n", "\n" };
|
---|
| 124 | public string OutputPrint
|
---|
| 125 | {
|
---|
| 126 | get { return outputPrint; }
|
---|
| 127 | set
|
---|
| 128 | {
|
---|
| 129 | outputPrint = value;
|
---|
| 130 | OutputPrintLineCount = value != null ? value.Split(NewLineSeparator, StringSplitOptions.None).Length : 0;
|
---|
| 131 | }
|
---|
| 132 | }
|
---|
| 133 |
|
---|
[14952] | 134 | [Storable]
|
---|
[15017] | 135 | public int OutputPrintLineCount { get; private set; }
|
---|
[14777] | 136 |
|
---|
[15017] | 137 | [Storable]
|
---|
| 138 | public int OutputFloatPrecision { get; set; }
|
---|
| 139 | [Storable]
|
---|
| 140 | public int OutputFloatVectorPrecision { get; set; }
|
---|
| 141 |
|
---|
[14777] | 142 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 143 | return new Example(this, cloner);
|
---|
| 144 | }
|
---|
[14727] | 145 | }
|
---|
[14777] | 146 | }
|
---|