1 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
2 | public class XWordLines : BenchmarkSuiteDataDescriptor {
|
---|
3 | private const string name = "X-Word Lines";
|
---|
4 | private const string fileName = "XWordLines.csv";
|
---|
5 | private const string description = "Given an integer X and a string that can contain spaces and newlines, print the string with exactly X words per line.The last line may have fewer than X words.";
|
---|
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 ProblemData CreateProblemData() {
|
---|
14 | return new ProblemData {
|
---|
15 | Name = Name,
|
---|
16 | Description = Description,
|
---|
17 | Examples = CloneExamples(),
|
---|
18 | BestResult = 0,
|
---|
19 | WorstResult = 100,
|
---|
20 | InputArgumentTypes = new[] { ExampleArgumentType.Integer, ExampleArgumentType.String },
|
---|
21 | OutputArgumentTypes = new[] { ExampleArgumentType.String },
|
---|
22 | TrainingCount = 150,
|
---|
23 | TestCount = 2000,
|
---|
24 | EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String,
|
---|
25 | MaxSize = 800,
|
---|
26 | EvalLimit = 1600,
|
---|
27 | ErcOptions = {
|
---|
28 | ErcProbability = 0.05,
|
---|
29 | CharErcOptions = {
|
---|
30 | IsEnabled = true,
|
---|
31 | Constants = new [] { ' ', '\r' }
|
---|
32 | }
|
---|
33 | }
|
---|
34 | };
|
---|
35 | }
|
---|
36 |
|
---|
37 | protected override Example ParseExample(string[] input, string[] output) {
|
---|
38 | return new Example {
|
---|
39 | InputArgs = input,
|
---|
40 | OutputArgs = output,
|
---|
41 | InputInteger = ExampleArgumentConverter.ConvertIntegers(input[0]),
|
---|
42 | InputString = new[] { input[1] },
|
---|
43 | OutputString = output,
|
---|
44 | };
|
---|
45 | }
|
---|
46 | }
|
---|
47 | }
|
---|