[15771] | 1 | using HeuristicLab.Problems.ProgramSynthesis;
|
---|
[14897] | 2 |
|
---|
[15771] | 3 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
[14875] | 4 | public class SmallOrLarge : BenchmarkSuiteDataDescriptor {
|
---|
[14952] | 5 | private const string name = "Small or Large - Hard";
|
---|
[14875] | 6 | private const string fileName = "SmallOrLarge.csv";
|
---|
| 7 | private const string description =
|
---|
| 8 | "Given an integer n, print “small” if n < 1000 and “large” if n ≥ 2000 (and nothing if 1000 ≤ n < 2000).";
|
---|
| 9 |
|
---|
| 10 | protected override string FileName { get { return fileName; } }
|
---|
| 11 | public override string Name { get { return name; } }
|
---|
| 12 | public override string Description { get { return description; } }
|
---|
| 13 | protected override int InputArgumentCount { get { return 1; } }
|
---|
| 14 | protected override int OutputArgumentCount { get { return 1; } }
|
---|
| 15 |
|
---|
| 16 | public override ProblemData CreateProblemData() {
|
---|
[15017] | 17 | return new ProblemData(ProblemType.SmallOrLarge) {
|
---|
[14875] | 18 | Name = Name,
|
---|
| 19 | Description = Description,
|
---|
[15334] | 20 | ProgramExecutionBudget = 30000000,
|
---|
[14875] | 21 | Examples = CloneExamples(),
|
---|
| 22 | BestResult = 0,
|
---|
[15334] | 23 | WorstResult = 5000,
|
---|
[14875] | 24 | InputArgumentTypes = new[] { ExampleArgumentType.Integer },
|
---|
[15017] | 25 | OutputArgumentTypes = new[] { ExampleArgumentType.Print },
|
---|
[14875] | 26 | TrainingCount = 100,
|
---|
| 27 | TestCount = 1000,
|
---|
[14897] | 28 | EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.String | DataTypes.Print,
|
---|
[14875] | 29 | MaxSize = 200,
|
---|
| 30 | EvalLimit = 300,
|
---|
| 31 | ErcOptions = {
|
---|
| 32 | ErcProbability = 0.05,
|
---|
[14897] | 33 | IntegerErcOptions = new IntegerErcOptions(
|
---|
[14952] | 34 | new IntegerRangeErc(-10000, 10000)),
|
---|
[14897] | 35 | StringErcOptions = new StringErcOptions(
|
---|
[14952] | 36 | new StringConstantErc("small", "large"))
|
---|
[14875] | 37 | }
|
---|
| 38 | };
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | protected override Example ParseExample(string[] input, string[] output) {
|
---|
| 42 | return new Example {
|
---|
| 43 | InputArgs = input,
|
---|
| 44 | OutputArgs = output,
|
---|
| 45 | InputInteger = ExampleArgumentConverter.ConvertIntegers(input[0]),
|
---|
[15017] | 46 | OutputPrint = output[0]
|
---|
[14875] | 47 | };
|
---|
| 48 | }
|
---|
| 49 | }
|
---|
| 50 | }
|
---|