Changeset 16835


Ignore:
Timestamp:
04/19/19 09:46:00 (4 months ago)
Author:
gkronber
Message:

#2933: merged r16071 and r16661 from trunk to stable

Location:
stable
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r15584 r16835  
    301301        if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused))
    302302          throw new InvalidOperationException(string.Format("Start not allowed in execution state \"{0}\".", ExecutionState));
    303         seed = new FastRandom().NextInt();
     303        seed = RandomSeedGenerator.GetSeed();
    304304
    305305        if (Algorithm == null) return;
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs

    r16124 r16835  
    210210    protected override void Run(CancellationToken cancellationToken) {
    211211      // Set up the algorithm
    212       if (SetSeedRandomly) Seed = new System.Random().Next();
     212      if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
    213213      var rand = new MersenneTwister((uint)Seed);
    214214
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs

    r15584 r16835  
    187187    protected override void Run(CancellationToken cancellationToken) {
    188188      // Set up the algorithm
    189       if (SetSeedRandomly) Seed = new System.Random().Next();
     189      if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed();
    190190
    191191      // Set up the results display
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs

    r15584 r16835  
    186186        qualityTable.Rows.Add(testRMSERow);
    187187        Results.Add(new Result(qualityTable.Name, qualityTable.Name + " for all restarts", qualityTable));
    188         if (SetSeedRandomly) Seed = (new System.Random()).Next();
     188        if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
    189189        var rand = new MersenneTwister((uint)Seed);
    190190        bestSolution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling, rand);
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs

    r15584 r16835  
    135135    protected override void Run(CancellationToken cancellationToken) {
    136136      double rmsError, relClassificationError, outOfBagRmsError, outOfBagRelClassificationError;
    137       if (SetSeedRandomly) Seed = new System.Random().Next();
     137      if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed();
    138138
    139139      var model = CreateRandomForestClassificationModel(Problem.ProblemData, NumberOfTrees, R, M, Seed, out rmsError, out relClassificationError, out outOfBagRmsError, out outOfBagRelClassificationError);
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs

    r15584 r16835  
    134134    protected override void Run(CancellationToken cancellationToken) {
    135135      double rmsError, avgRelError, outOfBagRmsError, outOfBagAvgRelError;
    136       if (SetSeedRandomly) Seed = new System.Random().Next();
     136      if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed();
    137137      var model = CreateRandomForestRegressionModel(Problem.ProblemData, NumberOfTrees, R, M, Seed,
    138138        out rmsError, out avgRelError, out outOfBagRmsError, out outOfBagAvgRelError);
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs

    r15584 r16835  
    275275      if (wdist != null) wdist.Initialize(problemData);
    276276      if (state == null) {
    277         if (SetSeedRandomly) Seed = new System.Random().Next();
     277        if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
    278278        var random = new MersenneTwister((uint)Seed);
    279279        var dataset = problemData.Dataset;
  • stable/HeuristicLab.Algorithms.MOCMAEvolutionStrategy/3.3/MOCMAEvolutionStrategy.cs

    r15584 r16835  
    285285    #region Initialization
    286286    protected override void Initialize(CancellationToken cancellationToken) {
    287       if (SetSeedRandomly) Seed = new System.Random().Next();
     287      if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
    288288      random.Reset(Seed);
    289289      gauss = new NormalDistributedRandom(random, 0, 1);
  • stable/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs

    r15584 r16835  
    231231    protected override void Initialize(CancellationToken cancellationToken) {
    232232      // Set up the algorithm
    233       if (SetSeedRandomly) Seed = new System.Random().Next();
     233      if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
    234234      pyramid = new List<Population>();
    235235      seen.Clear();
  • stable/HeuristicLab.Random/3.3/HeuristicLab.Random-3.3.csproj

    r14868 r16835  
    120120    <Compile Include="GammaDistributedRandom.cs" />
    121121    <Compile Include="ListExtensions.cs" />
     122    <Compile Include="RandomSeedGenerator.cs" />
    122123    <Compile Include="UniformDistributedRandom.cs" />
    123124    <Compile Include="FastRandom.cs" />
  • stable/HeuristicLab.Random/3.3/RandomCreator.cs

    r15584 r16835  
    9494      IntValue seed = SeedParameter.ActualValue;
    9595
    96       if (setSeedRandomly) seed.Value = new System.Random().Next();
     96      if (setSeedRandomly) seed.Value = RandomSeedGenerator.GetSeed();
    9797      IRandom random = (IRandom)RandomType.Clone();
    9898      random.Reset(seed.Value);
Note: See TracChangeset for help on using the changeset viewer.