Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13243


Ignore:
Timestamp:
11/18/15 12:00:10 (9 years ago)
Author:
mkommend
Message:

#2512: Introduced syncRoot for synchronizing access to the random object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.GrammaticalEvolution/3.4/ArtificialAnt/GEArtificialAntProblem.cs

    r13238 r13243  
    2222#endregion
    2323
    24 using System.Diagnostics.Contracts;
    2524using System.Linq;
    2625using HeuristicLab.Common;
     
    9998    }
    10099
     100    private readonly object syncRoot = new object();
    101101    public override double Evaluate(Individual individual, IRandom random) {
    102102      var vector = individual.IntegerVector();
     
    110110      // However, results depend on the order of execution. Therefore, results might be different for the same seed when using the parallel engine.
    111111      IRandom fastRand;
    112       lock (random) {
     112      lock (syncRoot) {
    113113        fastRand = new FastRandom(random.Next());
    114114      }
Note: See TracChangeset for help on using the changeset viewer.