1 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
2 | public class ForLoopIndex : BenchmarkSuiteDataDescriptor {
|
---|
3 | private const string name = "For Loop Index - Hard";
|
---|
4 | private const string fileName = "ForLoopIndex.csv";
|
---|
5 | private const string description = "Given 3 integer inputs start,end, and step, print the integers in the sequence n|0 = start, n|i = n|i−1 + step for each n|i < end, each on their own line.";
|
---|
6 |
|
---|
7 | protected override string FileName { get { return fileName; } }
|
---|
8 |
|
---|
9 | public override string Name { get { return name; } }
|
---|
10 |
|
---|
11 | public override string Description { get { return description; } }
|
---|
12 |
|
---|
13 | protected override int InputArgumentCount { get { return 3; } }
|
---|
14 |
|
---|
15 | protected override int OutputArgumentCount { get { return 1; } }
|
---|
16 |
|
---|
17 | public override ProblemData CreateProblemData() {
|
---|
18 | return new ProblemData(ProblemType.ForLoopIndex) {
|
---|
19 | Name = Name,
|
---|
20 | Description = Description,
|
---|
21 | Examples = CloneExamples(),
|
---|
22 | BestResult = 0,
|
---|
23 | WorstResult = 1000,
|
---|
24 | InputArgumentTypes = new[] { ExampleArgumentType.Integer, ExampleArgumentType.Integer, ExampleArgumentType.Integer },
|
---|
25 | OutputArgumentTypes = new[] { ExampleArgumentType.Print },
|
---|
26 | TrainingCount = 100,
|
---|
27 | TestCount = 1000,
|
---|
28 | EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.String | DataTypes.Print,
|
---|
29 | MaxSize = 300,
|
---|
30 | EvalLimit = 600,
|
---|
31 | };
|
---|
32 | }
|
---|
33 |
|
---|
34 | protected override Example ParseExample(string[] input, string[] output) {
|
---|
35 | return new Example {
|
---|
36 | InputArgs = input,
|
---|
37 | OutputArgs = output,
|
---|
38 | InputInteger = ExampleArgumentConverter.ConvertIntegers(input),
|
---|
39 | OutputPrint = output[0]
|
---|
40 | };
|
---|
41 | }
|
---|
42 | }
|
---|
43 | }
|
---|