Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/20/16 22:57:11 (7 years ago)
Author:
pkimmesw
Message:

#2665 Added Problem.ProgramSynthesis Project, Fixed Expression Issues, Fixed Code Generation

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;
     1namespace HeuristicLab.Algorithms.PushGP.Generators {
     2  using System.Threading;
    33
    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;
    96
    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;
    1412    }
     13  }
    1514}
Note: See TracChangeset for help on using the changeset viewer.