namespace HeuristicLab.BenchmarkSuite.Problems { using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Char; using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer; public class StringDifferences : BenchmarkSuiteDataDescriptor { private const string name = "String Differences"; private const string fileName = "StringDifferences.csv"; private const string description = "Given 2 strings (without whitespace) as input, find the indices at which the strings have different characters, stopping at the end of the shorter one.For each such index, print a line containing the index as well as the character in each string. For example, if the strings are “dealer” and “dollars”, the program should print: 1 e o, 2 a l, 4 e a"; 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 2; } } protected override int OutputArgumentCount { get { return 1; } } public override ProblemData CreateProblemData() { return new ProblemData { Name = Name, Description = Description, Examples = CloneExamples(), BestResult = 0, WorstResult = 100, InputArgumentTypes = new[] { ExampleArgumentType.String, ExampleArgumentType.String }, OutputArgumentTypes = new[] { ExampleArgumentType.Print }, TrainingCount = 200, TestCount = 2000, EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String | DataTypes.Print, MaxSize = 1000, EvalLimit = 2000, ErcOptions = { ErcProbability = 0.05, CharErcOptions = new CharErcOptions( new IntegerConstantErcValue(' ', '\r')), IntegerErcOptions = new IntegerErcOptions( new IntegerRangeErcValue(-10, 10)) } }; } protected override Example ParseExample(string[] input, string[] output) { return new Example { InputArgs = input, OutputArgs = output, InputString = input, OutputPrint = output[0], }; } } }