Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/23/16 12:57:27 (8 years ago)
Author:
gkronber
Message:

#2371: merged r14228, r14229 from trunk to stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.Instances.DataAnalysis

  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/RationalPolynomialTwoDimensional.cs

    r14186 r14305  
    2424using System.Linq;
    2525using HeuristicLab.Common;
     26using HeuristicLab.Random;
    2627
    2728namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4748    protected override int TestPartitionEnd { get { return 50 + (34 * 34); } }
    4849
     50    public int Seed { get; private set; }
     51
     52    public RationalPolynomialTwoDimensional() : this((int)DateTime.Now.Ticks) { }
     53
     54    public RationalPolynomialTwoDimensional(int seed) : base() {
     55      Seed = seed;
     56    }
    4957    protected override List<List<double>> GenerateValues() {
    5058      List<List<double>> data = new List<List<double>>();
     
    5462      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5563      var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList<IEnumerable<double>>();
     64      var rand = new MersenneTwister((uint)Seed);
    5665
    5766      for (int i = 0; i < AllowedInputVariables.Count(); i++) {
    58         data.Add(ValueGenerator.GenerateUniformDistributedValues(50, 0.05, 6.05).ToList());
     67        data.Add(ValueGenerator.GenerateUniformDistributedValues(rand.Next(), 50, 0.05, 6.05).ToList());
    5968        data[i].AddRange(combinations[i]);
    6069      }
Note: See TracChangeset for help on using the changeset viewer.