Changeset 14228 for trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Various/SpatialCoevolution.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/SpatialCoevolution.cs
r14185 r14228 24 24 using System.Linq; 25 25 using HeuristicLab.Common; 26 using HeuristicLab.Random; 26 27 27 28 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 50 51 protected override int TestPartitionStart { get { return 676; } } 51 52 protected override int TestPartitionEnd { get { return 1676; } } 53 public int Seed { get; } 52 54 55 public SpatialCoevolution() : this((int)DateTime.Now.Ticks) { } 56 57 public SpatialCoevolution(int seed) : base() { 58 Seed = seed; 59 } 53 60 protected override List<List<double>> GenerateValues() { 54 61 List<List<double>> data = new List<List<double>>(); … … 57 64 List<List<double>> trainingData = new List<List<double>>() { evenlySpacedSequence, evenlySpacedSequence }; 58 65 var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(trainingData).ToList(); 66 var rand = new MersenneTwister((uint)Seed); 59 67 60 68 for (int i = 0; i < AllowedInputVariables.Count(); i++) { 61 69 data.Add(combinations[i].ToList()); 62 data[i].AddRange(ValueGenerator.GenerateUniformDistributedValues( 1000, -5, 5).ToList());70 data[i].AddRange(ValueGenerator.GenerateUniformDistributedValues(rand.Next(), 1000, -5, 5).ToList()); 63 71 } 64 72
Note: See TracChangeset
for help on using the changeset viewer.