namespace HeuristicLab.BenchmarkSuite.Problems { using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer; public class CollatzNumbers : BenchmarkSuiteDataDescriptor { private const string name = "Collatz Numbers - Hard"; private const string fileName = "CollatzNumbers.csv"; private const string description = "Given an integer, find the number of terms in the Collatz(hailstone) sequence starting from that integer."; protected override string FileName { get { return fileName; } } public override string Name { get { return name; } } public override string Description { get { return description; } } protected override int InputArgumentCount { get { return 1; } } protected override int OutputArgumentCount { get { return 1; } } public override ProblemData CreateProblemData() { return new ProblemData(ProblemType.CollatzNumbers) { Name = Name, Description = Description, ProgramExecutionBudget = 60000000, Examples = CloneExamples(), BestResult = 0, WorstResult = 1000000, InputArgumentTypes = new[] { ExampleArgumentType.Integer }, OutputArgumentTypes = new[] { ExampleArgumentType.Integer }, TrainingCount = 200, TestCount = 2000, EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Float | DataTypes.Boolean, MaxSize = 600, EvalLimit = 15000, ErcOptions = { ErcProbability = 0.05, IntegerErcOptions = new IntegerErcOptions( new IntegerConstantErc(0, 1), new IntegerRangeErc(-100, 100)) } }; } protected override Example ParseExample(string[] input, string[] output) { return new Example { InputArgs = input, OutputArgs = output, InputInteger = ExampleArgumentConverter.ConvertIntegers(input[0]), OutputInteger = ExampleArgumentConverter.ConvertIntegers(output[0]), }; } } }