[15771] | 1 | using HeuristicLab.Problems.ProgramSynthesis;
|
---|
[14897] | 2 |
|
---|
[15771] | 3 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
[14875] | 4 | public class PigLatin : BenchmarkSuiteDataDescriptor {
|
---|
[14952] | 5 | private const string name = "Pig Latin - Hard";
|
---|
[14875] | 6 | private const string fileName = "PigLatin.csv";
|
---|
| 7 | 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”.";
|
---|
[14727] | 8 |
|
---|
[14875] | 9 | protected override string FileName { get { return fileName; } }
|
---|
| 10 | public override string Name { get { return name; } }
|
---|
| 11 | public override string Description { get { return description; } }
|
---|
| 12 | protected override int InputArgumentCount { get { return 1; } }
|
---|
| 13 | protected override int OutputArgumentCount { get { return 1; } }
|
---|
[14727] | 14 |
|
---|
[14875] | 15 | public override ProblemData CreateProblemData() {
|
---|
[15017] | 16 | return new ProblemData(ProblemType.PigLatin) {
|
---|
[14875] | 17 | Name = Name,
|
---|
| 18 | Description = Description,
|
---|
[15334] | 19 | ProgramExecutionBudget = 60000000,
|
---|
[14875] | 20 | Examples = CloneExamples(),
|
---|
| 21 | BestResult = 0,
|
---|
[15334] | 22 | WorstResult = 5000,
|
---|
[14875] | 23 | InputArgumentTypes = new[] { ExampleArgumentType.String },
|
---|
[14909] | 24 | OutputArgumentTypes = new[] { ExampleArgumentType.Print },
|
---|
[14875] | 25 | TrainingCount = 200,
|
---|
| 26 | TestCount = 1000,
|
---|
[14897] | 27 | EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String | DataTypes.Print,
|
---|
[14875] | 28 | MaxSize = 1000,
|
---|
| 29 | EvalLimit = 2000,
|
---|
| 30 | ErcOptions = {
|
---|
| 31 | ErcProbability = 0.05,
|
---|
[14897] | 32 | CharErcOptions = new CharErcOptions(
|
---|
[14952] | 33 | new IntegerConstantErc(' ', 'a', 'e', 'i', 'o', 'u'),
|
---|
| 34 | new IntegerRangeErc(0x20, 0x7e)),
|
---|
[14897] | 35 | StringErcOptions = new StringErcOptions(
|
---|
[14952] | 36 | new StringConstantErc("ay", "aeiou"),
|
---|
| 37 | new StringRandomErc {
|
---|
[14897] | 38 | IsEnabled = true,
|
---|
| 39 | AllowLowercaseLetters = true,
|
---|
| 40 | AllowUppercaseLetters = false,
|
---|
| 41 | AllowSpace = true,
|
---|
| 42 | SpaceProbability = 0.2,
|
---|
| 43 | })
|
---|
[14875] | 44 | }
|
---|
| 45 | };
|
---|
| 46 | }
|
---|
[14727] | 47 |
|
---|
[14875] | 48 | protected override Example ParseExample(string[] input, string[] output) {
|
---|
| 49 | return new Example {
|
---|
| 50 | InputArgs = input,
|
---|
| 51 | OutputArgs = output,
|
---|
| 52 | InputString = input,
|
---|
[14897] | 53 | OutputPrint = output[0],
|
---|
[14875] | 54 | };
|
---|
| 55 | }
|
---|
| 56 | }
|
---|
| 57 | }
|
---|