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/Nguyen/NguyenInstanceProvider.cs

    r14186 r14305  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Random;
    2425
    2526namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    3738      get { return "McDermott et al., 2012 \"Genetic Programming Needs Better Benchmarks\", in Proc. of GECCO 2012."; }
    3839    }
     40    public int Seed { get; private set; }
     41
     42    public NguyenInstanceProvider() : this((int)System.DateTime.Now.Ticks) { }
     43    public NguyenInstanceProvider(int seed) : base() {
     44      Seed = seed;
     45    }
    3946
    4047    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
    4148      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()));
    5462      return descriptorList;
    5563    }
Note: See TracChangeset for help on using the changeset viewer.