![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
The uniform source, MATLAB's rand. More...
#include <line/solvers/ssa/ssa_types.h>
Public Member Functions | |
| SsaRng (unsigned long seed) | |
| double | uniform () |
| std::size_t | index (std::size_t n) |
| Uniform index in [0, n), the reference's 1 + floor(rand*n). | |
| std::size_t | draw (const std::vector< double > &p) |
| Index drawn from the unnormalized nonnegative weights p, the reference's drawFromDist: an all-zero weight vector yields index 0. | |
The uniform source, MATLAB's rand.
A 53-bit uniform assembled from two MT19937 words, the construction numpy and the JAR's RandomManager both use, shifted by half an ulp so the value is strictly inside (0,1). The shift is not cosmetic: -log(u) is the exponential clock of every reaction and an exact zero would make it infinite, which the run loop reads as a deadlock.
Definition at line 129 of file ssa_types.h.
|
inlineexplicit |
Definition at line 131 of file ssa_types.h.
|
inline |
Index drawn from the unnormalized nonnegative weights p, the reference's drawFromDist: an all-zero weight vector yields index 0.
Definition at line 150 of file ssa_types.h.
References uniform().
|
inline |
Uniform index in [0, n), the reference's 1 + floor(rand*n).
Definition at line 140 of file ssa_types.h.
References uniform().
|
inline |
Definition at line 133 of file ssa_types.h.