Free cookie consent management tool by TermsFeed Policy Generator

source: addons/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/VectorAverage.cs @ 17460

Last change on this file since 17460 was 15366, checked in by pkimmesw, 7 years ago

#2665 Solution Cleanup

File size: 1.9 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  using System;
3  using System.Linq;
4
5  public class VectorAverage : BenchmarkSuiteDataDescriptor {
6    private const string name = "Vector Average - Hard";
7    private const string fileName = "VectorAverage.csv";
8    private const string description = "Given a vector of floats, return the average of those floats. Results are rounded to 4 decimal places.";
9
10    protected override string FileName { get { return fileName; } }
11    public override string Name { get { return name; } }
12    public override string Description { get { return description; } }
13    protected override int InputArgumentCount { get { return 1; } }
14    protected override int OutputArgumentCount { get { return 1; } }
15
16    public override ProblemData CreateProblemData() {
17      return new ProblemData(ProblemType.VectorAverage) {
18        Name = Name,
19        Description = Description,
20        ProgramExecutionBudget = 30000000,
21        Examples = CloneExamples(),
22        BestResult = 0,
23        WorstResult = 10000,
24        InputArgumentTypes = new[] { ExampleArgumentType.FloatVector },
25        OutputArgumentTypes = new[] { ExampleArgumentType.Float },
26        TrainingCount = 100,
27        TestCount = 1000,
28        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Float | DataTypes.FloatVector,
29        MaxSize = 400,
30        EvalLimit = 800,
31        FloatStringFormat = "N4"
32      };
33    }
34
35    protected override Example ParseExample(string[] input, string[] output) {
36      return new Example {
37        InputArgs = input,
38        OutputArgs = output,
39        InputFloatVector = new[] { ExampleArgumentConverter.ConvertDoubles(input[0]) },
40        OutputFloat = ExampleArgumentConverter.ConvertDoubles(output[0]).Select(x => Math.Round(x, 4)).ToArray(),
41        OutputFloatPrecision = 4
42      };
43    }
44  }
45}
Note: See TracBrowser for help on using the repository browser.