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 PigLatin : BenchmarkSuiteDataDescriptor { private const string name = "Pig Latin - Hard"; private const string fileName = "PigLatin.csv"; private const string description = "Given a string containing lowercase words separated by single spaces, print the string with each word translated to pig Latin.Specifically, if a word starts with a vowel, it should have“ay”added to its end; otherwise, the first letter is moved to the end of the word, followed by “ay”."; 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 { Name = Name, Description = Description, Examples = CloneExamples(), BestResult = 0, WorstResult = 100, InputArgumentTypes = new[] { ExampleArgumentType.String }, OutputArgumentTypes = new[] { ExampleArgumentType.Print }, TrainingCount = 200, TestCount = 1000, 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 IntegerConstantErc(' ', 'a', 'e', 'i', 'o', 'u'), new IntegerRangeErc(0x20, 0x7e)), StringErcOptions = new StringErcOptions( new StringConstantErc("ay", "aeiou"), 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], }; } } }