source: branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/GPTP2021VectorBenchmarks/GPTP2021VectorBenchmarksInstanceProvider.cs @ 17936

Last change on this file since 17936 was 17936, checked in by pfleck, 16 months ago

#3040

  • Added additional benchmark instances for vector GP.
  • Removed old binding redirect.
File size: 9.6 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.IO.Compression;
25using System.Linq;
26using System.Runtime.Remoting.Messaging;
27
28namespace HeuristicLab.Problems.Instances.DataAnalysis {
29  public class GPTP2021VectorBenchmarksInstanceProvider : ResourceRegressionInstanceProvider {
30    public override string Name {
31      get { return "GPTP 2021 Vector Benchmark Problems"; }
32    }
33    public override string Description {
34      get {
35        return "";
36      }
37    }
38    public override Uri WebLink {
39      get { return null; }
40    }
41    public override string ReferencePublication {
42      get { return ""; }
43    }
44
45    protected override string FileName { get { return "GPTP2021VectorBenchmarks"; } }
46
47    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
48      return new List<ResourceRegressionDataDescriptor> {
49        new GPTP2021VectorBenchmarkDataDescriptor("test_A_01", new []{ "v1" }),
50        new GPTP2021VectorBenchmarkDataDescriptor("test_A_02", new []{ "v1" }),
51        new GPTP2021VectorBenchmarkDataDescriptor("test_A_03", new []{ "x1", "v1" }),
52        new GPTP2021VectorBenchmarkDataDescriptor("test_A_04", new []{ "x1", "x2", "v1", "v2" }),
53        new GPTP2021VectorBenchmarkDataDescriptor("test_A_05", new []{ "x1", "x2", "v1", "v2" }),
54        new GPTP2021VectorBenchmarkDataDescriptor("test_A_11", new []{ "x1", "x2", "v1", "v2" }),
55        new GPTP2021VectorBenchmarkDataDescriptor("test_A_12", new []{ "x1", "x2", "x3", "v1", "v2", "v3" }),
56        new GPTP2021VectorBenchmarkDataDescriptor("test_A_13", new []{ "x1", "x2", "x3", "v1", "v2", "v3"  }),
57        new GPTP2021VectorBenchmarkDataDescriptor("test_A_14", new []{ "x1", "x2", "x3", "x4", "x5", "v1", "v2", "v3", "v4", "v5" }),
58        new GPTP2021VectorBenchmarkDataDescriptor("test_A_15", new []{ "x1", "x2", "x3", "x4", "x5", "v1", "v2", "v3", "v4", "v5" }),
59        new GPTP2021VectorBenchmarkDataDescriptor("test_B_01", new []{ "x1", "x2", "v1", "v2" }),
60        new GPTP2021VectorBenchmarkDataDescriptor("test_B_02", new []{ "x1", "x2", "v1", "v2" }),
61        new GPTP2021VectorBenchmarkDataDescriptor("test_B_03", new []{ "x1", "x2", "v1", "v2", "v3" }),
62        new GPTP2021VectorBenchmarkDataDescriptor("test_B_04", new []{ "x1", "x2", "v1", "v2", "v3", "v4" }),
63        new GPTP2021VectorBenchmarkDataDescriptor("test_B_11", new []{ "x1", "x2", "x3", "x4", "v1", "v2", "v3", "v4" }),
64        new GPTP2021VectorBenchmarkDataDescriptor("test_B_12", new []{ "x1", "x2", "x3", "x4", "v1", "v2", "v3", "v4" }),
65        new GPTP2021VectorBenchmarkDataDescriptor("test_B_13", new []{ "x1", "x2", "x3", "x4", "x5", "v1", "v2", "v3", "v4", "v5", "v6", "v7" }),
66        new GPTP2021VectorBenchmarkDataDescriptor("test_B_14", new []{ "x1", "x2", "x3", "x4", "x5", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8" }),
67
68        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_01", Flatten(U("v1"))),
69        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_02", Flatten(U("v1"))),
70        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_03", Flatten(S("x1"), U("v1"))),
71        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_04", Flatten(S("x1"), S("x2"), U("v1"), U("v2"))),
72        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_05", Flatten(S("x1"), S("x2"), U("v1"), U("v2"))),
73        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_11", Flatten(S("x1"), S("x2"), U("v1"), U("v2"))),
74        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_12", Flatten(S("x1"), S("x2"), S("x3"), U("v1"), U("v2"), U("v3"))),
75        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_13", Flatten(S("x1"), S("x2"), S("x3"), U("v1"), U("v2"), U("v3"))),
76        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_14", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), S("x5"), U("v1"), U("v2"), U("v3"), U("v4"), U("v5"))),
77        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_A_15", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), S("x5"), U("v1"), U("v2"), U("v3"), U("v4"), U("v5"))),
78        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_B_01", Flatten(S("x1"), S("x2"), U("v1"), U("v2"))),
79        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_B_02", Flatten(S("x1"), S("x2"), U("v1"), U("v2"))),
80        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_B_03", Flatten(S("x1"), S("x2"), U("v1"), U("v2"), U("v3"))),
81        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_B_04", Flatten(S("x1"), S("x2"), U("v1"), U("v2"), U("v3"), U("v4"))),
82        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_B_11", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), U("v1"), U("v2"), U("v3"), U("v4"))),
83        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_B_12", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), U("v1"), U("v2"), U("v3"), U("v4"))),
84        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_B_13", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), S("x5"), U("v1"), U("v2"), U("v3"), U("v4"), U("v5"), U("v6"), U("v7"))),
85        new GPTP2021VectorBenchmarkDataDescriptor("unrolled_test_B_14", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), S("x5"), U("v1"), U("v2"), U("v3"), U("v4"), U("v5"), U("v6"), U("v7"), U("v8"))),
86
87        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_01", Flatten(A("v1"))),
88        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_02", Flatten(A("v1"))),
89        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_03", Flatten(S("x1"), A("v1"))),
90        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_04", Flatten(S("x1"), S("x2"), A("v1"), A("v2"))),
91        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_05", Flatten(S("x1"), S("x2"), A("v1"), A("v2"))),
92        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_11", Flatten(S("x1"), S("x2"), A("v1"), A("v2"))),
93        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_12", Flatten(S("x1"), S("x2"), S("x3"), A("v1"), A("v2"), A("v3"))),
94        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_13", Flatten(S("x1"), S("x2"), S("x3"), A("v1"), A("v2"), A("v3"))),
95        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_14", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), S("x5"), A("v1"), A("v2"), A("v3"), A("v4"), A("v5"))),
96        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_A_15", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), S("x5"), A("v1"), A("v2"), A("v3"), A("v4"), A("v5"))),
97        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_B_01", Flatten(S("x1"), S("x2"), A("v1"), A("v2"))),
98        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_B_02", Flatten(S("x1"), S("x2"), A("v1"), A("v2"))),
99        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_B_03", Flatten(S("x1"), S("x2"), A("v1"), A("v2"), A("v3"))),
100        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_B_04", Flatten(S("x1"), S("x2"), A("v1"), A("v2"), A("v3"), A("v4"))),
101        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_B_11", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), A("v1"), A("v2"), A("v3"), A("v4"))),
102        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_B_12", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), A("v1"), A("v2"), A("v3"), A("v4"))),
103        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_B_13", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), S("x5"), A("v1"), A("v2"), A("v3"), A("v4"), A("v5"), A("v6"), A("v7"))),
104        new GPTP2021VectorBenchmarkDataDescriptor("pre_aggregated_test_B_14", Flatten(S("x1"), S("x2"), S("x3"), S("x4"), S("x5"), A("v1"), A("v2"), A("v3"), A("v4"), A("v5"), A("v6"), A("v7"), A("v8"))),
105      };
106    }
107
108    private static T[] Flatten<T>(params IEnumerable<T>[] values) {
109      return values.SelectMany(x => x).ToArray();
110    }
111    private static IEnumerable<string> S(string name) {
112      yield return name;
113    }
114    // Unroll vector variable name
115    private static IEnumerable<string> U(string name, int length = 20) {
116      return Enumerable.Range(0, length).Select(i => name + "_" + i);
117    }
118    // Pre-aggregated variable name
119    private static readonly string[] DefaultAggregationNames = { "sum", "mean", "std", "var", "median", "amin", "amax" };
120    private static IEnumerable<string> A(string name, string[] aggregationNames = null) {
121      aggregationNames = aggregationNames ?? DefaultAggregationNames;
122      return aggregationNames.Select(aggrName => $"{name}_{aggrName}");
123    }
124
125    protected override TableFileFormatOptions GetFormatOptions(ZipArchiveEntry entry) {
126      return new TableFileFormatOptions() {
127        ColumnSeparator = ';',
128        VectorSeparator = ','
129      };
130    }
131  }
132}
Note: See TracBrowser for help on using the repository browser.