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 Checksum : BenchmarkSuiteDataDescriptor { private const string name = "Checksum - Hard"; private const string fileName = "Checksum.csv"; private const string description = "Given a string, convert each character in the string into its integer ASCII value, sum them, take the sum modulo 64, add the integer value of the space character, and then convert that integer back into its corresponding character(the checksum character). The program must print Check sum is X, where X is replaced by the correct checksum character."; 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.Checksum) { Name = Name, Description = Description, ProgramExecutionBudget = 30000000, Examples = CloneExamples(), BestResult = 0, WorstResult = 1000, InputArgumentTypes = new[] { ExampleArgumentType.String }, OutputArgumentTypes = new[] { ExampleArgumentType.Print }, TrainingCount = 100, TestCount = 1000, EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String | DataTypes.Print, MaxSize = 800, EvalLimit = 1500, ErcOptions = { ErcProbability = 0.05, IntegerErcOptions = new IntegerErcOptions( new IntegerConstantErc(64), new IntegerRangeErc(-128, 128)), CharErcOptions = new CharErcOptions( new IntegerConstantErc(' '), new IntegerRangeErc(0x20, 0x7e)), StringErcOptions = new StringErcOptions( new StringConstantErc("Check sum is ")) } }; } protected override Example ParseExample(string[] input, string[] output) { return new Example { InputArgs = input, OutputArgs = output, InputString = input, OutputPrint = output[0], }; } } }