Changeset 13233
- Timestamp:
- 11/17/15 19:03:18 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.GrammaticalEvolution/3.4/ArtificialAnt/GEArtificialAntProblem.cs
r12915 r13233 33 33 using HeuristicLab.Problems.GeneticProgramming.ArtificialAnt; 34 34 using HeuristicLab.Problems.GrammaticalEvolution.Mappers; 35 using HeuristicLab.Random; 35 36 36 37 namespace HeuristicLab.Problems.GrammaticalEvolution { … … 106 107 var mapper = GenotypeToPhenotypeMapperParameter.Value; 107 108 108 var tree = mapper.Map(random, bounds, len, grammar, vector); 109 // Evaluate might be called concurrently therefore access to random has to be synchronized. 110 // However, results depend on the order of execution. Therefore, results might be different for the same seed when using the parallel engine. 111 IRandom fastRand; 112 lock (random) { 113 fastRand = new FastRandom(random.Next()); 114 } 115 var tree = mapper.Map(fastRand, bounds, len, grammar, vector); 109 116 110 117 Interpreter interpreter = new Interpreter(tree, World, MaxTimeSteps);
Note: See TracChangeset
for help on using the changeset viewer.