Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/Syllables.cs @ 14875

Last change on this file since 14875 was 14875, checked in by pkimmesw, 7 years ago

#2665 BenchmarkSuite, all examples, partially tested, VectorExpressions added

File size: 2.3 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  public class Syllables : BenchmarkSuiteDataDescriptor {
3    private const string name = "Syllables";
4    private const string fileName = "Syllables.csv";
5    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.";
6
7    protected override string FileName { get { return fileName; } }
8    public override string Name { get { return name; } }
9    public override string Description { get { return description; } }
10    protected override int InputArgumentCount { get { return 1; } }
11    protected override int OutputArgumentCount { get { return 1; } }
12
13    public override ProblemData CreateProblemData() {
14      return new ProblemData {
15        Name = Name,
16        Description = Description,
17        Examples = CloneExamples(),
18        BestResult = 0,
19        WorstResult = 100,
20        InputArgumentTypes = new[] { ExampleArgumentType.String },
21        OutputArgumentTypes = new[] { ExampleArgumentType.Integer },
22        TrainingCount = 100,
23        TestCount = 1000,
24        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String,
25        MaxSize = 800,
26        EvalLimit = 1600,
27        ErcOptions = {
28          ErcProbability = 0.05,
29          StringErcOptions = {
30            IsEnabled = true,
31            Constants = new [] { "The number of syllables is ", "aeiouy" },
32            AllowLowercaseLetters = true,
33            AllowUppercaseLetters = false,
34            AllowDigits = true,
35            AllowSymbols = true,
36            AllowSpace = true,
37            SpaceProbability = 0.2,
38            VowelProbability = 0.2
39          },
40          CharErcOptions = {
41            IsEnabled = true,
42            Constants = new [] { 'a', 'e', 'i', 'o', 'u' },
43            Start = 0x20,
44            End = 0x7e
45          }
46        }
47      };
48    }
49
50    protected override Example ParseExample(string[] input, string[] output) {
51      return new Example {
52        InputArgs = input,
53        OutputArgs = output,
54        InputString = input,
55        OutputInteger = ExampleArgumentConverter.ConvertIntegers(output[0]),
56      };
57    }
58  }
59}
Note: See TracBrowser for help on using the repository browser.