namespace HeuristicLab.BenchmarkSuite.Problems { using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer; public class CountOdds : BenchmarkSuiteDataDescriptor { private const string name = "Count Odds - Hard"; private const string fileName = "CountOdds.csv"; private const string description = "Given a vector of integers, return the number of integers that are odd, without use of a specific even or odd instruction(but allowing instructions such as mod and quotient)"; 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.CountOdds) { Name = Name, Description = Description, ProgramExecutionBudget = 60000000, Examples = CloneExamples(), BestResult = 0, WorstResult = 1000, InputArgumentTypes = new[] { ExampleArgumentType.IntegerVector }, OutputArgumentTypes = new[] { ExampleArgumentType.Integer }, TestCount = 2000, TrainingCount = 200, EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.IntegerVector, MaxSize = 500, EvalLimit = 1500, ErcOptions = { ErcProbability = 0.05, IntegerErcOptions = new IntegerErcOptions( new IntegerConstantErc(0, 1, 2), new IntegerRangeErc(-1000, 1000)), } }; } protected override Example ParseExample(string[] input, string[] output) { return new Example { InputArgs = input, OutputArgs = output, InputIntegerVector = new[] { ExampleArgumentConverter.ConvertIntegers(input[0]) }, OutputInteger = ExampleArgumentConverter.ConvertIntegers(output[0]) }; } } }