Public Member Functions | |
| def | __init__ |
| def | make_absolute_probs_list |
| def | calc_tables |
| def | random |
| Returns a random integer. | |
Public Attributes | |
| up_bound | |
| overflow | |
Based on the algorithm in Donald Knuth's The Art of Programming, 2ed. V2 3.4.1.A, p.119. See also Exercise 7 (p. 139) and its solution (p. 585) of that section. [#131 #151 #597].
Definition at line 20 of file non_uniform_random_int.py.
| def non_uniform_random_int.NonUniformRandomInt.__init__ | ( | self, | ||
| relative_probs_list | ||||
| ) |
Definition at line 21 of file non_uniform_random_int.py.
| def non_uniform_random_int.NonUniformRandomInt.calc_tables | ( | self, | ||
| probs_list | ||||
| ) |
Definition at line 37 of file non_uniform_random_int.py.
| def non_uniform_random_int.NonUniformRandomInt.make_absolute_probs_list | ( | self, | ||
| relative_probs_list | ||||
| ) |
Definition at line 27 of file non_uniform_random_int.py.
| def non_uniform_random_int.NonUniformRandomInt.random | ( | self | ) |
Returns a random integer.
The range and distribution depends on the parameters with which this class has been constructed.
Definition at line 99 of file non_uniform_random_int.py.
Definition at line 24 of file non_uniform_random_int.py.
Definition at line 23 of file non_uniform_random_int.py.
1.5.8