using HeuristicLab.Problems.ProgramSynthesis; namespace HeuristicLab.BenchmarkSuite.Problems { public class StringLengthsBackwards : BenchmarkSuiteDataDescriptor { private const string name = "String Length Backwards - Medium"; private const string fileName = "StringLengthsBackwards.csv"; private const string description = "Given a vector of strings, print the length of each string in the vector starting with the last and ending with the first."; 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(ProblemType.StringLengthsBackwards) { Name = Name, Description = Description, ProgramExecutionBudget = 30000000, Examples = CloneExamples(), BestResult = 0, WorstResult = 5000, InputArgumentTypes = new[] { ExampleArgumentType.StringVector }, OutputArgumentTypes = new[] { ExampleArgumentType.Print }, TrainingCount = 100, TestCount = 1000, EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.String | DataTypes.StringVector | DataTypes.Print, MaxSize = 300, EvalLimit = 600, ErcOptions = { ErcProbability = 0.05, IntegerErcOptions = new IntegerErcOptions( new IntegerRangeErc(-100, 100)) } }; } protected override Example ParseExample(string[] input, string[] output) { return new Example { InputArgs = input, OutputArgs = output, InputStringVector = new[] { ExampleArgumentConverter.ConvertStringVector(input[0]) }, OutputPrint = output[0], }; } } }