Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/SegmentOptimization/SegmentOptimizationInstanceProvider.cs @ 18096

Last change on this file since 18096 was 18096, checked in by pfleck, 2 years ago

#3040 Added instance provider for segment opt problem with WIP instances.

File size: 2.5 KB
RevLine 
[18096]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.Linq;
25using HeuristicLab.Problems.Instances.Types;
26
27namespace HeuristicLab.Problems.Instances.DataAnalysis.SegmentOptimization {
28  public class SegmentOptimizationInstanceProvider  : ProblemInstanceProvider<SOPData> {
29
30    public override string Name {
31      get { return "Simple Generated"; }
32    }
33    public override string Description {
34      get { return "Simple Generated"; }
35    }
36
37    public override string ReferencePublication => "";
38    public override Uri WebLink => null;
39   
40    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
41      return new[] {
42        new SOPDataDescriptor("[1:100]: i sum", "", new SOPData {
43          Values = Enumerable.Range(1, 100).Select(i => (double)i).ToArray(),
44          Lower = 30, Upper = 50, Aggregation = "sum"
45        }),
46        new SOPDataDescriptor("[1:1000]: i sum", "", new SOPData {
47          Values = Enumerable.Range(1, 1000).Select(i => (double)i).ToArray(),
48          Lower = 350, Upper = 500, Aggregation = "sum"
49        }),
50        new SOPDataDescriptor("[1:100]: i^2 sum", "", new SOPData {
51          Values = Enumerable.Range(1, 100).Select(i => (double)i * i).ToArray(),
52          Lower = 30, Upper = 50, Aggregation = "sum"
53        }),
54        new SOPDataDescriptor("[1:1000]: i^2 sum", "", new SOPData {
55          Values = Enumerable.Range(1, 1000).Select(i => (double)i * i).ToArray(),
56          Lower = 350, Upper = 500, Aggregation = "sum"
57        }),
58      };
59    }
60    public override SOPData LoadData(IDataDescriptor id) {
61      var descriptor = (SOPDataDescriptor)id;
62      return descriptor.Data;
63    }
64  }
65}
Note: See TracBrowser for help on using the repository browser.