Last change
on this file since 14875 was
14875,
checked in by pkimmesw, 8 years ago
|
#2665 BenchmarkSuite, all examples, partially tested, VectorExpressions added
|
File size:
1.6 KB
|
Line | |
---|
1 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
2 | public class VectorAverage : BenchmarkSuiteDataDescriptor {
|
---|
3 | private const string name = "Vector Average";
|
---|
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 {
|
---|
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 | };
|
---|
37 | }
|
---|
38 | }
|
---|
39 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.