Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/VectorAverage.cs @ 15017

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

#2665 Fixed Benchmark Problem Definition, Converted LoopExpressions to stateless expressions, Added several unit test to ensure funcionality, Fixed UI bugs

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