Changeset 10974 for branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Mappers/PIGEMapper.cs
- Timestamp:
- 06/11/14 12:07:15 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Mappers/PIGEMapper.cs
r10968 r10974 71 71 public class PIGEMapper : GenotypeToPhenotypeMapper { 72 72 73 private object nontVectorLocker = new object(); 73 74 private IntegerVector nontVector; 74 75 … … 78 79 } 79 80 80 private IntegerVector GetNontVector(IRandom random, IntMatrix bounds, int length) {81 private static IntegerVector GetNontVector(IRandom random, IntMatrix bounds, int length) { 81 82 IntegerVector v = new IntegerVector(length); 82 83 v.Randomize(random, bounds); … … 114 115 tree.Root = rootNode; 115 116 116 if (NontVector == null) { 117 NontVector = GetNontVector(random, bounds, length); 117 // Map can be called simultaniously on multiple threads 118 lock (nontVectorLocker) { 119 if (NontVector == null) { 120 NontVector = GetNontVector(random, bounds, length); 121 } 118 122 } 119 123
Note: See TracChangeset
for help on using the changeset viewer.