Changeset 14513 for branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Generators/BooleanGenerator.cs
- Timestamp:
- 12/20/16 22:57:11 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Generators/BooleanGenerator.cs
r14392 r14513 1 using HeuristicLab.Core;2 using HeuristicLab.Random;1 namespace HeuristicLab.Algorithms.PushGP.Generators { 2 using System.Threading; 3 3 4 namespace HeuristicLab.Algorithms.PushGP.Generators 5 { 6 public static class BooleanGenerator 7 { 8 private static IRandom rand = new FastRandom(); 4 using HeuristicLab.Algorithms.PushGP.Data.Random; 5 using HeuristicLab.Core; 9 6 10 public static bool RandomBoolean() 11 { 12 return rand.NextDouble() > 0.5 ? true : false; 13 } 7 public static class BooleanGenerator { 8 private static readonly ThreadLocal<IRandom> rand = RandomFactory.GetRandom(); 9 10 public static bool RandomBoolean() { 11 return rand.Value.NextDouble() > 0.5; 14 12 } 13 } 15 14 }
Note: See TracChangeset
for help on using the changeset viewer.