1 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
2 | public class NumberIO : BenchmarkSuiteDataDescriptor {
|
---|
3 | private const string name = "NumberIO";
|
---|
4 | private const string fileName = "NumberIO.csv";
|
---|
5 | private const string description = "Given an integer and a float, calc their sum.";
|
---|
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 2; } }
|
---|
11 | protected override int OutputArgumentCount { get { return 1; } }
|
---|
12 |
|
---|
13 | public override Data CreateProblemData() {
|
---|
14 | return new Data {
|
---|
15 | Name = Name,
|
---|
16 | Description = Description,
|
---|
17 | Examples = CloneExamples(),
|
---|
18 | BestResult = 0,
|
---|
19 | WorstResult = 400,
|
---|
20 | InputArgumentTypes = new[] { ExampleArgumentType.Float, ExampleArgumentType.Integer },
|
---|
21 | OutputArgumentTypes = new[] { ExampleArgumentType.Float },
|
---|
22 | OriginalTrainingCount = 25,
|
---|
23 | OriginalTestCount = 1000,
|
---|
24 | EnabledDataTypes = DataTypes.Integer | DataTypes.Float,
|
---|
25 | EvalLimit = 200,
|
---|
26 | MaxSize = 200,
|
---|
27 | };
|
---|
28 | }
|
---|
29 |
|
---|
30 | protected override Example ParseExample(string[] input, string[] output) {
|
---|
31 | return new Example {
|
---|
32 | InputArgs = input,
|
---|
33 | OutputArgs = output,
|
---|
34 | InputFloat = ExampleArgumentConverter.ConvertDoubles(input[0]),
|
---|
35 | InputInt = ExampleArgumentConverter.ConvertIntegers(input[1]),
|
---|
36 | OutputFloat = ExampleArgumentConverter.ConvertDoubles(output[0])
|
---|
37 | };
|
---|
38 | }
|
---|
39 | }
|
---|
40 | }
|
---|
41 |
|
---|