Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.ExtLibs/HeuristicLab.SimSharp/3.3.2/SimSharp-3.3.2/Random/PcgRandom.cs

Last change on this file was 18023, checked in by jkarder, 3 years ago

#3065: update Sim# to 3.3.2

File size: 786 bytes
Line 
1#region License Information
2/*
3 * This file is part of SimSharp which is licensed under the MIT license.
4 * See the LICENSE file in the project root for more information.
5 */
6#endregion
7
8namespace SimSharp {
9  public class PcgRandom : IRandom {
10    private Pcg pcg;
11
12    public PcgRandom() {
13      pcg = new Pcg();
14    }
15
16    public PcgRandom(int seed) {
17      pcg = new Pcg(seed);
18    }
19    public int Next() {
20      return pcg.Next();
21    }
22
23    public int Next(int upperBound) {
24      return pcg.Next(upperBound);
25    }
26
27    public int Next(int lowerBound, int upperBound) {
28      return pcg.Next(lowerBound, upperBound);
29    }
30
31    public double NextDouble() {
32      return pcg.NextDouble();
33    }
34
35    public void Reinitialise(int seed) {
36      pcg = new Pcg(seed);
37    }
38  }
39}
Note: See TracBrowser for help on using the repository browser.