Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuiteDataDescriptor.cs @ 14392

Last change on this file since 14392 was 14392, checked in by pkimmesw, 8 years ago

#2665 Full Push 3.0 instruction set and tests; Added first benchmark test (count odds) for random walk tests;

File size: 910 bytes
Line 
1using System.Collections.Generic;
2using HeuristicLab.Core;
3using HeuristicLab.Random;
4
5namespace HeuristicLab.BenchmarkSuite
6{
7    public abstract class BenchmarkSuiteDataDescritpor<T> : ArtificialDataDescriptor
8    {
9        protected static IRandom rand = new FastRandom();
10
11        protected abstract IEnumerable<T> GenerateTraining();
12        protected abstract IEnumerable<T> GenerateTest();
13
14        protected abstract IEnumerable<Example> GenerateExamples(IEnumerable<T> trainingAndTest);
15
16        protected override IEnumerable<Example> GenerateExamples()
17        {
18            var training = GenerateTraining();
19
20            training = training.Shuffle(rand);
21
22            var test = GenerateTest();
23
24            var all = new List<T>();
25            all.AddRange(training);
26            all.AddRange(test);
27
28            return GenerateExamples(all);
29        }
30    }
31}
Note: See TracBrowser for help on using the repository browser.