[14875] | 1 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
[14897] | 2 | using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Char;
|
---|
| 3 | using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer;
|
---|
| 4 | using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.String;
|
---|
| 5 |
|
---|
[14875] | 6 | public class Syllables : BenchmarkSuiteDataDescriptor {
|
---|
[14952] | 7 | private const string name = "Syllables - Hard";
|
---|
[14875] | 8 | private const string fileName = "Syllables.csv";
|
---|
| 9 | private const string description = "Given a string containing symbols, spaces, digits, and lowercase letters, count the number of occurrences of vowels(a, e, i, o, u, y) in the string and print that number as X in The number of syllables is X.";
|
---|
| 10 |
|
---|
| 11 | protected override string FileName { get { return fileName; } }
|
---|
| 12 | public override string Name { get { return name; } }
|
---|
| 13 | public override string Description { get { return description; } }
|
---|
| 14 | protected override int InputArgumentCount { get { return 1; } }
|
---|
| 15 | protected override int OutputArgumentCount { get { return 1; } }
|
---|
| 16 |
|
---|
| 17 | public override ProblemData CreateProblemData() {
|
---|
[15017] | 18 | return new ProblemData(ProblemType.Syllables) {
|
---|
[14875] | 19 | Name = Name,
|
---|
| 20 | Description = Description,
|
---|
| 21 | Examples = CloneExamples(),
|
---|
| 22 | BestResult = 0,
|
---|
| 23 | WorstResult = 100,
|
---|
| 24 | InputArgumentTypes = new[] { ExampleArgumentType.String },
|
---|
[14909] | 25 | OutputArgumentTypes = new[] { ExampleArgumentType.Print },
|
---|
[14875] | 26 | TrainingCount = 100,
|
---|
| 27 | TestCount = 1000,
|
---|
[15017] | 28 | EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String | DataTypes.Print,
|
---|
[14875] | 29 | MaxSize = 800,
|
---|
| 30 | EvalLimit = 1600,
|
---|
| 31 | ErcOptions = {
|
---|
| 32 | ErcProbability = 0.05,
|
---|
[14897] | 33 | StringErcOptions = new StringErcOptions(
|
---|
[14952] | 34 | new StringConstantErc("The number of syllables is ", "aeiouy" ),
|
---|
| 35 | new StringRandomErc {
|
---|
[14897] | 36 | AllowLowercaseLetters = true,
|
---|
| 37 | AllowUppercaseLetters = false,
|
---|
| 38 | AllowDigits = true,
|
---|
| 39 | AllowSymbols = true,
|
---|
| 40 | AllowSpace = true,
|
---|
| 41 | SpaceProbability = 0.2,
|
---|
| 42 | VowelProbability = 0.2
|
---|
| 43 | }),
|
---|
| 44 | CharErcOptions = new CharErcOptions (
|
---|
[14952] | 45 | new IntegerConstantErc('a', 'e', 'i', 'o', 'u'),
|
---|
| 46 | new IntegerRangeErc(0x20, 0x7e))
|
---|
[14875] | 47 | }
|
---|
| 48 | };
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | protected override Example ParseExample(string[] input, string[] output) {
|
---|
| 52 | return new Example {
|
---|
| 53 | InputArgs = input,
|
---|
| 54 | OutputArgs = output,
|
---|
| 55 | InputString = input,
|
---|
[14897] | 56 | OutputPrint = output[0],
|
---|
[14875] | 57 | };
|
---|
| 58 | }
|
---|
| 59 | }
|
---|
| 60 | }
|
---|