namespace HeuristicLab.BenchmarkSuite.Problems { public class VectorAverage : BenchmarkSuiteDataDescriptor { private const string name = "Vector Average - Medium"; private const string fileName = "VectorAverage.csv"; private const string description = "Given a vector of floats, return the average of those floats. Results are rounded to 4 decimal places."; 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.VectorAverage) { Name = Name, Description = Description, Examples = CloneExamples(), BestResult = 0, WorstResult = 1000, InputArgumentTypes = new[] { ExampleArgumentType.FloatVector }, OutputArgumentTypes = new[] { ExampleArgumentType.Float }, TrainingCount = 100, TestCount = 1000, EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Float | DataTypes.FloatVector, MaxSize = 400, EvalLimit = 800, }; } protected override Example ParseExample(string[] input, string[] output) { return new Example { InputArgs = input, OutputArgs = output, InputFloatVector = new[] { ExampleArgumentConverter.ConvertDoubles(input[0]) }, OutputFloat = ExampleArgumentConverter.ConvertDoubles(output[0]), OutputFloatPrecision = 4 }; } } }