namespace HeuristicLab.BenchmarkSuite.Problems { using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Char; using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer; using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.String; public class ReplaceSpaceWithNewline : BenchmarkSuiteDataDescriptor { private const string name = "Replace Space with Newline - Medium"; private const string fileName = "ReplaceSpaceWithNewline.csv"; private const string description = " Given a string input, print the string, replacing spaces with newlines.Also, return the integer count of the non- whitespace characters. The input string will not have tabs or newlines."; 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 2; } } public override ProblemData CreateProblemData() { return new ProblemData(ProblemType.ReplaceSpaceWithNewline) { Name = Name, Description = Description, ProgramExecutionBudget = 30000000, Examples = CloneExamples(), BestResult = 0, WorstResult = 5000, InputArgumentTypes = new[] { ExampleArgumentType.String }, OutputArgumentTypes = new[] { ExampleArgumentType.Print, ExampleArgumentType.Integer }, TrainingCount = 100, TestCount = 1000, EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String | DataTypes.Print, MaxSize = 800, EvalLimit = 1600, ErcOptions = { ErcProbability = 0.05, CharErcOptions = new CharErcOptions( new IntegerConstantErc(' ', '\n'), new IntegerRangeErc(0x20, 0x7e)), StringErcOptions = new StringErcOptions( new StringRandomErc { IsEnabled = true, AllowLowercaseLetters = true, AllowUppercaseLetters = false, AllowSpace = true, SpaceProbability = 0.2 }) } }; } protected override Example ParseExample(string[] input, string[] output) { return new Example { InputArgs = input, OutputArgs = output, InputString = input, OutputPrint = output[0], OutputInteger = ExampleArgumentConverter.ConvertIntegers(output[1]), }; } } }