Changeset 14228 for trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Various/BreimanOne.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/Various/BreimanOne.cs
r14185 r14228 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Random; 26 27 … … 43 44 protected override int TestPartitionEnd { get { return 10001; } } 44 45 45 protected static FastRandom rand = new FastRandom(); 46 public int Seed { get; } 47 48 public BreimanOne() : this((int)DateTime.Now.Ticks) { } 49 public BreimanOne(int seed) : base() { 50 Seed = seed; 51 } 46 52 47 53 protected override List<List<double>> GenerateValues() { 48 54 List<List<double>> data = new List<List<double>>(); 49 55 List<int> values = new List<int>() { -1, 1 }; 50 data.Add(GenerateUniformIntegerDistribution(values, TestPartitionEnd)); 56 var rand = new MersenneTwister((uint)Seed); 57 data.Add(GenerateUniformIntegerDistribution(rand, values, TestPartitionEnd)); 51 58 values.Add(0); 52 59 for (int i = 0; i < AllowedInputVariables.Count() - 1; i++) { 53 data.Add(GenerateUniformIntegerDistribution( values, TestPartitionEnd));60 data.Add(GenerateUniformIntegerDistribution(rand, values, TestPartitionEnd)); 54 61 } 55 56 62 double x1, x2, x3, x4, x5, x6, x7; 57 63 double f; … … 79 85 } 80 86 81 private List<double> GenerateUniformIntegerDistribution( List<int> classes, int amount) {87 private List<double> GenerateUniformIntegerDistribution(IRandom rand, List<int> classes, int amount) { 82 88 List<double> values = new List<double>(); 83 89 for (int i = 0; i < amount; i++) {
Note: See TracChangeset
for help on using the changeset viewer.