Changeset 14228 for trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Nguyen/NguyenInstanceProvider.cs
- Timestamp:
- 08/02/16 18:09:47 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Nguyen/NguyenInstanceProvider.cs
r14185 r14228 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Random; 24 25 25 26 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 37 38 get { return "McDermott et al., 2012 \"Genetic Programming Needs Better Benchmarks\", in Proc. of GECCO 2012."; } 38 39 } 40 public int Seed { get; } 41 42 public NguyenInstanceProvider() : this((int)System.DateTime.Now.Ticks) { } 43 public NguyenInstanceProvider(int seed) : base() { 44 Seed = seed; 45 } 39 46 40 47 public override IEnumerable<IDataDescriptor> GetDataDescriptors() { 41 48 List<IDataDescriptor> descriptorList = new List<IDataDescriptor>(); 42 descriptorList.Add(new NguyenFunctionOne()); 43 descriptorList.Add(new NguyenFunctionTwo()); 44 descriptorList.Add(new NguyenFunctionThree()); 45 descriptorList.Add(new NguyenFunctionFour()); 46 descriptorList.Add(new NguyenFunctionFive()); 47 descriptorList.Add(new NguyenFunctionSix()); 48 descriptorList.Add(new NguyenFunctionSeven()); 49 descriptorList.Add(new NguyenFunctionEight()); 50 descriptorList.Add(new NguyenFunctionNine()); 51 descriptorList.Add(new NguyenFunctionTen()); 52 descriptorList.Add(new NguyenFunctionEleven()); 53 descriptorList.Add(new NguyenFunctionTwelve()); 49 var rand = new MersenneTwister((uint)Seed); 50 descriptorList.Add(new NguyenFunctionOne(rand.Next())); 51 descriptorList.Add(new NguyenFunctionTwo(rand.Next())); 52 descriptorList.Add(new NguyenFunctionThree(rand.Next())); 53 descriptorList.Add(new NguyenFunctionFour(rand.Next())); 54 descriptorList.Add(new NguyenFunctionFive(rand.Next())); 55 descriptorList.Add(new NguyenFunctionSix(rand.Next())); 56 descriptorList.Add(new NguyenFunctionSeven(rand.Next())); 57 descriptorList.Add(new NguyenFunctionEight(rand.Next())); 58 descriptorList.Add(new NguyenFunctionNine(rand.Next())); 59 descriptorList.Add(new NguyenFunctionTen(rand.Next())); 60 descriptorList.Add(new NguyenFunctionEleven(rand.Next())); 61 descriptorList.Add(new NguyenFunctionTwelve(rand.Next())); 54 62 return descriptorList; 55 63 }
Note: See TracChangeset
for help on using the changeset viewer.