Free cookie consent management tool by TermsFeed Policy Generator

source: addons/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/WallisPi.cs @ 18057

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

#2665 Testet Problems, Testet error functions, Small fixes, Created HL files

File size: 2.2 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Float;
3  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer;
4
5  public class WallisPi : BenchmarkSuiteDataDescriptor {
6    private const string name = "Wallis Pi - Hard";
7    private const string fileName = "WallisPi.csv";
8    private const string description = " John Wallis gave a infinite product that converges to π/4. Given an integer input n, compute an approximation of this product out to n terms. Results are rounded to 5 decimal places.";
9
10    protected override string FileName { get { return fileName; } }
11    public override string Name { get { return name; } }
12    public override string Description { get { return description; } }
13    protected override int InputArgumentCount { get { return 1; } }
14    protected override int OutputArgumentCount { get { return 1; } }
15
16    public override ProblemData CreateProblemData() {
17      return new ProblemData(ProblemType.WallisPi) {
18        Name = Name,
19        Description = Description,
20        ProgramExecutionBudget = 45000000,
21        Examples = CloneExamples(),
22        BestResult = 0,
23        WorstResult = 1000000,
24        InputArgumentTypes = new[] { ExampleArgumentType.Integer },
25        OutputArgumentTypes = new[] { ExampleArgumentType.Float },
26        TrainingCount = 150,
27        TestCount = 50,
28        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Float | DataTypes.Boolean,
29        MaxSize = 600,
30        EvalLimit = 8000,
31        FloatStringFormat = "N5",
32        ErcOptions = {
33          ErcProbability = 0.05,
34          FloatErcOptions = new FloatErcOptions(
35            new FloatRangeErc(-500, 500)),
36          IntegerErcOptions = new IntegerErcOptions(
37            new IntegerRangeErc(-500, 500))
38        }
39      };
40    }
41
42    protected override Example ParseExample(string[] input, string[] output) {
43      return new Example {
44        InputArgs = input,
45        OutputArgs = output,
46        InputInteger = ExampleArgumentConverter.ConvertIntegers(input),
47        OutputFloat = ExampleArgumentConverter.ConvertDoubles(output),
48        OutputFloatPrecision = 5
49      };
50    }
51  }
52}
Note: See TracBrowser for help on using the repository browser.