Fortuna


NameFortuna JSON
Version 5.5.8 PyPI version JSON
download
home_pagehttps://github.com/BrokenShell/Fortuna
SummaryHigh Performance Random Value Toolkit
upload_time2024-06-23 17:52:30
maintainerNone
docs_urlNone
authorRobert Sharp
requires_python>=3.7
licenseFree for non-commercial use
keywords fortuna high performance random value toolkit random patterns data perturbation game dice weightedchoice random value generator gaussian distribution linear distribution truffleshuffle flexcat percent true zerocool quantummonty custom distribution rarity table d20 generative modeling multithreading aware random engine bernoulli binomial negative_binomial geometric poisson lognormal exponential gamma weibull extreme_value chi_squared cauchy fisher_f student_t pareto vonmises triangular
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fortuna: Generative Modeling Toolkit for Python3
© 2024 Robert Sharp, all rights reserved.

Fortuna's main goal is to provide a quick and easy way to build custom random 
functions for your data that are byte-code fast and thread aware. Fortuna also 
offers a variety of high-performance random number functions like 
`random_range(start, stop, step)` and `dice(rolls, sides)`.

The core functionality of Fortuna (the Storm Engine) was created 
by the same developer - Robert Sharp. While Storm is a high quality, hardware 
seeded random engine - it is not appropriate for cryptography of any kind. 
Fortuna is intended for games, data science, Generative A.I. and experimental 
programming... not security, hashing or gambling! Fortuna is free for 
non-commercial use. Contact the developer for details about commercial licensing 
and current availability of FortunaPro.

### Quick Install `$ pip install Fortuna`

### Installation Notes:
- Fortuna is optimized for macOS & Linux.
- New in version 5, Fortuna now supports Windows.
- Installation requires C++20 Compiler and C++20 Standard Library.
- On Linux, Fortuna requires Python3 developer environment.

### Installation Examples:
- macOS & Windows
  - `pip install Fortuna`
- Linux & WSL: Debian (you may need sudo)
  - `apt update`
  - `apt upgrade`
  - `apt install build-essential`
  - `apt install python3-dev python3-pip`
  - Optionally Make a Virtual Environment
    - `apt install python3.11-venv`
    - `python3 -m venv venv`
    - `source venv/bin/activate`
  - `pip install --upgrade pip setuptools wheel`
  - `pip install Fortuna`


### Sister Projects:
- [MonkeyScope](https://pypi.org/project/MonkeyScope): Framework for testing non-deterministic components.
- [Storm](https://github.com/BrokenShell/Storm): High Performance C++ Random Number Engine & Toolkit.


---

### Table of Contents:
- Numeric Limits
    - `Storm::Metrics`
- Random Value Classes
    - `RandomValue(Iterable[Any]) -> Callable -> Any`
    - `TruffleShuffle(Iterable[Any]) -> Callable -> Any`
    - `QuantumMonty(Iterable[Any]) -> Callable -> Any`
    - `CumulativeWeightedChoice(Iterable[Tuple[int, Any]]) -> Callable -> Any`
    - `RelativeWeightedChoice(Iterable[Tuple[int, Any]]) -> Callable -> Any`
    - `FlexCat(Dict[str, Iterable[Any]]) -> Callable -> Any`
- Random Value Functions
    - `random_value(data: Sequence[Any]) -> Any`
    - `cumulative_weighted_choice(Sequence[Tuple[int, Any]]) -> Any`
    - `truffle_shuffle(data: Iterable[Any]) -> Callable -> Any`
- Random Integer Functions
    - `random_below(Integer) -> Integer`
    - `random_int(Integer, Integer) -> Integer`
    - `random_range(Integer, Integer, Integer) -> Integer`
    - `d(Integer) -> Integer`
    - `dice(Integer, Integer) -> Integer`
    - `plus_or_minus(Integer) -> Integer`
    - `plus_or_minus_linear(Integer) -> Integer`
    - `plus_or_minus_gauss(Integer) -> Integer`
    - `binomial_variate(Integer, Float) -> Integer`
    - `negative_binomial_variate(Integer, Float) -> Integer`
    - `geometric_variate(Float) -> Integer`
    - `poisson_variate(Float) -> Integer`
- Random Index Functions 
    - ZeroCool Specification: `f(N) -> [0, N)` or `f(-N) -> [-N, 0)`
    - `random_index(Integer) -> Integer`
    - `front_gauss(Integer) -> Integer`
    - `middle_gauss(Integer) -> Integer`
    - `back_gauss(Integer) -> Integer`
    - `quantum_gauss(Integer) -> Integer`
    - `front_poisson(Integer) -> Integer`
    - `middle_poisson(Integer) -> Integer`
    - `back_poisson(Integer) -> Integer`
    - `quantum_poisson(Integer) -> Integer`
    - `front_linear(Integer) -> Integer`
    - `middle_linear(Integer) -> Integer`
    - `back_linear(Integer) -> Integer`
    - `quantum_linear(Integer) -> Integer`
    - `quantum_monty(Integer) -> Integer`
- Random Float Functions
    - `canonical() -> Float`
    - `random_float(Float, Float) -> Float`
    - `triangular(Float, Float, Float) -> Float`
    - `normal_variate(Float, Float) -> Float`
    - `log_normal_variate(Float, Float) -> Float`
    - `exponential_variate(Float) -> Float`
    - `gamma_variate(Float, Float) -> Float`
    - `weibull_variate(Float, Float) -> Float`
    - `extreme_value_variate(Float, Float) -> Float`
    - `chi_squared_variate(Float) -> Float`
    - `cauchy_variate(Float, Float) -> Float`
    - `fisher_f_variate(Float, Float) -> Float`
    - `student_t_variate(Float) -> Float`
    - `beta_variate(Float, Float) -> Float`
    - `pareto_variate(Float) -> Float`
    - `vonmises_variate(Float, Float) -> Float`
- Random Boolean Functions
    - `percent_true(Float) -> Boolean`
    - `bernoulli_variate(Float) -> Boolean`
- Inplace Shuffle Algorithms
    - `shuffle(List[Any]) -> None`
    - `knuth_a(List[Any]) -> None`
    - `fisher_yates(List[Any]) -> None`
- Utilities
    - `seed(int) -> None`
    - `sample(population: Sequence, k: int) -> List`
    - `flatten(Object, *args, Boolean, **kwargs) -> Object`
    - `smart_clamp(Integer, Integer, Integer) -> Integer`
    - `float_clamp(Float, Float, Float) -> Float`
    - `distribution_range(Callable, Integer, Integer) -> Callable`
    - `max_unit() -> Unsigned Integer`
    - `min_int() -> Integer`
    - `max_int() -> Integer`
    - `min_float() -> Float`
    - `max_float() -> Float`
    - `min_below() -> Float`
    - `min_above() -> Float`
- Development Log
- Test Suite Output
- Legal Information


#### Numeric Limits:
- Unsigned Integer: 64 bit unsigned integer.
    - Range: 0-18446744073709551615, approximately 18.4 billion-billion
- Integer: 64 bit signed integer.
    - Range: ±9223372036854775807, approximately ±9.2 billion-billion
- Float: 64 bit floating point.
    - Range: ±1.7976931348623157e+308
    - Epsilon Delta: 5e-305 to 5e-324, platform dependent

----

## Random Value Engines

### Fortuna.RandomValue
`Fortuna.RandomValue(collection: Iterable[Any], zero_cool=random_index, flat=True) -> Callable -> Value`
Random Value Engine Class that supports dependency injection.

Takes an iterable (tuple) and a distribution function and returns
a callable to produce random values from the iterable with the same distribution.

- @param collection :: Iterable of Values. Tuple recommended.
- @param zero_cool :: Optional ZeroCool Callable, kwarg only. Default = random_index(). This function must follow the ZeroCool Spec.
- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.
- @return :: Callable Object. `Callable(*args, **kwargs) -> Value`
    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.
    - @return Value or Value(*args, **kwargs) if the value itself is callable. This is recursive.

#### RandomValue Dependency Injection: Rare Apples Example
RandomValue supports dependency injection, it is the only Fortuna class to do so.
The injected functor must follow the ZeroCool Specification:
f(x: int) -> int in [0, x) with any distribution. Many ZeroCool functions are provided,
in the following example we'll see front_linear and back_linear used together.

> If one of the builtin ZeroCool distributions is required, it is 
highly recommended to employ QuantumMonty rather than RandomValue. 
ZeroCool distributions are used here for the demonstration of RandomValue only. 
QuantumMonty offers the same ZeroCool distributions, but with less overhead. 
RandomValue is specifically designed for custom dependency injection, 
where you might design your own distribution and use it with RandomValue.

```python
from Fortuna import RandomValue, front_linear, back_linear


# Setup
random_apple = RandomValue((
    "Delicious", 
    "Empire", 
    "Granny Smith", 
    "Honey Crisp", 
    "Macintosh",
), zero_cool=front_linear)

random_fruit = RandomValue((
    lambda: f"Apple, {random_apple()}",
    "Banana",
    "Cherry",
    "Grapes",
    "Orange",
), zero_cool=back_linear)

# Usage
print(random_fruit())
# prints a random 'Fruit' with a compound linear distribution
# where 'Delicious' is the most common 'Apple' and 'Apple' is the rarest 'Fruit'

```
#### QuantumMonty: Rare Apples Example
Same as above but with QuantumMonty - for syntax comparison.
```python
from Fortuna import QuantumMonty


# Setup
random_apple = QuantumMonty((
    "Delicious", 
    "Empire", 
    "Granny Smith", 
    "Honey Crisp", 
    "Macintosh",
)).front_linear

random_fruit = QuantumMonty((
    lambda: f"Apple, {random_apple()}",
    "Banana",
    "Cherry",
    "Grapes",
    "Orange",
)).back_linear

# Usage
print(random_fruit())
# prints a random fruit with the correct compound distribution
```

### Auto Flattening
Auto Flattening works with all random generator classes in Fortuna, and it's on by default.
Flattening is lazy: it happens at call time as the last step. 
Flattening is recursive: this allows a nested lambda stack to be collapsed automatically.
Flattening is resilient: if for any reason a callable can not be flatted - it will 
be returned in an un-flattened state without error. 

#### Example: RandomValue with Auto Flattening
```python
from Fortuna import RandomValue


auto_flat = RandomValue([lambda: 1, lambda: 2, lambda: 3])
print(auto_flat())  # will print the value 1, 2 or 3.
# Note: the lambda will not be called until call time and stays dynamic for the life of the object.

auto_flat_with = RandomValue([lambda x: x, lambda x: x + 1, lambda x:  x + 2])
print(auto_flat_with(2))  # will print the value 2, 3 or 4
# Note: if this is called with no args it will simply return the lambda in an uncalled state.

un_flat = RandomValue([lambda: 1, lambda: 2, lambda: 3], flat=False)
print(un_flat()())  # will print the value 1, 2 or 3, 
# mind the double-double parenthesis, they are required to manually unpack the lambdas

auto_un_flat = RandomValue([lambda x: x, lambda x: x + 1, lambda x:  x + 2], flat=False)
# Note: flat=False is not required here because the lambdas can not be called without input x satisfied.
# It is recommended to specify flat=False if non-flat output is intended.
print(auto_un_flat()(1))  # will print the value 1, 2 or 3, mind the double-double parenthesis.
```

#### Mixing Static Objects with Callable Objects
Auto Flattening works with all random generator classes in Fortuna, and it's on by default.
```python
from Fortuna import RandomValue


""" With automatic flattening active, `lambda() -> int` can be treated as an `int`. """
mixed_flat = RandomValue([1, 2, lambda: 3])
print(mixed_flat())  # will print 1, 2 or 3

""" Mixed Anti-pattern """
mixed_un_flat = RandomValue([1, 2, lambda: 3], flat=False) # this is not recommended.
print(mixed_flat())  # will print 1, 2 or "Function <lambda at some_address>"
# This pattern is not recommended because you won't know the nature of what you get back.
# This is almost always not what you want, and it can give rise to messy logic in other areas of your code.
```

#### Dynamic Strings
To successfully express a dynamic string, and keep it dynamic for the duration of the program, at least one level of indirection is required. Without a lambda - the f-string would collapse into a static string too soon.
This works with all random generator classes in Fortuna.

```python
from Fortuna import RandomValue, d


# d() is a simple dice function, d(n) -> [1, n] flat uniform distribution.
dynamic_string = RandomValue((
    # while the probability of all A == all B == all C, individual probabilities of each possible string will differ based on the number of possible outputs of each category.
    lambda: f"A{d(2)}",  # -> A1 - A2, each are twice as likely as any particular B, and three times as likely as any C.
    lambda: f"B{d(4)}",  # -> B1 - B4, each are half as likely as any particular A, and 3/2 as likely as any C.
    lambda: f"C{d(6)}",  # -> C1 - C6, each are 1/3 as likely as any particular A and 2/3 as likely of any B.
))

print(dynamic_string())  # prints a random dynamic string, generated at call time.
```

### TruffleShuffle
`Fortuna.TruffleShuffle(collection: Iterable[Any], flat=True) -> Callable -> Value`
- @param collection :: Iterable of Values. Set recommended but not required.
- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.
- @return :: Callable Object. `Callable(*args, **kwargs) -> Value`
    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.
    - @return :: Random value from the collection with a Wide Uniform Distribution. 
    
Wide Uniform Distribution: "Wide" refers to the average distance between consecutive occurrences of the same value. The average width of the output distribution will naturally scale up with the size of the collection. The goal of this type of distribution is to keep the output sequence free of clumps or streaks of the same value, while maintaining randomness and uniform probability. This is not the same as a flat uniform distribution. The two distributions over time will be statistically similar for any given set, but the repetitiveness of the output sequence will be very different.

#### TruffleShuffle, Basic Use
```python
from Fortuna import TruffleShuffle

# Setup
list_of_values = { 1, 2, 3, 4, 5, 6 }
truffle_shuffle = TruffleShuffle(list_of_values)

# Usage
print(truffle_shuffle())  # this will print one of the numbers 1-6, 
# repeated calls will produce a wide distribution.
```

#### Nesting Dolls
This works with all random generator classes in Fortuna, interchangeably.
```python
from Fortuna import RandomValue, TruffleShuffle

# Setup
nesting_dolls = TruffleShuffle((
    RandomValue(("A", "B", "C", "D", "E")),
    RandomValue(("F", "G", "H", "I", "J")),
    RandomValue(("K", "L", "M", "N", "O")),
    RandomValue(("P", "Q", "R", "S", "T")),
))

# Usage
print(nesting_dolls())  
# Prints one of the letters A-T.
# Produces a wide distribution of each category -
# and a flat uniform distribution within each category.
```

### QuantumMonty
`Fortuna.QuantumMonty(collection: Iterable[Any], flat=True) -> Callable -> Value`
- @param collection :: Iterable of Values. Tuple recommended.
- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.
- @return :: Callable Object with Monty Methods for producing various distributions of the data.
    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.
    - @return :: Random value from the data. The instance will produce random values from the list using the selected distribution model or "monty". The default monty is the Quantum Monty Algorithm.

```python
from Fortuna import QuantumMonty

# Setup
list_of_values = [1, 2, 3, 4, 5, 6]
monty = QuantumMonty(list_of_values)

# Usage
print(monty())               # prints a random value from the list_of_values
                             # uses the default Quantum Monty Algorithm

print(monty.flat_uniform())  # prints a random value from the list_of_values
                             # uses the "flat_uniform" monty
                             # equivalent to random.choice(list_of_values)
```
The QuantumMonty class represents a diverse collection of strategies for producing random values from a sequence where the output distribution is based on the method you choose. Generally speaking, each value in the sequence will have a probability that is based on its position in the sequence. For example: the "front" monty produces random values where the beginning of the sequence is geometrically more common than the back. Given enough samples the "front" monty will always converge to a 45 degree slope down for any list of unique values.

There are three primary method families: linear, gaussian, and poisson. Each family has three base methods; 'front', 'middle', 'back', plus a 'quantum' method that incorporates all three base methods. The quantum algorithms for each family produce distributions by overlapping the probability waves of the other methods in their family. The Quantum Monty Algorithm incorporates all nine base methods.

```python
import Fortuna

# Setup
monty = Fortuna.QuantumMonty(
    ["Alpha", "Beta", "Delta", "Eta", "Gamma", "Kappa", "Zeta"]
)

# Usage
# Each of the following methods will return a random value from the sequence.
# Each method has its own unique distribution model.

""" Flat Base Case """
monty.flat_uniform()        # Flat Uniform Distribution

""" Geometric Positional """
monty.front_linear()        # Linear Descending, Triangle
monty.middle_linear()       # Linear Median Peak, Equilateral Triangle
monty.back_linear()         # Linear Ascending, Triangle
monty.quantum_linear()      # Linear Overlay, 3-way monty.

""" Gaussian Positional """
monty.front_gauss()         # Front Gamma
monty.middle_gauss()        # Scaled Gaussian
monty.back_gauss()          # Reversed Gamma
monty.quantum_gauss()       # Gaussian Overlay, 3-way monty.

""" Poisson Positional """
monty.front_poisson()       # 1/4 Mean Poisson
monty.middle_poisson()      # 1/2 Mean Poisson
monty.back_poisson()        # 3/4 Mean Poisson
monty.quantum_poisson()     # Poisson Overlay, 3-way monty.

""" Quantum Monty Algorithm: Default Monty """
monty()                     # Quantum Monty Algorithm, 9-way monty.
monty.quantum_monty()       #  same as above
```

### Weighted Choice: Base Class
Weighted Choice offers two strategies for selecting random values from a sequence where programmable rarity is desired. Both produce a custom distribution of values based on the weights of the values.

The choice to use one strategy over the other is purely about which one suits you or your data best. Relative weights are easier to understand at a glance. However, many RPG Treasure Tables map rather nicely to a cumulative weighted strategy.

#### Cumulative Weighted Choice
`Fortuna.CumulativeWeightedChoice(weighted_table: Iterable[Tuple[int, Any]], flat=True) -> Callable -> Value`
- @param weighted_table :: Table of weighted pairs. Tuple of Tuples recommended.
- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.
- @return :: Callable Instance
    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.
    - @return :: Random value from the weighted_table, distribution based on the weights of the values.

_Note: Logic dictates Cumulative Weights must be unique!_

```python
from Fortuna import CumulativeWeightedChoice

# Setup
cum_weighted_choice = CumulativeWeightedChoice((
    (7, "Apple"),
    (11, "Banana"),
    (13, "Cherry"),
    (23, "Grape"),
    (26, "Lime"),
    (30, "Orange"),  # same as relative weight 4 because 30 - 26 = 4
))
# Usage
print(cum_weighted_choice())  # prints a weighted random value
```

#### Relative Weighted Choice
`Fortuna.RelativeWeightedChoice(weighted_table: Iterable[Tuple[int, Any]]) -> Callable -> Value`
- @param weighted_table :: Table of weighted pairs. Tuple of Tuples recommended.
- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.
- @return :: Callable Instance
    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.
    - @return :: Random value from the weighted_table, distribution based on the weights of the values.

```python
from Fortuna import RelativeWeightedChoice

# Data
population = ["Apple", "Banana", "Cherry", "Grape", "Lime", "Orange"]
rel_weights = [7, 4, 2, 10, 3, 4]

# Setup
rel_weighted_choice = RelativeWeightedChoice(zip(rel_weights, population))

# Usage
print(rel_weighted_choice())  # prints a weighted random value
```

### FlexCat
`Fortuna.FlexCat(matrix_data: Matrix, key_bias="front_linear", val_bias="truffle_shuffle", flat=True) -> Callable -> Value`
- @param matrix_data :: Dictionary of Sequences. `Dict[str, Iterable[Any]]`
- @parm key_bias :: Default is "front_linear". String indicating the name of the algorithm to use for random key selection.
- @parm val_bias :: Default is "truffle_shuffle". String indicating the name of the algorithm to use for random value selection.
- @param flat :: Bool. Default is True. Option to automatically flatten callable values with lazy evaluation.
- @return :: Callable Instance
    - @param cat_key :: Optional String. Default is None. Key selection by name. If specified, this will override the key_bias for a single call.
    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.
    - @return :: Value. Returns a random value generated with val_bias from a random sequence generated with key_bias.

FlexCat is like a multidimensional QuantumMonty.

The constructor takes two optional keyword arguments to specify the algorithms to be used to make random selections. The algorithm specified for selecting a key need not be the same as the one for selecting values. An optional key may be provided at call time to bypass the random key selection. Keys passed in this way must exactly match a key in the Matrix.

By default, FlexCat will use key_bias="front_linear" and val_bias="truffle_shuffle", this will make the top of the data structure geometrically more common than the bottom, and it will truffle shuffle the sequence values. This config is known as TopCat, it produces a descending-step, micro-shuffled distribution sequence. Many other combinations are available.

Algorithmic Options: _See QuantumMonty & TruffleShuffle for more details._
- "front_linear", Linear Descending
- "middle_linear", Linear Median Peak
- "back_linear", Linear Ascending
- "quantum_linear", Linear 3-way monty
- "front_gauss", Gamma Descending
- "middle_gauss", Scaled Gaussian
- "back_gauss", Gamma Ascending
- "quantum_gauss", Gaussian 3-way monty
- "front_poisson", Front 1/3 Mean Poisson
- "middle_poisson", Middle Mean Poisson
- "back_poisson", Back 1/3 Mean Poisson
- "quantum_poisson", Poisson 3-way monty
- "quantum_monty", Quantum Monty Algorithm, 9-way monty
- "flat_uniform", uniform flat distribution
- "truffle_shuffle", TruffleShuffle wide uniform distribution

```python
from Fortuna import FlexCat, d


#                           |- Collection Generator, does not require lambda.
# Data                      |
matrix_data = {#            $                         |- Dynamic Value Expression
    "Cat_A": (f"A{i}" for i in range(1, 6)),  #       |  Lazy, 1 of 4 possibilities
    "Cat_B": ("B1", "B2", "B3", "B4", "B5"),  #       $  lambda required for dynamic eval
    "Cat_C": ("C1", "C2", "C3", f"C4.{d(2)}", lambda: f"C5.{d(4)}"),
}#   $       $       $              $                        $
#    |       |       |- Value       |                        |- Fair die method: d4
#    |       |                      |
#    |       |- Collection          |- Static Value Expression
#    |                              |  Eager, 1 or 2 permanently
#    |- Collection Key, "cat_key"

#                               |- Collection Algorithm     |- Value Algorithm
# Setup                         $  y-axis                   $  x-axis
flex_cat = FlexCat(matrix_data, key_bias="front_linear", val_bias="flat_uniform")
#    $       $       $
#    |       |       |- Dictionary of Collections
#    |       |
#    |       |- FlexCat Constructor
#    |       
#    |- Callable Random Value Generator

# Usage
flex_cat()  # returns a Value from the Matrix.
flex_cat(cat_key="Cat_B")  # returns a Value specifically from the "Cat_B" Collection.
```
### Random Value Functions
`Fortuna.random_value(Sequence[Any]) -> Any`

Essentially the same as Random.choice()
- @param data :: Sequence of Values
- @return :: Random value from the sequence. Flat uniform distribution.

`Fortuna.cumulative_weighted_choice(weighted_table: Sequence[Tuple[int, Any]]) -> Any`

Similar to Random.choices()
- @param weighted_table :: Sequence of weighted value pairs. `[(w1, v1), (w2, v2)...]`
- @return :: Returns a random value. Distribution depends on weights.

### Random Integer Functions
`Fortuna.random_below(limit: int) -> int`
- @param limit :: Any 64bit Integer
- @return :: Returns a random integer in the range...
    - `random_below(N) -> [0, N)` for positive limit.
    - `random_below(N) -> (N, 0]` for negative limit.
    - `random_below(0) -> 0` Always returns zero when limit is zero
- Flat uniform distribution.


`Fortuna.random_int(left_limit: int, right_limit: int) -> int`

Essentially the same as Random.randint()
- @param left_limit :: Any Integer
- @param right_limit :: Any Integer
- @return :: Returns a random integer in the range [left_limit, right_limit]
    - `random_int(1, 10) -> [1, 10]`
    - `random_int(10, 1) -> [1, 10]` same as above.
    - `random_int(A, B)` Always returns A when A == B
- Flat uniform distribution.


`Fortuna.random_range(start: int, stop: int = 0, step: int = 1) -> int`

Essentially the same as Random.randrange()
- @param start :: Required starting point.
    - `random_range(0) -> [0]`
    - `random_range(10) -> [0, 10)` from 0 to 9. Same as `Fortuna.random_index(N)`
    - `random_range(-10) -> [-10, 0)` from -10 to -1. Same as `Fortuna.random_index(-N)`
- @param stop :: Zero by default. Optional range bound. With at least two arguments, the order of the first two does not matter.
    - `random_range(0, 0) -> [0]`
    - `random_range(0, 10) -> [0, 10)` from 0 to 9.
    - `random_range(10, 0) -> [0, 10)` same as above.
- @param step :: One by default. Optional step size.
    - `random_range(0, 0, 0) -> [0]`
    - `random_range(0, 10, 2) -> [0, 10) by 2` even numbers from 0 to 8.
    - The sign of the step parameter controls the phase of the output. Negative stepping will flip the inclusive rule.
    - `random_range(0, 10, -1) -> (0, 10]` starts at 10 and ranges down to 1.
    - `random_range(10, 0, -1) -> (0, 10]` same as above.
    - `random_range(10, 10, 0) -> [10]` step size or range size of zero always returns the first parameter.
- @return :: Returns a random integer in the range [A, B) by increments of C.
- Flat uniform distribution.


`Fortuna.d(sides: int) -> int`

Represents a single roll of a given size die.
- @param sides :: Represents the size or number of sides, most commonly six.
- @return :: Returns a random integer in the range [1, sides].
- Flat uniform distribution.


`Fortuna.dice(rolls: int, sides: int) -> int`

Represents the sum total of multiple rolls of the same size die.
- @param rolls :: Represents the number of times to roll the die.
- @param sides :: Represents the die size or number of sides, most commonly six.
- @return :: Returns a random integer in range [X, Y] where X = rolls and Y = rolls * sides.
- Geometric distribution based on the number and size of the dice rolled.
- Complexity scales primarily with the number of rolls, not the size of the dice.


`Fortuna.plus_or_minus(number: int) -> int`
- @param number :: input to determine the output distribution range.
- @return :: Returns a random integer in range [-number, number].
- Flat uniform distribution.


`Fortuna.plus_or_minus_linear(number: int) -> int`
- @param number :: input to determine the output distribution range.
- @return :: Returns a random integer in range [-number, number].
- Linear geometric, 45 degree triangle distribution centered on zero.


`Fortuna.plus_or_minus_gauss(number: int) -> int`
- @param number :: input to determine the output distribution range.
- @return :: Returns a random integer in range [-number, number].
- Stretched gaussian distribution centered on zero.


`Fortuna.binomial_variate(number_of_trials: int, probability: float) -> int`
- Based on the idea of flipping a coin and counting how many heads come up after some number of flips.
- @param number_of_trials :: how many times to flip a coin.
- @param probability :: how likely heads will be flipped. 0.5 is a fair coin. 1.0 is a double-headed coin.
- @return :: count of how many heads came up.


`Fortuna.negative_binomial_variate(trial_successes: int, probability: float) -> int`
- Based on the idea of flipping a coin as long as it takes to succeed.
- @param trial_successes :: the required number of heads flipped to succeed.
- @param probability :: how likely heads will be flipped. 0.50 is a fair coin.
- @return :: the count of how many tails came up before the required number of heads.


`Fortuna.geometric_variate(probability: float) -> int`
- Same as random_negative_binomial(1, probability). 


`Fortuna.poisson_variate(mean: float) -> int`
- @param mean :: sets the average output of the function.
- @return :: random integer, poisson distribution centered on the mean.


### Random Index, ZeroCool Specification
ZeroCool Methods are used to generate random Sequence indices.

ZeroCool methods must have the following properties:
- Any distribution model is acceptable such that...
- The method or function must take exactly one Integer parameter N.
- The method returns a random int in range `[0, N)` for positive values of N.
- The method returns a random int in range `[N, 0)` for negative values of N.
- This symmetry matches how python can index a list from the back for negative values or the front for positive values of N.


```python
from Fortuna import random_index


some_list = [i for i in range(100)] # [0..99]

print(some_list[random_index(10)])  # prints one of the first 10 items of some_list, [0, 9]
print(some_list[random_index(-10)])  # prints one of the last 10 items of some_list, [90, 99]
```
### ZeroCool Methods
- `Fortuna.random_index(size: int) -> int` Flat uniform distribution
- `Fortuna.front_gauss(size: int) -> int` Gamma Distribution: Front Peak
- `Fortuna.middle_gauss(size: int) -> int` Stretched Gaussian Distribution: Median Peak
- `Fortuna.back_gauss(size: int) -> int` Gamma Distribution: Back Peak
- `Fortuna.quantum_gauss(size: int) -> int` Quantum Gaussian: Three-way Monty
- `Fortuna.front_poisson(size: int) -> int` Poisson Distribution: Front 1/3 Peak
- `Fortuna.middle_poisson(size: int) -> int` Poisson Distribution: Middle Peak
- `Fortuna.back_poisson(size: int) -> int` Poisson Distribution: Back 1/3 Peak
- `Fortuna.quantum_poisson(size: int) -> int` Quantum Poisson: Three-way Monty
- `Fortuna.front_geometric(size: int) -> int` Linear Geometric: 45 Degree Front Peak
- `Fortuna.middle_geometric(size: int) -> int` Linear Geometric: 45 Degree Middle Peak
- `Fortuna.back_geometric(size: int) -> int` Linear Geometric: 45 Degree Back Peak
- `Fortuna.quantum_geometric(size: int) -> int` Quantum Geometric: Three-way Monty
- `Fortuna.quantum_monty(size: int) -> int` Quantum Monty: Nine-way Monty

```python
from Fortuna import front_gauss, middle_gauss, back_gauss, quantum_gauss


some_list = [i for i in range(100)]

# Each of the following prints one of the first 10 items of some_list with the appropriate distribution
print(some_list[front_gauss(10)])
print(some_list[middle_gauss(10)])
print(some_list[back_gauss(10)])
print(some_list[quantum_gauss(10)])

# Each of the following prints one of the last 10 items of some_list with the appropriate distribution
print(some_list[front_gauss(-10)])  
print(some_list[middle_gauss(-10)])  
print(some_list[back_gauss(-10)])  
print(some_list[quantum_gauss(-10)])
```

### Random Float Functions
`Fortuna.canonical() -> float`
- @return :: random float in range [0.0, 1.0), flat uniform.

`Fortuna.random_float(a: Float, b: Float) -> Float`
- @param a :: Float input
- @param b :: Float input
- @return :: random Float in range `[a, b)`, flat uniform distribution.

`Fortuna.triangular(low: Float, high: Float, mode: Float) -> Float`
- @param low :: Float, minimum output
- @param high :: Float, maximum output
- @param mode :: Float, most common output, mode must be in range `[low, high]`
- @return :: random Float in range `[low, high]` with a linear distribution about the mode.

`Fortuna.normal_variate(mean: Float, std_dev: Float) -> Float`
- @param mean :: Float, sets the average output of the function.
- @param std_dev :: Float, standard deviation. Specifies spread of data from the mean.

`Fortuna.log_normal_variate(log_mean: Float, log_deviation: Float) -> Float`
- @param log_mean :: Float, sets the log of the mean of the function.
- @param log_deviation :: Float, log of the standard deviation. Specifies spread of data from the mean.

`Fortuna.exponential_variate(lambda_rate: Float) -> Float`
- Produces random non-negative floating-point values, distributed according to probability density function.
- @param lambda_rate :: Float, λ constant rate of a random event per unit of time/distance.
- @return :: Float, the time/distance until the next random event. For example, this distribution describes the time between the clicks of a Geiger counter or the distance between point mutations in a DNA strand.

`Fortuna.gamma_variate(shape: Float, scale: Float) -> Float`
- Generalization of the exponential distribution.
- Produces random positive floating-point values, distributed according to probability density function.    
- @param shape :: Float, α the number of independent exponentially distributed random variables.
- @param scale :: Float, β the scale factor or the mean of each of the distributed random variables.
- @return :: Float, the sum of α independent exponentially distributed random variables, each of which has a mean of β.

`Fortuna.weibull_variate(shape: Float, scale: Float) -> Float`
- Generalization of the exponential distribution.
- Similar to the gamma distribution but uses a closed form distribution function.
- Popular in reliability and survival analysis.

`Fortuna.extreme_value_variate(location: Float, scale: Float) -> Float`
- Based on Extreme Value Theory. 
- Used for statistical models of the magnitude of earthquakes and volcanoes.

`Fortuna.chi_squared_variate(degrees_of_freedom: Float) -> Float`
- Used with the Chi Squared Test and Null Hypotheses to test if sample data fits an expected distribution.

`Fortuna.cauchy_variate(location: Float, scale: Float) -> Float`
- @param location :: Float, specifies the location of the peak. The default value is 0.0.
- @param scale :: Float, represents the half-width at half-maximum. The default value is 1.0.
- @return :: Float, Continuous Distribution.

`Fortuna.fisher_f_variate(degrees_of_freedom_1: Float, degrees_of_freedom_2: Float) -> Float`
- F distributions often arise when comparing ratios of variances.

`Fortuna.student_t_variate(degrees_of_freedom: Float) -> Float`
- T distribution. Same as a normal distribution except it uses the sample standard deviation rather than the population standard deviation.
- As degrees_of_freedom goes to infinity it converges with the normal distribution.

`Fortuna.beta_variate(alpha: Float, beta: Float) -> Float`

`Fortuna.pareto_variate(alpha: Float) -> Float`

`Fortuna.vonmises_variate(mu: Float, kappa: Float) -> Float`


### Random Truth Functions
`Fortuna.percent_true(truth_factor: Float = 50.0) -> Boolean`
- Produces a distribution of boolean values.
- @param truth_factor :: Float, probability of True as a percentage. Default is 50 percent. Expected input range: `[0.0, 100.0]`, clamped.
- @return :: Produces True or False based on the truth_factor as a percent of true.

`Fortuna.bernoulli_variate(ratio_of_truth: Float) -> Boolean`
- Produces a Bernoulli distribution of boolean values.
- @param ratio_of_truth :: Float, the probability of True as a ratio. Expected input range: `[0.0, 1.0]`, clamped.
- @return :: True or False


### Shuffle Algorithm
`Fortuna.shuffle(array: List[Any]) -> None`
- Knuth B Shuffle Algorithm. Destructive, in-place shuffle.
- @param array :: List to be shuffled.
- @return :: None

`Fortuna.knuth_a(array: List[Any]) -> None`
- Knuth A Shuffle Algorithm. Destructive, in-place shuffle.
- @param array :: List to be shuffled.
- @return :: None

`Fortuna.fisher_yates(array: List[Any]) -> None`
- Fisher Yates Shuffle Algorithm. Destructive, in-place shuffle.
- @param array :: List to be shuffled.
- @return :: None


### Utilities
`Fortuna.sample(population: Sequence, k: int) -> List`
- Replacement for `random.sample`, approximately 2x performance.
- @param population :: Sequence of Any.
- @param k :: Represents the number of samples to be returned. Param k must be <= len(population).
- @return :: Returns list of k random samples from the population data without duplication.

`Fortuna.flatten(maybe_callable, *args, flat=True, **kwargs) -> flatten(maybe_callable(*args, **kwargs))`
- Recursively calls the input object and returns the result. The arguments are only passed in on the first evaluation.
- If the maybe_callable is not callable it is simply returned without error. 
- Conceptually this is somewhat like collapsing the wave function. Often used as the last step in lazy evaluation.
- @param maybe_callable :: Any Object that might be callable.
- @param flat :: Boolean, default is True. Optional, keyword only. Disables flattening if flat is set to False, conceptually turns flatten into the identity function.
- @param *args, **kwargs :: Optional arguments used to flatten the maybe_callable object.
- @return :: Recursively Flattened Object.

`Fortuna.smart_clamp(target: int, lo: int, hi: int) -> int`
- Used to clamp the target in range `[lo, hi]` by saturating the bounds.
- Essentially the same as median for exactly three integers.
- @return :: Returns the middle value, input order does not matter (unlike std::clamp).

`Fortuna.float_clamp(target: float, lo: float, hi: float) -> float`
- Used to clamp the target in range `[lo, hi]` by saturating the bounds.
- Essentially the same as median for exactly three floats.
- @return :: Returns the middle value, input order does not matter (unlike std::clamp).

`Fortuna.distribution_range(func: Callable, lo: int, hi: int) -> Callable`
Higher-order function for producing integer distribution ranges based on a ZeroCool function.
If given a function like random_below, this function will produce random values
with the same distribution but in the range lo to hi, rather than from zero to N-1.
Essentially, this turns a function like random_below(B+1) into random_int(A, B).

- @param func: ZeroCool random distribution, F(N) -> `[0, N-1]`
- @param lo: minimum limit
- @param hi: maximum limit
- @return: Callable() -> int
    - @return: random value in range `[lo, hi]`

`Fortuna.max_uint() -> int`
Maximum unsigned integer. Should be 18446744073709551615.

`Fortuna.max_int() -> int`
Maximum integer. Should be 9223372036854775807.

`Fortuna.min_int() -> int`
Minimum integer. Should be -9223372036854775807.

`Fortuna.max_float() -> float`
Maximum floating point. Should be 1.7976931348623157e+308.

`Fortuna.min_float() -> float`
Minimum floating point. Should be -1.7976931348623157e+308.

`Fortuna.min_above() -> float`
Minimum float above zero. Should be 5e-324.

`Fortuna.min_below() -> float`
Minimum float below zero. Should be -5e-324.

## Fortuna Development Log

##### Fortuna 5.5.7
- Storm Update 4.0.3

##### Fortuna 5.5.6
- Performance test update
- Documentation update

##### Fortuna 5.5.5
- All platforms now require C++20

##### Fortuna 5.5.4
- Bug fixes

##### Fortuna 5.5.3
- Bug fixes

##### Fortuna 5.5.2
- Bug fixes

##### Fortuna 5.5.1
- Bug fixes

##### Fortuna 5.5.0
- Bug fixes

##### Fortuna 5.4.2
- Storm 3.9.2 update

##### Fortuna 5.4.1
- Bug fixes

##### Fortuna 5.4.0
- Adds DistributionRange
- Changes signature of distribution_range, use DistributionRange for previous behavior

##### Fortuna 5.3.2
- FlexCat now handles (cycle, cycle) more intuitively

##### Fortuna 5.3.1
- Adds several float tests

##### Fortuna 5.3.0
- Storm Update v3.9.0
- `lognormal_variate` -> `log_normal_variate`

##### Fortuna 5.2.1
- Bug fix (TruffleShuffle)

##### Fortuna 5.2.0
- Adds `QuantumMonty.cycle` method
  - Supports FlexCat

##### Fortuna 5.1.4
- Documentation Update
- Updates Installation Script
  - Darwin now uses "-std=c++20"
  - Linux now uses "-std=c++17"

##### Fortuna 5.1.3
- Storm 3.8.0 update
- No longer requires Python.h

##### Fortuna 5.1.2
- Storm 3.7.1 update

- ##### Fortuna 5.1.1
- Storm 3.7.0 update

##### Fortuna 5.1.0
- Storm 3.6.4 update

##### Fortuna 5.0.7
- Installer patch

##### Fortuna 5.0.6
- Storm 3.6.3 update

##### Fortuna 5.0.5
- Documentation Update

##### Fortuna 5.0.4
- Performance Tuning

##### Fortuna 5.0.3
- Test Update

##### Fortuna 5.0.2
- Performance Tuning

##### Fortuna 5.0.1
- Bug Fixes

##### Fortuna 5.0.0
- Adds MSVC support

##### Fortuna 4.4.4
- Installation bug fix

##### Fortuna 4.4.3
- Storm 3.6.0 update
  - Removes Storm::Engine::engine
  - Fixes type bug in Storm::Meters::max_uint
- Performance tests now use Python 3.10
  - Incidental ~25% performance boost
- Removes MonkeyScope as a requirement
  - MonkeyScope should be installed separately

##### Fortuna 4.4.2
- Storm 3.5.8 update
  - Adds float_clamp
  - Adds max_uint

##### Fortuna 4.4.1
- Updates documentation
- Fixes typos

##### Fortuna 4.4.0
- Storm 3.5.7 update
- Adds seeding: Storm::Engine::seed

##### Fortuna 4.3.5
- Performance update `sample`

##### Fortuna 4.3.4
- Added `sample`

##### Fortuna 4.3.3
- TruffleShuffle update

##### Fortuna 4.3.2
- Fixes installer for Google Colab

##### Fortuna 4.3.1
- Fixes installer for Linux

##### Fortuna 4.3.0
- Updates Storm to 3.5.5
- Adds minor documentation
- Updates tests
- Installer now requires C++20 compiler

##### Fortuna 4.2.3
- Updates Storm to 3.5.4

##### Fortuna 4.2.2
- Updates Storm to 3.5.3

##### Fortuna 4.2.1
- Updates Storm to 3.5.1

##### Fortuna 4.2.0
- Fixes a few docstrings, expands example code

##### Fortuna 4.1.9
- Updates documentation - installation notes, copyright date and other small tweaks

##### Fortuna 4.1.8
- Updates performance test output for Fortuna 4.1.x on Big Sur with Python 3.9.x

##### Fortuna 4.1.7
- Adds GitHub repo link to the project for PyPi
- Adds minor documentation & example file updates

##### Fortuna 4.1.6
- Fixes 'zero rolls' bug in 'dice()'

##### Fortuna 4.1.5
- Fixes minor bug

##### Fortuna 4.1.4
- Updates requirements.txt

##### Fortuna 4.1.3
- Small refactoring

##### Fortuna 4.1.2
- Updates tests

##### Fortuna 4.1.1
- Fixes some minor typos

##### Fortuna 4.1.0
- Adds distribution_range utility

##### Fortuna 4.0.0
- RNG merge, adds all features from the RNG library that were not already here

##### Fortuna 3.20.3
- Minor low level Storm update
- Minor test tweaks

##### Fortuna 3.20.2
- adds example: fortuna_extras/multi_threading.py

##### Fortuna 3.20.1
- fixes typos

##### Fortuna 3.20.0
- Updates Storm: 3.4.0: Storm is now Thread Safe
- Adds platform limit meters
- Deprecates MultiChoice

##### Fortuna 3.19.1
- fixes typos

##### Fortuna 3.19.0
- Storm 3.3.6 update

##### Fortuna 3.18.2
- Fixes typos

##### Fortuna 3.18.1
- Installer update

##### Fortuna 3.18.0
- Performance Enhancement
- Storm 3.3.4 update
- updated test output

##### Fortuna 3.17.13
- Fixes some typos

##### Fortuna 3.17.12
- Adds pyproject.toml file to ease the installation process

##### Fortuna 3.17.11
- Documentation Update

##### Fortuna 3.17.10
- Documentation Update

##### Fortuna 3.17.9
- Typo

##### Fortuna 3.17.8
- Typo

##### Fortuna 3.17.7
- Typo

##### Fortuna 3.17.6
- Documentation update

##### Fortuna 3.17.5
- Typos

##### Fortuna 3.17.4
- Reorganized

##### Fortuna 3.17.3
- Streamlining: dropped auxiliary packages.

##### Fortuna 3.17.2
- Documentation update

##### Fortuna 3.17.1
- Update for backwards compatibility for platforms that do not support std::clamp.

##### Fortuna 3.17.0, internal
- Installation issue detected on some platforms that lack std::clamp.

##### Fortuna 3.16.9
- Documentation Update

##### Fortuna 3.16.8
- TruffleShuffle update
- Adds truffle_shuffle()

##### Fortuna 3.16.7
- Documentation Update

##### Fortuna 3.16.6
- Adds distribution_range()

##### Fortuna 3.16.5
- Documentation Update

##### Fortuna 3.16.4
- Documentation Update

##### Fortuna 3.16.3
- Major TruffleShuffle performance upgrade

##### Fortuna 3.16.2 - Internal
- Testing

##### Fortuna 3.16.1
- Documentation Update

##### Fortuna 3.16.0
- Storm 3.3.2 Update

##### Fortuna 3.15.1
- Docs updated

##### Fortuna 3.15.0
- Type Hints Clarified via Typing Module

##### Fortuna 3.14.1
- Fixed another installer bug affecting gcc.

##### Fortuna 3.14.0
- Minor TruffleShuffle Update
- Fisher Yates, and Knuth A Shuffle Algorithms added for comparison with Fortuna.shuffle()
    - Some platforms may prefer one over another. Intel favors Knuth B (Fortuna.shuffle) by more than double.

##### Fortuna 3.13.0 - Internal
- Development & Testing Environment Updated to Python 3.8
    - Python3.8 brings a 10-20% performance boost over all.
- RandomValue API redesign. Dependency Injection is now handled at instantiation rather than call time.

##### Fortuna 3.12.2
- Installer update.
- Clarified the docs for MultiChoice.

##### Fortuna 3.12.1
- MultiChoice now accepts a default.

##### Fortuna 3.12.0
- MultiChoice added

##### Fortuna 3.10.2
- Doc string update for clarity.
- Test update
- MonkeyScope Update

##### Fortuna 3.10.1
- Documentation fix, RandomValue examples are now together.

##### Fortuna 3.10.0
- Fortuna now includes both RNG and Pyewacket.
- Documentation update.

##### Fortuna 3.9.11
- Installer Update, properly installs MonkeyScope as intended.

##### Fortuna 3.9.10
- Fixed Typos

##### Fortuna 3.9.9
- Docs Update

##### Fortuna 3.9.8
- Test Update

##### Fortuna 3.9.7
- Tests for RNG and Pyewacket are now included in `fortuna_extras` package.

##### Fortuna 3.9.6
- Documentation update.

##### Fortuna 3.9.5
- Storm 3.2.2 Update.

##### Fortuna 3.9.4
- Documentation update.

##### Fortuna 3.9.3
- MonkeyScope update, 10% test suite performance improvement.

##### Fortuna 3.9.2
- Documentation update.

##### Fortuna 3.9.1
- `flatten_with` has been renamed to `flatten`. This should be non-breaking, please report any bugs.

##### Fortuna 3.9.0 - Internal
- Added many doc strings.
- Corrected many typos in Docs.
- The `flatten` function has been fully replaced by `flatten_with`. 
    - All classes that support automatic flattening can now accept arbitrary arguments at call time.
    - `flatten_with` will be renamed to `flatten` in a future release.

##### Fortuna 3.8.9
- Fixed some typos.

##### Fortuna 3.8.8
- Fortuna now supports Python notebooks, python3.6 or higher required.

##### Fortuna 3.8.7
- Storm Update

##### Fortuna 3.8.6
- Attempting to make Fortuna compatible with Python Notebooks. 

##### Fortuna 3.8.5
- Installer Config Update

##### Fortuna 3.8.4
- Installer Config Update

##### Fortuna 3.8.3
- Storm Update 3.2.0

##### Fortuna 3.8.2
- More Typo Fix

##### Fortuna 3.8.1
- Typo Fix

##### Fortuna 3.8.0
- Major API Update, several utilities have been deprecated. See MonkeyScope for replacements.
    - distribution
    - distribution_timer
    - timer

##### Fortuna 3.7.7
- Documentation Update

##### Fortuna 3.7.6
- Install script update.

##### Fortuna 3.7.5 - internal
- Storm 3.1.1 Update
- Added triangular function.

##### Fortuna 3.7.4
- Fixed: missing header in the project manifest, this may have caused building from source to fail.

##### Fortuna 3.7.3
- Storm Update

##### Fortuna 3.7.2
- Storm Update

##### Fortuna 3.7.1
- Bug fixes

##### Fortuna 3.7.0 - internal
- flatten_with() is now the default flattening algorithm for all Fortuna classes.

##### Fortuna 3.6.5
- Documentation Update
- RandomValue: New flatten-with-arguments functionality.

##### Fortuna 3.6.4
- RandomValue added for testing

##### Fortuna 3.6.3
- Developer Update

##### Fortuna 3.6.2
- Installer Script Update

##### Fortuna 3.6.1
- Documentation Update

##### Fortuna 3.6.0
- Storm Update
- Test Update
- Bug fix for random_range(), negative stepping is now working as intended. This bug was introduced in 3.5.0.
- Removed Features
    - lazy_cat(): use QuantumMonty class instead.
    - flex_cat(): use FlexCat class instead.
    - truffle_shuffle(): use TruffleShuffle class instead.

##### Fortuna 3.5.3 - internal
- Features added for testing & development
    - ActiveChoice class
    - random_rotate() function

##### Fortuna 3.5.2
- Documentation Updates

##### Fortuna 3.5.1
- Test Update

##### Fortuna 3.5.0
- Storm Update
- Minor Bug Fix: Truffle Shuffle
- Deprecated Features
    - lazy_cat(): use QuantumMonty class instead.
    - flex_cat(): use FlexCat class instead.
    - truffle_shuffle(): use TruffleShuffle class instead.

##### Fortuna 3.4.9
- Test Update

##### Fortuna 3.4.8
- Storm Update

##### Fortuna 3.4.7
- Bug fix for analytic_continuation.

##### Fortuna 3.4.6
- Docs Update

##### Fortuna 3.4.5
- Docs Update
- Range Tests Added, see extras folder.

##### Fortuna 3.4.4
- ZeroCool Algorithm Bug Fixes
- Typos Fixed

##### Fortuna 3.4.3
- Docs Update

##### Fortuna 3.4.2
- Typos Fixed

##### Fortuna 3.4.1
- Major Bug Fix: random_index()

##### Fortuna 3.4.0 - internal
- ZeroCool Poisson Algorithm Family Updated

##### Fortuna 3.3.8 - internal
- Docs Update

##### Fortuna 3.3.7
- Fixed Performance Bug: ZeroCool Linear Algorithm Family

##### Fortuna 3.3.6
- Docs Update

##### Fortuna 3.3.5
- ABI Updates
- Bug Fixes

##### Fortuna 3.3.4
- Examples Update

##### Fortuna 3.3.3
- Test Suite Update

##### Fortuna 3.3.2 - internal
- Documentation Update

##### Fortuna 3.3.1 - internal
- Minor Bug Fix

##### Fortuna 3.3.0 - internal
- Added `plus_or_minus_gauss(N: int) -> int` random int in range [-N, N] Stretched Gaussian Distribution

##### Fortuna 3.2.3
- Small Typos Fixed

##### Fortuna 3.2.2
- Documentation update.

##### Fortuna 3.2.1
- Small Typo Fixed

##### Fortuna 3.2.0
- API updates:
    - QunatumMonty.uniform -> QunatumMonty.flat_uniform
    - QunatumMonty.front -> QunatumMonty.front_linear
    - QunatumMonty.middle -> QunatumMonty.middle_linear
    - QunatumMonty.back -> QunatumMonty.back_linear
    - QunatumMonty.quantum -> QunatumMonty.quantum_linear
    - randindex -> random_index
    - randbelow -> random_below
    - randrange -> random_range
    - randint   -> random_int

##### Fortuna 3.1.0
- `discrete()` has been removed, see Weighted Choice.
- `lazy_cat()` added.
- All ZeroCool methods have been raised to top level API, for use with lazy_cat()

##### Fortuna 3.0.1
- minor typos.

##### Fortuna 3.0.0
- Storm 2 Rebuild.

##### Fortuna 2.1.1
- Small bug fixes.
- Test updates.

##### Fortuna 2.1.0, Major Feature Update
- Fortuna now includes the best of RNG and Pyewacket.

##### Fortuna 2.0.3
- Bug fix.

##### Fortuna 2.0.2
- Clarified some documentation.

##### Fortuna 2.0.1
- Fixed some typos.

##### Fortuna 2.0.0b1-10
- Total rebuild. New RNG Storm Engine.

##### Fortuna 1.26.7.1
- README updated.

##### Fortuna 1.26.7
- Small bug fix.

##### Fortuna 1.26.6
- Updated README to reflect recent changes to the test script.

##### Fortuna 1.26.5
- Fixed small bug in test script.

##### Fortuna 1.26.4
- Updated documentation for clarity.
- Fixed a minor typo in the test script.

##### Fortuna 1.26.3
- Clean build.

##### Fortuna 1.26.2
- Fixed some minor typos.

##### Fortuna 1.26.1
- Release.

##### Fortuna 1.26.0 beta 2
- Moved README and LICENSE files into fortuna_extras folder.

##### Fortuna 1.26.0 beta 1
- Dynamic version scheme implemented.
- The Fortuna Extension now requires the fortuna_extras package, previously it was optional.

##### Fortuna 1.25.4
- Fixed some minor typos in the test script.

##### Fortuna 1.25.3
- Since version 1.24 Fortuna requires Python 3.7 or higher. This patch corrects an issue where the setup script incorrectly reported requiring Python 3.6 or higher.

##### Fortuna 1.25.2
- Updated test suite.
- Major performance update for TruffleShuffle.
- Minor performance update for QuantumMonty & FlexCat: cycle monty.

##### Fortuna 1.25.1
- Important bug fix for TruffleShuffle, QuantumMonty and FlexCat.

##### Fortuna 1.25
- Full 64bit support.
- The Distribution & Performance Tests have been redesigned.
- Bloat Control: Two experimental features have been removed.
    - RandomWalk
    - CatWalk
- Bloat Control: Several utility functions have been removed from the top level API. These function remain in the Fortuna namespace for now, but may change in the future without warning.
    - stretch_bell, internal only.
    - min_max, not used anymore.
    - analytic_continuation, internal only.
    - flatten, internal only.

##### Fortuna 1.24.3
- Low level refactoring, non-breaking patch.

##### Fortuna 1.24.2
- Setup config updated to improve installation.

##### Fortuna 1.24.1
- Low level patch to avoid potential ADL issue. All low level function calls are now qualified.

##### Fortuna 1.24
- Documentation updated for even more clarity.
- Bloat Control: Two utility functions that are no longer used in the module have been removed.
    - n_samples -> use a list comprehension instead. `[f(x) for _ in range(n)]`
    - bind -> use a lambda instead. `lambda: f(x)`

##### Fortuna 1.23.7
- Documentation updated for clarity.
- Minor bug fixes.
- TruffleShuffle has been redesigned slightly, it now uses a random rotate instead of swap.
- Custom `__repr__` methods have been added to each class.

##### Fortuna 1.23.6
- New method for QuantumMonty: quantum_not_monty - produces the upside down quantum_monty.
- New bias option for FlexCat: not_monty.

##### Fortuna 1.23.5.1
- Fixed some small typos.

##### Fortuna 1.23.5
- Documentation updated for clarity.
- All sequence wrappers can now accept generators as input.
- Six new functions added:
    - random_float() -> float in range [0.0..1.0) exclusive, uniform flat distribution.
    - percent_true_float(num: float) -> bool, Like percent_true but with floating point precision.
    - plus_or_minus_linear_down(num: int) -> int in range [-num..num], upside down pyramid.
    - plus_or_minus_curve_down(num: int) -> int in range [-num..num], upside down bell curve.
    - mostly_not_middle(num: int) -> int in range [0..num], upside down pyramid.
    - mostly_not_center(num: int) -> int in range [0..num], upside down bell curve.
- Two new methods for QuantumMonty:
    - mostly_not_middle
    - mostly_not_center
- Two new bias options for FlexCat, either can be used to define x and/or y-axis bias:
    - not_middle
    - not_center

##### Fortuna 1.23.4.2
- Fixed some minor typos in the README.md file.

##### Fortuna 1.23.4.1
- Fixed some minor typos in the test suite.

##### Fortuna 1.23.4
- Fortuna is now Production/Stable!
- Fortuna and Fortuna Pure now use the same test suite.

##### Fortuna 0.23.4, first release candidate.
- RandomCycle, BlockCycle and TruffleShuffle have been refactored and combined into one class: TruffleShuffle.
- QuantumMonty and FlexCat will now use the new TruffleShuffle for cycling.
- Minor refactoring across the module.

##### Fortuna 0.23.3, internal
- Function shuffle(arr: list) added.

##### Fortuna 0.23.2, internal
- Simplified the plus_or_minus_curve(num: int) function, output will now always be bounded to the range [-num..num].
- Function stretched_bell(num: int) added, this matches the previous behavior of an unbounded plus_or_minus_curve.

##### Fortuna 0.23.1, internal
- Small bug fixes and general clean up.

##### Fortuna 0.23.0
- The number of test cycles in the test suite has been reduced to 10,000 (down from 100,000). The performance of the pure python implementation and the c-extension are now directly comparable.
- Minor tweaks made to the examples in `.../fortuna_extras/fortuna_examples.py`

##### Fortuna 0.22.2, experimental features
- BlockCycle class added.
- RandomWalk class added.
- CatWalk class added.

##### Fortuna 0.22.1
- Fortuna classes no longer return lists of values, this behavior has been extracted to a free function called n_samples.

##### Fortuna 0.22.0, experimental features
- Function bind added.
- Function n_samples added.

##### Fortuna 0.21.3
- Flatten will no longer raise an error if passed a callable item that it can't call. It correctly returns such items in an uncalled state without error.
- Simplified `.../fortuna_extras/fortuna_examples.py` - removed unnecessary class structure.

##### Fortuna 0.21.2
- Fix some minor bugs.

##### Fortuna 0.21.1
- Fixed a bug in `.../fortuna_extras/fortuna_examples.py`

##### Fortuna 0.21.0
- Function flatten added.
- Flatten: The Fortuna classes will recursively unpack callable objects in the data set.

##### Fortuna 0.20.10
- Documentation updated.

##### Fortuna 0.20.9
- Minor bug fixes.

##### Fortuna 0.20.8, internal
- Testing cycle for potential new features.

##### Fortuna 0.20.7
- Documentation updated for clarity.

##### Fortuna 0.20.6
- Tests updated based on recent changes.

##### Fortuna 0.20.5, internal
- Documentation updated based on recent changes.

##### Fortuna 0.20.4, internal
- WeightedChoice (both types) can optionally return a list of samples rather than just one value, control the length of the list via the n_samples argument.

##### Fortuna 0.20.3, internal
- RandomCycle can optionally return a list of samples rather than just one value,
control the length of the list via the n_samples argument.

##### Fortuna 0.20.2, internal
- QuantumMonty can optionally return a list of samples rather than just one value,
control the length of the list via the n_samples argument.

##### Fortuna 0.20.1, internal
- FlexCat can optionally return a list of samples rather than just one value,
control the length of the list via the n_samples argument.

##### Fortuna 0.20.0, internal
- FlexCat now accepts a standard dict as input. The ordered(ness) of dict is now part of the standard in Python 3.7.1. Previously FlexCat required an OrderedDict, now it accepts either and treats them the same.

##### Fortuna 0.19.7
- Fixed bug in `.../fortuna_extras/fortuna_examples.py`.

##### Fortuna 0.19.6
- Updated documentation formatting.
- Small performance tweak for QuantumMonty and FlexCat.

##### Fortuna 0.19.5
- Minor documentation update.

##### Fortuna 0.19.4
- Minor update to all classes for better debugging.

##### Fortuna 0.19.3
- Updated plus_or_minus_curve to allow unbounded output.

##### Fortuna 0.19.2
- Internal development cycle.
- Minor update to FlexCat for better debugging.

##### Fortuna 0.19.1
- Internal development cycle.

##### Fortuna 0.19.0
- Updated documentation for clarity.
- MultiCat has been removed, it is replaced by FlexCat.
- Mostly has been removed, it is replaced by QuantumMonty.

##### Fortuna 0.18.7
- Fixed some more README typos.

##### Fortuna 0.18.6
- Fixed some README typos.

##### Fortuna 0.18.5
- Updated documentation.
- Fixed another minor test bug.

##### Fortuna 0.18.4
- Updated documentation to reflect recent changes.
- Fixed some small test bugs.
- Reduced default number of test cycles to 10,000 - down from 100,000.

##### Fortuna 0.18.3
- Fixed some minor README typos.

##### Fortuna 0.18.2
- Fixed a bug with Fortuna Pure.

##### Fortuna 0.18.1
- Fixed some minor typos.
- Added tests for `.../fortuna_extras/fortuna_pure.py`

##### Fortuna 0.18.0
- Introduced new test format, now includes average call time in nanoseconds.
- Reduced default number of test cycles to 100,000 - down from 1,000,000.
- Added pure Python implementation of Fortuna: `.../fortuna_extras/fortuna_pure.py`
- Promoted several low level functions to top level.
    - `zero_flat(num: int) -> int`
    - `zero_cool(num: int) -> int`
    - `zero_extreme(num: int) -> int`
    - `max_cool(num: int) -> int`
    - `max_extreme(num: int) -> int`
    - `analytic_continuation(func: staticmethod, num: int) -> int`
    - `min_max(num: int, lo: int, hi: int) -> int`

##### Fortuna 0.17.3
- Internal development cycle.

##### Fortuna 0.17.2
- User Requested: dice() and d() functions now support negative numbers as input.

##### Fortuna 0.17.1
- Fixed some minor typos.

##### Fortuna 0.17.0
- Added QuantumMonty to replace Mostly, same default behavior with more options.
- Mostly is depreciated and may be removed in a future release.
- Added FlexCat to replace MultiCat, same default behavior with more options.
- MultiCat is depreciated and may be removed in a future release.
- Expanded the Treasure Table example in `.../fortuna_extras/fortuna_examples.py`

##### Fortuna 0.16.2
- Minor refactoring for WeightedChoice.

##### Fortuna 0.16.1
- Redesigned fortuna_examples.py to feature a dynamic random magic item generator.
- Raised cumulative_weighted_choice function to top level.
- Added test for cumulative_weighted_choice as free function.
- Updated MultiCat documentation for clarity.

##### Fortuna 0.16.0
- Pushed distribution_timer to the .pyx layer.
- Changed default number of iterations of tests to 1 million, up form 1 hundred thousand.
- Reordered tests to better match documentation.
- Added Base Case Fortuna.fast_rand_below.
- Added Base Case Fortuna.fast_d.
- Added Base Case Fortuna.fast_dice.

##### Fortuna 0.15.10
- Internal Development Cycle

##### Fortuna 0.15.9
- Added Base Cases for random_value()
- Added Base Case for randint()

##### Fortuna 0.15.8
- Clarified MultiCat Test

##### Fortuna 0.15.7
- Fixed minor typos.

##### Fortuna 0.15.6
- Fixed minor typos.
- Simplified MultiCat example.

##### Fortuna 0.15.5
- Added MultiCat test.
- Fixed some minor typos in docs.

##### Fortuna 0.15.4
- Performance optimization for both WeightedChoice() variants.
- Cython update provides small performance enhancement across the board.
- Compilation now leverages Python3 all the way down.
- MultiCat pushed to the .pyx layer for better performance.

##### Fortuna 0.15.3
- Reworked the MultiCat example to include several randomizing strategies working in concert.
- Added Multi Dice 10d10 performance tests.
- Updated sudo code in documentation to be more pythonic.

##### Fortuna 0.15.2
- Fixed: Linux installation failure.
- Added: complete source files to the distribution (.cpp .hpp .pyx).

##### Fortuna 0.15.1
- Updated & simplified distribution_timer in `fortuna_tests.py`
- Readme updated, fixed some typos.
- Known issue preventing successful installation on some linux platforms.

##### Fortuna 0.15.0
- Performance tweaks.
- Readme updated, added some details.

##### Fortuna 0.14.1
- Readme updated, fixed some typos.

##### Fortuna 0.14.0
- Fixed a bug where the analytic continuation algorithm caused a rare issue during compilation on some platforms.

##### Fortuna 0.13.3
- Fixed Test Bug: percent sign was missing in output distributions.
- Readme updated: added update history, fixed some typos.

##### Fortuna 0.13.2
- Readme updated for even more clarity.

##### Fortuna 0.13.1
- Readme updated for clarity.

##### Fortuna 0.13.0
- Minor Bug Fixes.
- Readme updated for aesthetics.
- Added Tests: `.../fortuna_extras/fortuna_tests.py`

##### Fortuna 0.12.0
- Internal test for future update.

##### Fortuna 0.11.0
- Initial Release: Public Beta

##### Fortuna 0.10.0
- Module name changed from Dice to Fortuna

##### Dice 0.1.x - 0.9.x
- Experimental Phase


## Distribution and Performance Tests
Testbed:
- Hardware: Mac Studio: M1 Ultra
- Software: macOS 14.5, Python 3.11.3

```
MonkeyScope: Fortuna Quick Test
Fortuna Version: 5.5.7
Storm Version: 4.0.3

Smart Clamp: Pass
Float Clamp: Pass

Data:
some_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Base Case
Output Analysis: Random.choice(some_list)
Typical Timing: 201 ± 7 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 4
 Maximum: 9
 Mean: 4.509
 Std Deviation: 2.8726592507937956
Distribution of 10000 samples:
 0: 9.94%
 1: 9.74%
 2: 10.26%
 3: 9.99%
 4: 10.54%
 5: 9.51%
 6: 9.76%
 7: 10.34%
 8: 10.08%
 9: 9.84%

Output Analysis: random_value(some_list)
Typical Timing: 37 ± 1 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 4
 Maximum: 9
 Mean: 4.512
 Std Deviation: 2.9028059325904447
Distribution of 10000 samples:
 0: 10.0%
 1: 9.52%
 2: 10.07%
 3: 9.95%
 4: 9.75%
 5: 9.87%
 6: 9.85%
 7: 10.47%
 8: 10.45%
 9: 10.07%


Wide Distribution
Truffle = TruffleShuffle(some_list)
Output Analysis: Truffle()
Typical Timing: 204 ± 5 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 4
 Maximum: 9
 Mean: 4.537
 Std Deviation: 2.861611402657569
Distribution of 10000 samples:
 0: 10.05%
 1: 10.29%
 2: 10.5%
 3: 10.09%
 4: 9.83%
 5: 9.75%
 6: 10.01%
 7: 10.03%
 8: 9.6%
 9: 9.85%

truffle = truffle_shuffle(some_list)
Output Analysis: truffle()
Typical Timing: 82 ± 2 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 5
 Maximum: 9
 Mean: 4.533
 Std Deviation: 2.91090782821861
Distribution of 10000 samples:
 0: 10.18%
 1: 9.83%
 2: 9.91%
 3: 10.05%
 4: 9.85%
 5: 10.04%
 6: 10.09%
 7: 10.12%
 8: 9.78%
 9: 10.15%


QuantumMonty
some_tuple = tuple(i for i in range(10))

monty = QuantumMonty(some_tuple)
Output Analysis: monty()
Typical Timing: 214 ± 3 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 4
 Maximum: 9
 Mean: 4.51
 Std Deviation: 2.9547640566770523
Distribution of 10000 samples:
 0: 11.45%
 1: 8.88%
 2: 8.9%
 3: 9.87%
 4: 11.22%
 5: 11.69%
 6: 9.46%
 7: 9.0%
 8: 8.74%
 9: 10.79%

rand_value = <Fortuna.RandomValue object at 0x1005a0640>
Output Analysis: rand_value()
Typical Timing: 168 ± 5 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 4
 Maximum: 9
 Mean: 4.402
 Std Deviation: 2.8741358104057393
Distribution of 10000 samples:
 0: 10.14%
 1: 10.08%
 2: 9.97%
 3: 10.18%
 4: 10.2%
 5: 10.25%
 6: 10.34%
 7: 9.59%
 8: 9.3%
 9: 9.95%


Weighted Tables:
population = ('A', 'B', 'C', 'D')
cum_weights = (1, 3, 6, 10)
rel_weights = (1, 2, 3, 4)
cum_weighted_table = zip(cum_weights, population)
rel_weighted_table = zip(rel_weights, population)

Cumulative Base Case
Output Analysis: Random.choices(population, cum_weights=cum_weights)
Typical Timing: 550 ± 10 ns
Distribution of 10000 samples:
 A: 9.91%
 B: 19.71%
 C: 29.7%
 D: 40.68%

cum_weighted_choice = CumulativeWeightedChoice(cum_weighted_table)
Output Analysis: cum_weighted_choice()
Typical Timing: 168 ± 3 ns
Distribution of 10000 samples:
 A: 10.4%
 B: 20.28%
 C: 29.51%
 D: 39.81%

Output Analysis: cumulative_weighted_choice(tuple(zip(cum_weights, population)))
Typical Timing: 76 ± 2 ns
Distribution of 10000 samples:
 A: 9.99%
 B: 19.66%
 C: 29.61%
 D: 40.74%

Relative Base Case
Output Analysis: Random.choices(population, weights=rel_weights)
Typical Timing: 694 ± 24 ns
Distribution of 10000 samples:
 A: 9.62%
 B: 20.54%
 C: 29.58%
 D: 40.26%

rel_weighted_choice = RelativeWeightedChoice(rel_weighted_table)
Output Analysis: rel_weighted_choice()
Typical Timing: 174 ± 8 ns
Distribution of 10000 samples:
 A: 9.98%
 B: 20.85%
 C: 29.59%
 D: 39.58%


Random Matrix Values:
some_matrix = {'A': (1, 2, 3, 4), 'B': (10, 20, 30, 40), 'C': (100, 200, 300, 400)}

flex_cat = FlexCat(some_matrix)
Output Analysis: flex_cat()
Typical Timing: 380 ± 13 ns
Statistics of 1000 samples:
 Minimum: 1
 Median: 4
 Maximum: 400
 Mean: 34.157
 Std Deviation: 80.14226808703467
Distribution of 10000 samples:
 1: 13.78%
 2: 13.78%
 3: 13.78%
 4: 13.85%
 10: 8.33%
 20: 8.33%
 30: 8.53%
 40: 8.37%
 100: 2.92%
 200: 2.9%
 300: 2.67%
 400: 2.76%

Output Analysis: flex_cat("C")
Typical Timing: 252 ± 10 ns
Statistics of 1000 samples:
 Minimum: 100
 Median: 200
 Maximum: 400
 Mean: 249.8
 Std Deviation: 112.75048856955199
Distribution of 10000 samples:
 100: 24.93%
 200: 24.87%
 300: 24.91%
 400: 25.29%


Random Integers:
Base Case
Output Analysis: Random.randrange(10)
Typical Timing: 158 ± 4 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 5
 Maximum: 9
 Mean: 4.632
 Std Deviation: 2.871030967931001
Distribution of 10000 samples:
 0: 9.99%
 1: 9.83%
 2: 10.13%
 3: 10.28%
 4: 9.77%
 5: 9.95%
 6: 9.8%
 7: 10.03%
 8: 10.21%
 9: 10.01%

Output Analysis: random_below(10)
Typical Timing: 35 ± 3 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 4
 Maximum: 9
 Mean: 4.436
 Std Deviation: 2.8757910518975773
Distribution of 10000 samples:
 0: 10.06%
 1: 10.17%
 2: 9.9%
 3: 9.97%
 4: 10.37%
 5: 10.42%
 6: 9.37%
 7: 9.35%
 8: 9.78%
 9: 10.61%

Output Analysis: random_index(10)
Typical Timing: 34 ± 1 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 4
 Maximum: 9
 Mean: 4.505
 Std Deviation: 2.887960407504804
Distribution of 10000 samples:
 0: 9.7%
 1: 10.18%
 2: 10.66%
 3: 10.43%
 4: 9.98%
 5: 9.92%
 6: 9.16%
 7: 9.8%
 8: 9.97%
 9: 10.2%

Output Analysis: random_range(10)
Typical Timing: 40 ± 1 ns
Statistics of 1000 samples:
 Minimum: 0
 Median: 4
 Maximum: 9
 Mean: 4.4
 Std Deviation: 2.8660450474851604
Distribution of 10000 samples:
 0: 10.08%
 1: 9.78%
 2: 10.29%
 3: 10.12%
 4: 9.62%
 5: 9.7%
 6: 10.77%
 7: 9.72%
 8: 9.87%
 9: 10.05%

Output Analysis: random_below(-10)
Typical Timing: 42 ± 2 ns
Statistics of 1000 samples:
 Minimum: -9
 Median: -4
 Maximum: 0
 Mean: -4.422
 Std Deviation: 2.8628852774975306
Distribution of 10000 samples:
 -9: 9.96%
 -8: 10.42%
 -7: 9.78%
 -6: 10.19%
 -5: 10.09%
 -4: 9.85%
 -3: 10.1%
 -2: 9.83%
 -1: 9.32%
 0: 10.46%

Output Analysis: random_index(-10)
Typical Timing: 44 ± 1 ns
Statistics of 1000 samples:
 Minimum: -10
 Median: -6
 Maximum: -1
 Mean: -5.515
 Std Deviation: 2.8635598430930296
Distribution of 10000 samples:
 -10: 9.44%
 -9: 10.15%
 -8: 10.31%
 -7: 9.71%
 -6: 10.39%
 -5: 9.79%
 -4: 10.11%
 -3: 10.12%
 -2: 9.81%
 -1: 10.17%

Output Analysis: random_range(-10)
Typical Timing: 53 ± 3 ns
Statistics of 1000 samples:
 Minimum: -10
 Median: -5
 Maximum: -1
 Mean: -5.46
 Std Deviation: 2.824247931109515
Distribution of 10000 samples:
 -10: 9.42%
 -9: 9.57%
 -8: 9.83%
 -7: 9.95%
 -6: 10.67%
 -5: 10.12%
 -4: 10.27%
 -3: 10.02%
 -2: 10.29%
 -1: 9.86%

Base Case
Output Analysis: Random.randrange(1, 10)
Typical Timing: 193 ± 4 ns
Statistics of 1000 samples:
 Minimum: 1
 Median: 5
 Maximum: 9
 Mean: 5.096
 Std Deviation: 2.5454396993964057
Distribution of 10000 samples:
 1: 10.89%
 2: 10.8%
 3: 11.46%
 4: 11.15%
 5: 11.33%
 6: 11.04%
 7: 10.73%
 8: 11.11%
 9: 11.49%

Output Analysis: random_range(1, 10)
Typical Timing: 42 ± 2 ns
Statistics of 1000 samples:
 Minimum: 1
 Median: 5
 Maximum: 9
 Mean: 4.811
 Std Deviation: 2.5771924493372476
Distribution of 10000 samples:
 1: 11.16%
 2: 11.57%
 3: 11.29%
 4: 11.15%
 5: 11.19%
 6: 10.49%
 7: 11.61%
 8: 10.53%
 9: 11.01%

Output Analysis: random_range(10, 1)
Typical Timing: 44 ± 1 ns
Statistics of 1000 samples:
 Minimum: 1
 Median: 5
 Maximum: 9
 Mean: 5.066
 Std Deviation: 2.5616803481711385
Distribution of 10000 samples:
 1: 11.32%
 2: 10.91%
 3: 10.62%
 4: 10.68%
 5: 11.47%
 6: 11.39%
 7: 11.08%
 8: 11.4%
 9: 11.13%

Base Case
Output Analysis: Random.randint(-5, 5)
Typical Timing: 211 ± 4 ns
Statistics of 1000 samples:
 Minimum: -5
 Median: 0
 Maximum: 5
 Mean: -0.172
 Std Deviation: 3.1954071143794223
Distribution of 10000 samples:
 -5: 9.1%
 -4: 9.43%
 -3: 9.43%
 -2: 9.05%
 -1: 8.65%
 0: 9.24%
 1: 9.35%
 2: 8.64%
 3: 9.21%
 4: 9.13%
 5: 8.77%

Output Analysis: random_int(-5, 5)
Typical Timing: 29 ± 1 ns
Statistics of 1000 samples:
 Minimum: -5
 Median: 0
 Maximum: 5
 Mean: 0.035
 Std Deviation: 3.290075926114715
Distribution of 10000 samples:
 -5: 9.38%
 -4: 9.6%
 -3: 8.92%
 -2: 9.07%
 -1: 8.77%
 0: 8.86%
 1: 8.91%
 2: 8.8%
 3: 9.29%
 4: 9.21%
 5: 9.19%

Output Analysis: random_uint(18446744073709551605, 18446744073709551615)
Typical Timing: 43 ± 3 ns
Statistics of 1000 samples:
 Minimum: 18446744073709551605
 Median: 18446744073709551610
 Maximum: 18446744073709551615
 Mean: 1.8446744073709552e+19
 Std Deviation: 3.105866289041659
Distribution of 10000 samples:
 18446744073709551605: 8.82%
 18446744073709551606: 9.03%
 18446744073709551607: 9.47%
 18446744073709551608: 9.1%
 18446744073709551609: 8.88%
 18446744073709551610: 9.39%
 18446744073709551611: 8.8%
 18446744073709551612: 9.37%
 18446744073709551613: 9.03%
 18446744073709551614: 9.05%
 18446744073709551615: 9.06%

Base Case
Output Analysis: Random.randrange(1, 20, 2)
Typical Timing: 221 ± 5 ns
Statistics of 1000 samples:
 Minimum: 1
 Median: 11
 Maximum: 19
 Mean: 10.026
 Std Deviation: 5.8049135239916385
Distribution of 10000 samples:
 1: 10.21%
 3: 10.31%
 5: 10.57%
 7: 10.17%
 9: 9.76%
 11: 9.74%
 13: 10.21%
 15: 9.5%
 17: 9.74%
 19: 9.79%

Output Analysis: random_range(1, 20, 2)
Typical Timing: 43 ± 4 ns
Statistics of 1000 samples:
 Minimum: 1
 Median: 9
 Maximum: 19
 Mean: 9.996
 Std Deviation: 5.722300999486896
Distribution of 10000 samples:
 1: 10.05%
 3: 9.56%
 5: 10.42%
 7: 10.47%
 9: 9.98%
 11: 9.84%
 13: 10.15%
 15: 10.03%
 17: 10.06%
 19: 9.44%

Output Analysis: random_range(1, 20, -2)
Typical Timing: 41 ± 2 ns
Statistics of 1000 samples:
 Minimum: 2
 Median: 12
 Maximum: 20
 Mean: 11.032
 Std Deviation: 5.841326655572097
Distribution of 10000 samples:
 2: 9.93%
 4: 10.2%
 6: 9.63%
 8: 9.75%
 10: 10.4%
 12: 9.73%
 14: 9.76%
 16: 10.45%
 18: 10.02%
 20: 10.13%

Output Analysis: random_range(20, 1, -2)
Typical Timing: 41 ± 2 ns
Statistics of 1000 samples:
 Minimum: 2
 Median: 10
 Maximum: 20
 Mean: 11.074
 Std Deviation: 5.8169029870164035
Distribution of 10000 samples:
 2: 9.78%
 4: 9.93%
 6: 10.16%
 8: 10.14%
 10: 10.3%
 12: 10.38%
 14: 9.96%
 16: 10.12%
 18: 9.36%
 20: 9.87%

Output Analysis: d(10)
Typical Timing: 30 ± 2 ns
Statistics of 1000 samples:
 Minimum: 1
 Median: 5
 Maximum: 10
 Mean: 5.582
 Std Deviation: 2.9085624861322366
Distribution of 10000 samples:
 1: 10.01%
 2: 9.96%
 3: 10.15%
 4: 10.11%
 5: 9.95%
 6: 10.3%
 7: 9.93%
 8: 9.83%
 9: 9.78%
 10: 9.98%

Output Analysis: dice(3, 6)
Typical Timing: 49 ± 2 ns
Statistics of 1000 samples:
 Minimum: 3
 Median: 11
 Maximum: 18
 Mean: 10.471
 Std Deviation: 2.901995964949052
Distribution of 10000 samples:
 3: 0.48%
 4: 1.42%
 5: 2.58%
 6: 4.76%
 7: 7.13%
 8: 9.71%
 9: 12.2%
 10: 12.51%
 11: 12.7%
 12: 11.38%
 13: 9.52%
 14: 7.02%
 15: 4.32%
 16: 2.71%
 17: 1.1%
 18: 0.46%

Output Analysis: ability_dice(4)
Typical Timing: 108 ± 5 ns
Statistics of 1000 samples:
 Minimum: 3
 Median: 12
 Maximum: 18
 Mean: 12.314
 Std Deviation: 2.873614737862691
Distribution of 10000 samples:
 3: 0.08%
 4: 0.27%
 5: 0.82%
 6: 1.46%
 7: 2.96%
 8: 4.85%
 9: 7.22%
 10: 9.42%
 11: 11.61%
 12: 13.07%
 13: 12.94%
 14: 12.26%
 15: 9.88%
 16: 7.09%
 17: 4.42%
 18: 1.65%

Output Analysis: plus_or_minus(5)
Typical Timing: 29 ± 2 ns
Statistics of 1000 samples:
 Minimum: -5
 Median: 0
 Maximum: 5
 Mean: 0.087
 Std Deviation: 3.164719015401912
Distribution of 10000 samples:
 -5: 9.08%
 -4: 9.25%
 -3: 9.32%
 -2: 8.91%
 -1: 9.67%
 0: 8.58%
 1: 9.31%
 2: 8.84%
 3: 8.55%
 4: 9.27%
 5: 9.22%

Output Analysis: plus_or_minus_linear(5)
Typical Timing: 38 ± 3 ns
Statistics of 1000 samples:
 Minimum: -5
 Median: 0
 Maximum: 5
 Mean: 0.044
 Std Deviation: 2.3945349857117972
Distribution of 10000 samples:
 -5: 2.55%
 -4: 5.45%
 -3: 8.43%
 -2: 10.99%
 -1: 14.14%
 0: 16.35%
 1: 14.12%
 2: 11.01%
 3: 8.09%
 4: 6.21%
 5: 2.66%

Output Analysis: plus_or_minus_gauss(5)
Typical Timing: 47 ± 2 ns
Statistics of 1000 samples:
 Minimum: -4
 Median: 0
 Maximum: 5
 Mean: -0.017
 Std Deviation: 1.5732724449967928
Distribution of 10000 samples:
 -5: 0.14%
 -4: 1.15%
 -3: 4.64%
 -2: 11.32%
 -1: 20.18%
 0: 24.35%
 1: 20.52%
 2: 11.85%
 3: 4.49%
 4: 1.12%
 5: 0.24%


Random Floats:
Base Case
Typical Timing: 23 ± 4 ns
Typical Timing: 22 ± 1 ns
Base Case
Output Analysis: Random.uniform(0.0, 10.0)
Typical Timing: 69 ± 3 ns
Statistics of 1000 samples:
 Minimum: 0.011491348414168767
 Median: (4.864106432965989, 4.87476386080537)
 Maximum: 9.998975606887786
 Mean: 4.9785131650173975
 Std Deviation: 2.9655419609680567
floor distribution of 10000:
 0: 10.18%
 1: 9.35%
 2: 10.04%
 3: 10.08%
 4: 10.19%
 5: 9.96%
 6: 9.76%
 7: 10.57%
 8: 10.18%
 9: 9.69%

Output Analysis: random_float(0.0, 10.0)
Typical Timing: 25 ± 2 ns
Statistics of 1000 samples:
 Minimum: 0.03210525587881108
 Median: (4.696951734946467, 4.709570710781074)
 Maximum: 9.961774148426375
 Mean: 4.867057634751466
 Std Deviation: 2.9069667036119227
floor distribution of 10000:
 0: 9.65%
 1: 9.93%
 2: 9.65%
 3: 10.26%
 4: 10.27%
 5: 9.86%
 6: 10.28%
 7: 10.82%
 8: 9.63%
 9: 9.65%

Base Case
Output Analysis: Random.triangular(0.0, 10.0, 5.0)
Typical Timing: 135 ± 3 ns
Statistics of 1000 samples:
 Minimum: 0.08318487265393275
 Median: (5.074400575842807, 5.076236960606817)
 Maximum: 9.86020329872816
 Mean: 5.074641841399253
 Std Deviation: 2.0463510010786328
round distribution of 10000:
 0: 0.5%
 1: 3.82%
 2: 8.18%
 3: 11.74%
 4: 15.27%
 5: 19.32%
 6: 16.51%
 7: 11.92%
 8: 8.21%
 9: 4.02%
 10: 0.51%

Output Analysis: triangular(0.0, 10.0, 5.0)
Typical Timing: 32 ± 1 ns
Statistics of 1000 samples:
 Minimum: 0.21886578707056858
 Median: (5.031083905154265, 5.033130381148204)
 Maximum: 9.78452945728682
 Mean: 4.982342578514234
 Std Deviation: 2.044268582894984
round distribution of 10000:
 0: 0.37%
 1: 4.02%
 2: 7.83%
 3: 12.55%
 4: 16.52%
 5: 19.23%
 6: 15.76%
 7: 11.4%
 8: 7.91%
 9: 4.08%
 10: 0.33%

Base Case
Output Analysis: Random.vonmisesvariate(0.0, 1.0)
Typical Timing: 341 ± 5 ns
Statistics of 1000 samples:
 Minimum: 0.0007364213608687178
 Median: (3.2146509907496976, 3.2230542329649627)
 Maximum: 6.282561190269031
 Mean: 3.137266146755877
 Std Deviation: 2.280037965797396
round distribution of 10000:
 0: 16.4%
 1: 21.61%
 2: 8.65%
 3: 4.69%
 4: 6.42%
 5: 17.56%
 6: 24.67%

Output Analysis: vonmises_variate(0.0, 1.0)
Typical Timing: 84 ± 3 ns
Statistics of 1000 samples:
 Minimum: 7.088059328659505e-05
 Median: (3.5055989465049833, 3.508751599689046)
 Maximum: 6.2730768899479425
 Mean: 3.2129097988310913
 Std Deviation: 2.2707594804908298
round distribution of 10000:
 0: 16.39%
 1: 21.58%
 2: 8.3%
 3: 4.9%
 4: 7.32%
 5: 17.04%
 6: 24.47%

Base Case
Output Analysis: Random.expovariate(2.0)
Typical Timing: 107 ± 2 ns
Statistics of 1000 samples:
 Minimum: 0.004825293155053518
 Median: (0.3339475590771567, 0.33504768894276243)
 Maximum: 4.924657346562189
 Mean: 0.5024383639101334
 Std Deviation: 0.5373505558771798
round distribution of 10000:
 0: 63.64%
 1: 31.26%
 2: 4.32%
 3: 0.68%
 4: 0.08%
 5: 0.02%

Output Analysis: exponential_variate(2.0)
Typical Timing: 28 ± 1 ns
Statistics of 1000 samples:
 Minimum: 0.0008941806654377442
 Median: (0.34448056659480314, 0.344557537072367)
 Maximum: 3.0533118950029623
 Mean: 0.5096220478734231
 Std Deviation: 0.50236109475291
round distribution of 10000:
 0: 62.87%
 1: 32.27%
 2: 4.27%
 3: 0.54%
 4: 0.05%

Base Case
Output Analysis: Random.gammavariate(1.0, 1.0)
Typical Timing: 154 ± 2 ns
Statistics of 1000 samples:
 Minimum: 0.0001043518216335623
 Median: (0.7238448324637033, 0.7306763314084282)
 Maximum: 7.489967691809953
 Mean: 1.066017494471302
 Std Deviation: 1.067530967972691
round distribution of 10000:
 0: 39.16%
 1: 38.38%
 2: 14.53%
 3: 4.67%
 4: 2.09%
 5: 0.76%
 6: 0.2%
 7: 0.16%
 8: 0.02%
 9: 0.02%
 10: 0.01%

Output Analysis: gamma_variate(1.0, 1.0)
Typical Timing: 32 ± 1 ns
Statistics of 1000 samples:
 Minimum: 0.002317786591353518
 Median: (0.6550548060085771, 0.6592478760092841)
 Maximum: 6.316459901730412
 Mean: 1.0054777222895088
 Std Deviation: 1.0299820868076435
round distribution of 10000:
 0: 39.55%
 1: 37.81%
 2: 14.32%
 3: 5.1%
 4: 1.98%
 5: 0.73%
 6: 0.33%
 7: 0.12%
 8: 0.04%
 9: 0.02%

Base Case
Output Analysis: Random.weibullvariate(1.0, 1.0)
Typical Timing: 145 ± 4 ns
Statistics of 1000 samples:
 Minimum: 0.0018598740936713763
 Median: (0.7184252544835716, 0.7204452672520786)
 Maximum: 8.937730186393916
 Mean: 1.015706636040901
 Std Deviation: 1.0140779194830194
round distribution of 10000:
 0: 39.15%
 1: 38.31%
 2: 13.99%
 3: 5.19%
 4: 2.19%
 5: 0.7%
 6: 0.29%
 7: 0.09%
 8: 0.07%
 9: 0.01%
 10: 0.01%

Output Analysis: weibull_variate(1.0, 1.0)
Typical Timing: 58 ± 2 ns
Statistics of 1000 samples:
 Minimum: 0.0008976759063179232
 Median: (0.6488083376899645, 0.6498074418129876)
 Maximum: 6.412002684271835
 Mean: 0.9987298818928606
 Std Deviation: 1.0025110411063485
round distribution of 10000:
 0: 39.52%
 1: 37.8%
 2: 14.71%
 3: 5.21%
 4: 1.7%
 5: 0.61%
 6: 0.29%
 7: 0.13%
 8: 0.03%

Base Case
Output Analysis: Random.normalvariate(0.0, 1.0)
Typical Timing: 241 ± 9 ns
Statistics of 1000 samples:
 Minimum: -2.975886446266224
 Median: (-0.034644481967302285, -0.03332564557428542)
 Maximum: 3.2915980692325637
 Mean: -0.03332087302211955
 Std Deviation: 0.9981712501163037
round distribution of 10000:
 -4: 0.02%
 -3: 0.71%
 -2: 5.84%
 -1: 24.44%
 0: 37.57%
 1: 24.81%
 2: 6.12%
 3: 0.48%
 4: 0.01%

Output Analysis: normal_variate(0.0, 1.0)
Typical Timing: 44 ± 3 ns
Statistics of 1000 samples:
 Minimum: -3.0006136683798967
 Median: (-0.04418867780200639, -0.03976817325860958)
 Maximum: 3.490472892098393
 Mean: -0.056023156777119124
 Std Deviation: 0.9771304060721205
round distribution of 10000:
 -4: 0.02%
 -3: 0.6%
 -2: 6.0%
 -1: 23.54%
 0: 39.24%
 1: 24.08%
 2: 6.06%
 3: 0.45%
 4: 0.01%

Base Case
Output Analysis: Random.lognormvariate(0.0, 1.0)
Typical Timing: 307 ± 8 ns
Statistics of 1000 samples:
 Minimum: 0.049952190226108
 Median: (0.973103795271095, 0.9740483847848048)
 Maximum: 42.36144152111983
 Mean: 1.654451546936058
 Std Deviation: 2.3731300362626664
round distribution of 10000:
 0: 24.14%
 1: 41.12%
 2: 15.86%
 3: 7.66%
 4: 3.94%
 5: 2.63%
 6: 1.43%
 7: 0.9%
 8: 0.57%
 9: 0.44%
 10: 0.27%
 11: 0.23%
 12: 0.16%
 13: 0.17%
 14: 0.06%
 15: 0.06%
 16: 0.09%
 17: 0.07%
 18: 0.05%
 19: 0.01%
 20: 0.03%
 21: 0.02%
 23: 0.01%
 24: 0.01%
 25: 0.03%
 32: 0.01%
 37: 0.01%
 40: 0.01%
 42: 0.01%

Output Analysis: log_normal_variate(0.0, 1.0)
Typical Timing: 65 ± 4 ns
Statistics of 1000 samples:
 Minimum: 0.039892082110843385
 Median: (1.050183988800905, 1.0511189773868062)
 Maximum: 23.405607550185486
 Mean: 1.5802205512040923
 Std Deviation: 1.8388570144462795
round distribution of 10000:
 0: 25.02%
 1: 41.51%
 2: 16.0%
 3: 7.22%
 4: 3.69%
 5: 2.25%
 6: 1.26%
 7: 0.87%
 8: 0.53%
 9: 0.38%
 10: 0.29%
 11: 0.21%
 12: 0.18%
 13: 0.09%
 14: 0.11%
 15: 0.07%
 16: 0.06%
 17: 0.03%
 18: 0.03%
 19: 0.05%
 20: 0.01%
 22: 0.02%
 23: 0.03%
 24: 0.01%
 25: 0.01%
 26: 0.01%
 27: 0.01%
 28: 0.01%
 29: 0.01%
 31: 0.01%
 33: 0.01%
 39: 0.01%

timer(beta_variate, 1.0, 1.0)
Typical Timing: 44 ± 1 ns

timer(pareto_variate, 1.0)
Typical Timing: 36 ± 2 ns

timer(bernoulli_variate, 0.5)
Typical Timing: 21 ± 1 ns

timer(binomial_variate, 3, 0.5)
Typical Timing: 85 ± 2 ns

timer(negative_binomial_variate, 3, 0.5)
Typical Timing: 56 ± 2 ns

timer(geometric_variate, 0.5)
Typical Timing: 38 ± 1 ns

timer(poisson_variate, 0.5)
Typical Timing: 39 ± 1 ns

timer(extreme_value_variate, 0.0, 2.0)
Typical Timing: 44 ± 1 ns

timer(chi_squared_variate, 5.0)
Typical Timing: 67 ± 4 ns

timer(cauchy_variate, 0.0, 2.0)
Typical Timing: 35 ± 1 ns

timer(fisher_f_variate, 2.0, 3.0)
Typical Timing: 83 ± 3 ns

timer(student_t_variate, 5.0)
Typical Timing: 84 ± 2 ns

Random Booleans:
Output Analysis: percent_true(33.33)
Typical Timing: 21 ± 1 ns
Statistics of 1000 samples:
 Minimum: False
 Median: False
 Maximum: True
 Mean: 0.322
 Std Deviation: 0.46747677432631296
Distribution of 10000 samples:
 False: 66.89%
 True: 33.11%


Shuffle Performance:
	some_small_list = [i for i in range(10)]
	some_med_list = [i for i in range(100)]
	some_large_list = [i for i in range(1000)]

Base Case:
Random.shuffle()  # fisher_yates in python
Typical Timing: 1405 ± 18 ns
Typical Timing: 12325 ± 182 ns
Typical Timing: 135945 ± 1404 ns

Fortuna.shuffle()  # knuth_b in cython
Typical Timing: 215 ± 7 ns
Typical Timing: 1945 ± 34 ns
Typical Timing: 18661 ± 726 ns

Fortuna.knuth_a()  # knuth_a in cython
Typical Timing: 445 ± 16 ns
Typical Timing: 3613 ± 30 ns
Typical Timing: 41406 ± 459 ns

Fortuna.fisher_yates()  # fisher_yates in cython
Typical Timing: 467 ± 8 ns
Typical Timing: 3590 ± 24 ns
Typical Timing: 41282 ± 163 ns


Clamp Performance:
smart_clamp(3, 2, 1) # should be 2:  2
Typical Timing: 38 ± 2 ns
float_clamp(3.0, 2.0, 1.0) # should be 2.0:  2.0
Typical Timing: 33 ± 3 ns


-------------------------------------------------------------------------
Total Test Time: 1.039 seconds
```


## Legal Information
Fortuna is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License. 
See online version of this license here: <http://creativecommons.org/licenses/by-nc/3.0/>

Other licensing options are available, please contact the author for details: [Robert Sharp](mailto:webmaster@sharpdesigndigital.com)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/BrokenShell/Fortuna",
    "name": "Fortuna",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "Fortuna, High Performance Random Value Toolkit, Random Patterns, Data Perturbation, Game Dice, WeightedChoice, Random Value Generator, Gaussian Distribution, Linear Distribution, TruffleShuffle, FlexCat, Percent True, ZeroCool, QuantumMonty, Custom Distribution, Rarity Table, D20, Generative Modeling, Multithreading Aware Random Engine, bernoulli, binomial, negative_binomial, geometric, poisson, lognormal, exponential, gamma, weibull, extreme_value, chi_squared, cauchy, fisher_f, student_t, pareto, vonmises, triangular",
    "author": "Robert Sharp",
    "author_email": "webmaster@sharpdesigndigital.com",
    "download_url": "https://files.pythonhosted.org/packages/c0/3f/5c3099c911aea13b1ba80310ae2e66c2d0bf693a9fa74d036af87c2b0f87/fortuna-5.5.8.tar.gz",
    "platform": "Darwin",
    "description": "# Fortuna: Generative Modeling Toolkit for Python3\n\u00a9 2024 Robert Sharp, all rights reserved.\n\nFortuna's main goal is to provide a quick and easy way to build custom random \nfunctions for your data that are byte-code fast and thread aware. Fortuna also \noffers a variety of high-performance random number functions like \n`random_range(start, stop, step)` and `dice(rolls, sides)`.\n\nThe core functionality of Fortuna (the Storm Engine) was created \nby the same developer - Robert Sharp. While Storm is a high quality, hardware \nseeded random engine - it is not appropriate for cryptography of any kind. \nFortuna is intended for games, data science, Generative A.I. and experimental \nprogramming... not security, hashing or gambling! Fortuna is free for \nnon-commercial use. Contact the developer for details about commercial licensing \nand current availability of FortunaPro.\n\n### Quick Install `$ pip install Fortuna`\n\n### Installation Notes:\n- Fortuna is optimized for macOS & Linux.\n- New in version 5, Fortuna now supports Windows.\n- Installation requires C++20 Compiler and C++20 Standard Library.\n- On Linux, Fortuna requires Python3 developer environment.\n\n### Installation Examples:\n- macOS & Windows\n  - `pip install Fortuna`\n- Linux & WSL: Debian (you may need sudo)\n  - `apt update`\n  - `apt upgrade`\n  - `apt install build-essential`\n  - `apt install python3-dev python3-pip`\n  - Optionally Make a Virtual Environment\n    - `apt install python3.11-venv`\n    - `python3 -m venv venv`\n    - `source venv/bin/activate`\n  - `pip install --upgrade pip setuptools wheel`\n  - `pip install Fortuna`\n\n\n### Sister Projects:\n- [MonkeyScope](https://pypi.org/project/MonkeyScope): Framework for testing non-deterministic components.\n- [Storm](https://github.com/BrokenShell/Storm): High Performance C++ Random Number Engine & Toolkit.\n\n\n---\n\n### Table of Contents:\n- Numeric Limits\n    - `Storm::Metrics`\n- Random Value Classes\n    - `RandomValue(Iterable[Any]) -> Callable -> Any`\n    - `TruffleShuffle(Iterable[Any]) -> Callable -> Any`\n    - `QuantumMonty(Iterable[Any]) -> Callable -> Any`\n    - `CumulativeWeightedChoice(Iterable[Tuple[int, Any]]) -> Callable -> Any`\n    - `RelativeWeightedChoice(Iterable[Tuple[int, Any]]) -> Callable -> Any`\n    - `FlexCat(Dict[str, Iterable[Any]]) -> Callable -> Any`\n- Random Value Functions\n    - `random_value(data: Sequence[Any]) -> Any`\n    - `cumulative_weighted_choice(Sequence[Tuple[int, Any]]) -> Any`\n    - `truffle_shuffle(data: Iterable[Any]) -> Callable -> Any`\n- Random Integer Functions\n    - `random_below(Integer) -> Integer`\n    - `random_int(Integer, Integer) -> Integer`\n    - `random_range(Integer, Integer, Integer) -> Integer`\n    - `d(Integer) -> Integer`\n    - `dice(Integer, Integer) -> Integer`\n    - `plus_or_minus(Integer) -> Integer`\n    - `plus_or_minus_linear(Integer) -> Integer`\n    - `plus_or_minus_gauss(Integer) -> Integer`\n    - `binomial_variate(Integer, Float) -> Integer`\n    - `negative_binomial_variate(Integer, Float) -> Integer`\n    - `geometric_variate(Float) -> Integer`\n    - `poisson_variate(Float) -> Integer`\n- Random Index Functions \n    - ZeroCool Specification: `f(N) -> [0, N)` or `f(-N) -> [-N, 0)`\n    - `random_index(Integer) -> Integer`\n    - `front_gauss(Integer) -> Integer`\n    - `middle_gauss(Integer) -> Integer`\n    - `back_gauss(Integer) -> Integer`\n    - `quantum_gauss(Integer) -> Integer`\n    - `front_poisson(Integer) -> Integer`\n    - `middle_poisson(Integer) -> Integer`\n    - `back_poisson(Integer) -> Integer`\n    - `quantum_poisson(Integer) -> Integer`\n    - `front_linear(Integer) -> Integer`\n    - `middle_linear(Integer) -> Integer`\n    - `back_linear(Integer) -> Integer`\n    - `quantum_linear(Integer) -> Integer`\n    - `quantum_monty(Integer) -> Integer`\n- Random Float Functions\n    - `canonical() -> Float`\n    - `random_float(Float, Float) -> Float`\n    - `triangular(Float, Float, Float) -> Float`\n    - `normal_variate(Float, Float) -> Float`\n    - `log_normal_variate(Float, Float) -> Float`\n    - `exponential_variate(Float) -> Float`\n    - `gamma_variate(Float, Float) -> Float`\n    - `weibull_variate(Float, Float) -> Float`\n    - `extreme_value_variate(Float, Float) -> Float`\n    - `chi_squared_variate(Float) -> Float`\n    - `cauchy_variate(Float, Float) -> Float`\n    - `fisher_f_variate(Float, Float) -> Float`\n    - `student_t_variate(Float) -> Float`\n    - `beta_variate(Float, Float) -> Float`\n    - `pareto_variate(Float) -> Float`\n    - `vonmises_variate(Float, Float) -> Float`\n- Random Boolean Functions\n    - `percent_true(Float) -> Boolean`\n    - `bernoulli_variate(Float) -> Boolean`\n- Inplace Shuffle Algorithms\n    - `shuffle(List[Any]) -> None`\n    - `knuth_a(List[Any]) -> None`\n    - `fisher_yates(List[Any]) -> None`\n- Utilities\n    - `seed(int) -> None`\n    - `sample(population: Sequence, k: int) -> List`\n    - `flatten(Object, *args, Boolean, **kwargs) -> Object`\n    - `smart_clamp(Integer, Integer, Integer) -> Integer`\n    - `float_clamp(Float, Float, Float) -> Float`\n    - `distribution_range(Callable, Integer, Integer) -> Callable`\n    - `max_unit() -> Unsigned Integer`\n    - `min_int() -> Integer`\n    - `max_int() -> Integer`\n    - `min_float() -> Float`\n    - `max_float() -> Float`\n    - `min_below() -> Float`\n    - `min_above() -> Float`\n- Development Log\n- Test Suite Output\n- Legal Information\n\n\n#### Numeric Limits:\n- Unsigned Integer: 64 bit unsigned integer.\n    - Range: 0-18446744073709551615, approximately 18.4 billion-billion\n- Integer: 64 bit signed integer.\n    - Range: \u00b19223372036854775807, approximately \u00b19.2 billion-billion\n- Float: 64 bit floating point.\n    - Range: \u00b11.7976931348623157e+308\n    - Epsilon Delta: 5e-305 to 5e-324, platform dependent\n\n----\n\n## Random Value Engines\n\n### Fortuna.RandomValue\n`Fortuna.RandomValue(collection: Iterable[Any], zero_cool=random_index, flat=True) -> Callable -> Value`\nRandom Value Engine Class that supports dependency injection.\n\nTakes an iterable (tuple) and a distribution function and returns\na callable to produce random values from the iterable with the same distribution.\n\n- @param collection :: Iterable of Values. Tuple recommended.\n- @param zero_cool :: Optional ZeroCool Callable, kwarg only. Default = random_index(). This function must follow the ZeroCool Spec.\n- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.\n- @return :: Callable Object. `Callable(*args, **kwargs) -> Value`\n    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.\n    - @return Value or Value(*args, **kwargs) if the value itself is callable. This is recursive.\n\n#### RandomValue Dependency Injection: Rare Apples Example\nRandomValue supports dependency injection, it is the only Fortuna class to do so.\nThe injected functor must follow the ZeroCool Specification:\nf(x: int) -> int in [0, x) with any distribution. Many ZeroCool functions are provided,\nin the following example we'll see front_linear and back_linear used together.\n\n> If one of the builtin ZeroCool distributions is required, it is \nhighly recommended to employ QuantumMonty rather than RandomValue. \nZeroCool distributions are used here for the demonstration of RandomValue only. \nQuantumMonty offers the same ZeroCool distributions, but with less overhead. \nRandomValue is specifically designed for custom dependency injection, \nwhere you might design your own distribution and use it with RandomValue.\n\n```python\nfrom Fortuna import RandomValue, front_linear, back_linear\n\n\n# Setup\nrandom_apple = RandomValue((\n    \"Delicious\", \n    \"Empire\", \n    \"Granny Smith\", \n    \"Honey Crisp\", \n    \"Macintosh\",\n), zero_cool=front_linear)\n\nrandom_fruit = RandomValue((\n    lambda: f\"Apple, {random_apple()}\",\n    \"Banana\",\n    \"Cherry\",\n    \"Grapes\",\n    \"Orange\",\n), zero_cool=back_linear)\n\n# Usage\nprint(random_fruit())\n# prints a random 'Fruit' with a compound linear distribution\n# where 'Delicious' is the most common 'Apple' and 'Apple' is the rarest 'Fruit'\n\n```\n#### QuantumMonty: Rare Apples Example\nSame as above but with QuantumMonty - for syntax comparison.\n```python\nfrom Fortuna import QuantumMonty\n\n\n# Setup\nrandom_apple = QuantumMonty((\n    \"Delicious\", \n    \"Empire\", \n    \"Granny Smith\", \n    \"Honey Crisp\", \n    \"Macintosh\",\n)).front_linear\n\nrandom_fruit = QuantumMonty((\n    lambda: f\"Apple, {random_apple()}\",\n    \"Banana\",\n    \"Cherry\",\n    \"Grapes\",\n    \"Orange\",\n)).back_linear\n\n# Usage\nprint(random_fruit())\n# prints a random fruit with the correct compound distribution\n```\n\n### Auto Flattening\nAuto Flattening works with all random generator classes in Fortuna, and it's on by default.\nFlattening is lazy: it happens at call time as the last step. \nFlattening is recursive: this allows a nested lambda stack to be collapsed automatically.\nFlattening is resilient: if for any reason a callable can not be flatted - it will \nbe returned in an un-flattened state without error. \n\n#### Example: RandomValue with Auto Flattening\n```python\nfrom Fortuna import RandomValue\n\n\nauto_flat = RandomValue([lambda: 1, lambda: 2, lambda: 3])\nprint(auto_flat())  # will print the value 1, 2 or 3.\n# Note: the lambda will not be called until call time and stays dynamic for the life of the object.\n\nauto_flat_with = RandomValue([lambda x: x, lambda x: x + 1, lambda x:  x + 2])\nprint(auto_flat_with(2))  # will print the value 2, 3 or 4\n# Note: if this is called with no args it will simply return the lambda in an uncalled state.\n\nun_flat = RandomValue([lambda: 1, lambda: 2, lambda: 3], flat=False)\nprint(un_flat()())  # will print the value 1, 2 or 3, \n# mind the double-double parenthesis, they are required to manually unpack the lambdas\n\nauto_un_flat = RandomValue([lambda x: x, lambda x: x + 1, lambda x:  x + 2], flat=False)\n# Note: flat=False is not required here because the lambdas can not be called without input x satisfied.\n# It is recommended to specify flat=False if non-flat output is intended.\nprint(auto_un_flat()(1))  # will print the value 1, 2 or 3, mind the double-double parenthesis.\n```\n\n#### Mixing Static Objects with Callable Objects\nAuto Flattening works with all random generator classes in Fortuna, and it's on by default.\n```python\nfrom Fortuna import RandomValue\n\n\n\"\"\" With automatic flattening active, `lambda() -> int` can be treated as an `int`. \"\"\"\nmixed_flat = RandomValue([1, 2, lambda: 3])\nprint(mixed_flat())  # will print 1, 2 or 3\n\n\"\"\" Mixed Anti-pattern \"\"\"\nmixed_un_flat = RandomValue([1, 2, lambda: 3], flat=False) # this is not recommended.\nprint(mixed_flat())  # will print 1, 2 or \"Function <lambda at some_address>\"\n# This pattern is not recommended because you won't know the nature of what you get back.\n# This is almost always not what you want, and it can give rise to messy logic in other areas of your code.\n```\n\n#### Dynamic Strings\nTo successfully express a dynamic string, and keep it dynamic for the duration of the program, at least one level of indirection is required. Without a lambda - the f-string would collapse into a static string too soon.\nThis works with all random generator classes in Fortuna.\n\n```python\nfrom Fortuna import RandomValue, d\n\n\n# d() is a simple dice function, d(n) -> [1, n] flat uniform distribution.\ndynamic_string = RandomValue((\n    # while the probability of all A == all B == all C, individual probabilities of each possible string will differ based on the number of possible outputs of each category.\n    lambda: f\"A{d(2)}\",  # -> A1 - A2, each are twice as likely as any particular B, and three times as likely as any C.\n    lambda: f\"B{d(4)}\",  # -> B1 - B4, each are half as likely as any particular A, and 3/2 as likely as any C.\n    lambda: f\"C{d(6)}\",  # -> C1 - C6, each are 1/3 as likely as any particular A and 2/3 as likely of any B.\n))\n\nprint(dynamic_string())  # prints a random dynamic string, generated at call time.\n```\n\n### TruffleShuffle\n`Fortuna.TruffleShuffle(collection: Iterable[Any], flat=True) -> Callable -> Value`\n- @param collection :: Iterable of Values. Set recommended but not required.\n- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.\n- @return :: Callable Object. `Callable(*args, **kwargs) -> Value`\n    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.\n    - @return :: Random value from the collection with a Wide Uniform Distribution. \n    \nWide Uniform Distribution: \"Wide\" refers to the average distance between consecutive occurrences of the same value. The average width of the output distribution will naturally scale up with the size of the collection. The goal of this type of distribution is to keep the output sequence free of clumps or streaks of the same value, while maintaining randomness and uniform probability. This is not the same as a flat uniform distribution. The two distributions over time will be statistically similar for any given set, but the repetitiveness of the output sequence will be very different.\n\n#### TruffleShuffle, Basic Use\n```python\nfrom Fortuna import TruffleShuffle\n\n# Setup\nlist_of_values = { 1, 2, 3, 4, 5, 6 }\ntruffle_shuffle = TruffleShuffle(list_of_values)\n\n# Usage\nprint(truffle_shuffle())  # this will print one of the numbers 1-6, \n# repeated calls will produce a wide distribution.\n```\n\n#### Nesting Dolls\nThis works with all random generator classes in Fortuna, interchangeably.\n```python\nfrom Fortuna import RandomValue, TruffleShuffle\n\n# Setup\nnesting_dolls = TruffleShuffle((\n    RandomValue((\"A\", \"B\", \"C\", \"D\", \"E\")),\n    RandomValue((\"F\", \"G\", \"H\", \"I\", \"J\")),\n    RandomValue((\"K\", \"L\", \"M\", \"N\", \"O\")),\n    RandomValue((\"P\", \"Q\", \"R\", \"S\", \"T\")),\n))\n\n# Usage\nprint(nesting_dolls())  \n# Prints one of the letters A-T.\n# Produces a wide distribution of each category -\n# and a flat uniform distribution within each category.\n```\n\n### QuantumMonty\n`Fortuna.QuantumMonty(collection: Iterable[Any], flat=True) -> Callable -> Value`\n- @param collection :: Iterable of Values. Tuple recommended.\n- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.\n- @return :: Callable Object with Monty Methods for producing various distributions of the data.\n    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.\n    - @return :: Random value from the data. The instance will produce random values from the list using the selected distribution model or \"monty\". The default monty is the Quantum Monty Algorithm.\n\n```python\nfrom Fortuna import QuantumMonty\n\n# Setup\nlist_of_values = [1, 2, 3, 4, 5, 6]\nmonty = QuantumMonty(list_of_values)\n\n# Usage\nprint(monty())               # prints a random value from the list_of_values\n                             # uses the default Quantum Monty Algorithm\n\nprint(monty.flat_uniform())  # prints a random value from the list_of_values\n                             # uses the \"flat_uniform\" monty\n                             # equivalent to random.choice(list_of_values)\n```\nThe QuantumMonty class represents a diverse collection of strategies for producing random values from a sequence where the output distribution is based on the method you choose. Generally speaking, each value in the sequence will have a probability that is based on its position in the sequence. For example: the \"front\" monty produces random values where the beginning of the sequence is geometrically more common than the back. Given enough samples the \"front\" monty will always converge to a 45 degree slope down for any list of unique values.\n\nThere are three primary method families: linear, gaussian, and poisson. Each family has three base methods; 'front', 'middle', 'back', plus a 'quantum' method that incorporates all three base methods. The quantum algorithms for each family produce distributions by overlapping the probability waves of the other methods in their family. The Quantum Monty Algorithm incorporates all nine base methods.\n\n```python\nimport Fortuna\n\n# Setup\nmonty = Fortuna.QuantumMonty(\n    [\"Alpha\", \"Beta\", \"Delta\", \"Eta\", \"Gamma\", \"Kappa\", \"Zeta\"]\n)\n\n# Usage\n# Each of the following methods will return a random value from the sequence.\n# Each method has its own unique distribution model.\n\n\"\"\" Flat Base Case \"\"\"\nmonty.flat_uniform()        # Flat Uniform Distribution\n\n\"\"\" Geometric Positional \"\"\"\nmonty.front_linear()        # Linear Descending, Triangle\nmonty.middle_linear()       # Linear Median Peak, Equilateral Triangle\nmonty.back_linear()         # Linear Ascending, Triangle\nmonty.quantum_linear()      # Linear Overlay, 3-way monty.\n\n\"\"\" Gaussian Positional \"\"\"\nmonty.front_gauss()         # Front Gamma\nmonty.middle_gauss()        # Scaled Gaussian\nmonty.back_gauss()          # Reversed Gamma\nmonty.quantum_gauss()       # Gaussian Overlay, 3-way monty.\n\n\"\"\" Poisson Positional \"\"\"\nmonty.front_poisson()       # 1/4 Mean Poisson\nmonty.middle_poisson()      # 1/2 Mean Poisson\nmonty.back_poisson()        # 3/4 Mean Poisson\nmonty.quantum_poisson()     # Poisson Overlay, 3-way monty.\n\n\"\"\" Quantum Monty Algorithm: Default Monty \"\"\"\nmonty()                     # Quantum Monty Algorithm, 9-way monty.\nmonty.quantum_monty()       #  same as above\n```\n\n### Weighted Choice: Base Class\nWeighted Choice offers two strategies for selecting random values from a sequence where programmable rarity is desired. Both produce a custom distribution of values based on the weights of the values.\n\nThe choice to use one strategy over the other is purely about which one suits you or your data best. Relative weights are easier to understand at a glance. However, many RPG Treasure Tables map rather nicely to a cumulative weighted strategy.\n\n#### Cumulative Weighted Choice\n`Fortuna.CumulativeWeightedChoice(weighted_table: Iterable[Tuple[int, Any]], flat=True) -> Callable -> Value`\n- @param weighted_table :: Table of weighted pairs. Tuple of Tuples recommended.\n- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.\n- @return :: Callable Instance\n    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.\n    - @return :: Random value from the weighted_table, distribution based on the weights of the values.\n\n_Note: Logic dictates Cumulative Weights must be unique!_\n\n```python\nfrom Fortuna import CumulativeWeightedChoice\n\n# Setup\ncum_weighted_choice = CumulativeWeightedChoice((\n    (7, \"Apple\"),\n    (11, \"Banana\"),\n    (13, \"Cherry\"),\n    (23, \"Grape\"),\n    (26, \"Lime\"),\n    (30, \"Orange\"),  # same as relative weight 4 because 30 - 26 = 4\n))\n# Usage\nprint(cum_weighted_choice())  # prints a weighted random value\n```\n\n#### Relative Weighted Choice\n`Fortuna.RelativeWeightedChoice(weighted_table: Iterable[Tuple[int, Any]]) -> Callable -> Value`\n- @param weighted_table :: Table of weighted pairs. Tuple of Tuples recommended.\n- @param flat :: Bool. Default: True. Option to automatically flatten callable values with lazy evaluation.\n- @return :: Callable Instance\n    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.\n    - @return :: Random value from the weighted_table, distribution based on the weights of the values.\n\n```python\nfrom Fortuna import RelativeWeightedChoice\n\n# Data\npopulation = [\"Apple\", \"Banana\", \"Cherry\", \"Grape\", \"Lime\", \"Orange\"]\nrel_weights = [7, 4, 2, 10, 3, 4]\n\n# Setup\nrel_weighted_choice = RelativeWeightedChoice(zip(rel_weights, population))\n\n# Usage\nprint(rel_weighted_choice())  # prints a weighted random value\n```\n\n### FlexCat\n`Fortuna.FlexCat(matrix_data: Matrix, key_bias=\"front_linear\", val_bias=\"truffle_shuffle\", flat=True) -> Callable -> Value`\n- @param matrix_data :: Dictionary of Sequences. `Dict[str, Iterable[Any]]`\n- @parm key_bias :: Default is \"front_linear\". String indicating the name of the algorithm to use for random key selection.\n- @parm val_bias :: Default is \"truffle_shuffle\". String indicating the name of the algorithm to use for random value selection.\n- @param flat :: Bool. Default is True. Option to automatically flatten callable values with lazy evaluation.\n- @return :: Callable Instance\n    - @param cat_key :: Optional String. Default is None. Key selection by name. If specified, this will override the key_bias for a single call.\n    - @param *args, **kwargs :: Optional arguments used to flatten the return Value (below) if Callable.\n    - @return :: Value. Returns a random value generated with val_bias from a random sequence generated with key_bias.\n\nFlexCat is like a multidimensional QuantumMonty.\n\nThe constructor takes two optional keyword arguments to specify the algorithms to be used to make random selections. The algorithm specified for selecting a key need not be the same as the one for selecting values. An optional key may be provided at call time to bypass the random key selection. Keys passed in this way must exactly match a key in the Matrix.\n\nBy default, FlexCat will use key_bias=\"front_linear\" and val_bias=\"truffle_shuffle\", this will make the top of the data structure geometrically more common than the bottom, and it will truffle shuffle the sequence values. This config is known as TopCat, it produces a descending-step, micro-shuffled distribution sequence. Many other combinations are available.\n\nAlgorithmic Options: _See QuantumMonty & TruffleShuffle for more details._\n- \"front_linear\", Linear Descending\n- \"middle_linear\", Linear Median Peak\n- \"back_linear\", Linear Ascending\n- \"quantum_linear\", Linear 3-way monty\n- \"front_gauss\", Gamma Descending\n- \"middle_gauss\", Scaled Gaussian\n- \"back_gauss\", Gamma Ascending\n- \"quantum_gauss\", Gaussian 3-way monty\n- \"front_poisson\", Front 1/3 Mean Poisson\n- \"middle_poisson\", Middle Mean Poisson\n- \"back_poisson\", Back 1/3 Mean Poisson\n- \"quantum_poisson\", Poisson 3-way monty\n- \"quantum_monty\", Quantum Monty Algorithm, 9-way monty\n- \"flat_uniform\", uniform flat distribution\n- \"truffle_shuffle\", TruffleShuffle wide uniform distribution\n\n```python\nfrom Fortuna import FlexCat, d\n\n\n#                           |- Collection Generator, does not require lambda.\n# Data                      |\nmatrix_data = {#            $                         |- Dynamic Value Expression\n    \"Cat_A\": (f\"A{i}\" for i in range(1, 6)),  #       |  Lazy, 1 of 4 possibilities\n    \"Cat_B\": (\"B1\", \"B2\", \"B3\", \"B4\", \"B5\"),  #       $  lambda required for dynamic eval\n    \"Cat_C\": (\"C1\", \"C2\", \"C3\", f\"C4.{d(2)}\", lambda: f\"C5.{d(4)}\"),\n}#   $       $       $              $                        $\n#    |       |       |- Value       |                        |- Fair die method: d4\n#    |       |                      |\n#    |       |- Collection          |- Static Value Expression\n#    |                              |  Eager, 1 or 2 permanently\n#    |- Collection Key, \"cat_key\"\n\n#                               |- Collection Algorithm     |- Value Algorithm\n# Setup                         $  y-axis                   $  x-axis\nflex_cat = FlexCat(matrix_data, key_bias=\"front_linear\", val_bias=\"flat_uniform\")\n#    $       $       $\n#    |       |       |- Dictionary of Collections\n#    |       |\n#    |       |- FlexCat Constructor\n#    |       \n#    |- Callable Random Value Generator\n\n# Usage\nflex_cat()  # returns a Value from the Matrix.\nflex_cat(cat_key=\"Cat_B\")  # returns a Value specifically from the \"Cat_B\" Collection.\n```\n### Random Value Functions\n`Fortuna.random_value(Sequence[Any]) -> Any`\n\nEssentially the same as Random.choice()\n- @param data :: Sequence of Values\n- @return :: Random value from the sequence. Flat uniform distribution.\n\n`Fortuna.cumulative_weighted_choice(weighted_table: Sequence[Tuple[int, Any]]) -> Any`\n\nSimilar to Random.choices()\n- @param weighted_table :: Sequence of weighted value pairs. `[(w1, v1), (w2, v2)...]`\n- @return :: Returns a random value. Distribution depends on weights.\n\n### Random Integer Functions\n`Fortuna.random_below(limit: int) -> int`\n- @param limit :: Any 64bit Integer\n- @return :: Returns a random integer in the range...\n    - `random_below(N) -> [0, N)` for positive limit.\n    - `random_below(N) -> (N, 0]` for negative limit.\n    - `random_below(0) -> 0` Always returns zero when limit is zero\n- Flat uniform distribution.\n\n\n`Fortuna.random_int(left_limit: int, right_limit: int) -> int`\n\nEssentially the same as Random.randint()\n- @param left_limit :: Any Integer\n- @param right_limit :: Any Integer\n- @return :: Returns a random integer in the range [left_limit, right_limit]\n    - `random_int(1, 10) -> [1, 10]`\n    - `random_int(10, 1) -> [1, 10]` same as above.\n    - `random_int(A, B)` Always returns A when A == B\n- Flat uniform distribution.\n\n\n`Fortuna.random_range(start: int, stop: int = 0, step: int = 1) -> int`\n\nEssentially the same as Random.randrange()\n- @param start :: Required starting point.\n    - `random_range(0) -> [0]`\n    - `random_range(10) -> [0, 10)` from 0 to 9. Same as `Fortuna.random_index(N)`\n    - `random_range(-10) -> [-10, 0)` from -10 to -1. Same as `Fortuna.random_index(-N)`\n- @param stop :: Zero by default. Optional range bound. With at least two arguments, the order of the first two does not matter.\n    - `random_range(0, 0) -> [0]`\n    - `random_range(0, 10) -> [0, 10)` from 0 to 9.\n    - `random_range(10, 0) -> [0, 10)` same as above.\n- @param step :: One by default. Optional step size.\n    - `random_range(0, 0, 0) -> [0]`\n    - `random_range(0, 10, 2) -> [0, 10) by 2` even numbers from 0 to 8.\n    - The sign of the step parameter controls the phase of the output. Negative stepping will flip the inclusive rule.\n    - `random_range(0, 10, -1) -> (0, 10]` starts at 10 and ranges down to 1.\n    - `random_range(10, 0, -1) -> (0, 10]` same as above.\n    - `random_range(10, 10, 0) -> [10]` step size or range size of zero always returns the first parameter.\n- @return :: Returns a random integer in the range [A, B) by increments of C.\n- Flat uniform distribution.\n\n\n`Fortuna.d(sides: int) -> int`\n\nRepresents a single roll of a given size die.\n- @param sides :: Represents the size or number of sides, most commonly six.\n- @return :: Returns a random integer in the range [1, sides].\n- Flat uniform distribution.\n\n\n`Fortuna.dice(rolls: int, sides: int) -> int`\n\nRepresents the sum total of multiple rolls of the same size die.\n- @param rolls :: Represents the number of times to roll the die.\n- @param sides :: Represents the die size or number of sides, most commonly six.\n- @return :: Returns a random integer in range [X, Y] where X = rolls and Y = rolls * sides.\n- Geometric distribution based on the number and size of the dice rolled.\n- Complexity scales primarily with the number of rolls, not the size of the dice.\n\n\n`Fortuna.plus_or_minus(number: int) -> int`\n- @param number :: input to determine the output distribution range.\n- @return :: Returns a random integer in range [-number, number].\n- Flat uniform distribution.\n\n\n`Fortuna.plus_or_minus_linear(number: int) -> int`\n- @param number :: input to determine the output distribution range.\n- @return :: Returns a random integer in range [-number, number].\n- Linear geometric, 45 degree triangle distribution centered on zero.\n\n\n`Fortuna.plus_or_minus_gauss(number: int) -> int`\n- @param number :: input to determine the output distribution range.\n- @return :: Returns a random integer in range [-number, number].\n- Stretched gaussian distribution centered on zero.\n\n\n`Fortuna.binomial_variate(number_of_trials: int, probability: float) -> int`\n- Based on the idea of flipping a coin and counting how many heads come up after some number of flips.\n- @param number_of_trials :: how many times to flip a coin.\n- @param probability :: how likely heads will be flipped. 0.5 is a fair coin. 1.0 is a double-headed coin.\n- @return :: count of how many heads came up.\n\n\n`Fortuna.negative_binomial_variate(trial_successes: int, probability: float) -> int`\n- Based on the idea of flipping a coin as long as it takes to succeed.\n- @param trial_successes :: the required number of heads flipped to succeed.\n- @param probability :: how likely heads will be flipped. 0.50 is a fair coin.\n- @return :: the count of how many tails came up before the required number of heads.\n\n\n`Fortuna.geometric_variate(probability: float) -> int`\n- Same as random_negative_binomial(1, probability). \n\n\n`Fortuna.poisson_variate(mean: float) -> int`\n- @param mean :: sets the average output of the function.\n- @return :: random integer, poisson distribution centered on the mean.\n\n\n### Random Index, ZeroCool Specification\nZeroCool Methods are used to generate random Sequence indices.\n\nZeroCool methods must have the following properties:\n- Any distribution model is acceptable such that...\n- The method or function must take exactly one Integer parameter N.\n- The method returns a random int in range `[0, N)` for positive values of N.\n- The method returns a random int in range `[N, 0)` for negative values of N.\n- This symmetry matches how python can index a list from the back for negative values or the front for positive values of N.\n\n\n```python\nfrom Fortuna import random_index\n\n\nsome_list = [i for i in range(100)] # [0..99]\n\nprint(some_list[random_index(10)])  # prints one of the first 10 items of some_list, [0, 9]\nprint(some_list[random_index(-10)])  # prints one of the last 10 items of some_list, [90, 99]\n```\n### ZeroCool Methods\n- `Fortuna.random_index(size: int) -> int` Flat uniform distribution\n- `Fortuna.front_gauss(size: int) -> int` Gamma Distribution: Front Peak\n- `Fortuna.middle_gauss(size: int) -> int` Stretched Gaussian Distribution: Median Peak\n- `Fortuna.back_gauss(size: int) -> int` Gamma Distribution: Back Peak\n- `Fortuna.quantum_gauss(size: int) -> int` Quantum Gaussian: Three-way Monty\n- `Fortuna.front_poisson(size: int) -> int` Poisson Distribution: Front 1/3 Peak\n- `Fortuna.middle_poisson(size: int) -> int` Poisson Distribution: Middle Peak\n- `Fortuna.back_poisson(size: int) -> int` Poisson Distribution: Back 1/3 Peak\n- `Fortuna.quantum_poisson(size: int) -> int` Quantum Poisson: Three-way Monty\n- `Fortuna.front_geometric(size: int) -> int` Linear Geometric: 45 Degree Front Peak\n- `Fortuna.middle_geometric(size: int) -> int` Linear Geometric: 45 Degree Middle Peak\n- `Fortuna.back_geometric(size: int) -> int` Linear Geometric: 45 Degree Back Peak\n- `Fortuna.quantum_geometric(size: int) -> int` Quantum Geometric: Three-way Monty\n- `Fortuna.quantum_monty(size: int) -> int` Quantum Monty: Nine-way Monty\n\n```python\nfrom Fortuna import front_gauss, middle_gauss, back_gauss, quantum_gauss\n\n\nsome_list = [i for i in range(100)]\n\n# Each of the following prints one of the first 10 items of some_list with the appropriate distribution\nprint(some_list[front_gauss(10)])\nprint(some_list[middle_gauss(10)])\nprint(some_list[back_gauss(10)])\nprint(some_list[quantum_gauss(10)])\n\n# Each of the following prints one of the last 10 items of some_list with the appropriate distribution\nprint(some_list[front_gauss(-10)])  \nprint(some_list[middle_gauss(-10)])  \nprint(some_list[back_gauss(-10)])  \nprint(some_list[quantum_gauss(-10)])\n```\n\n### Random Float Functions\n`Fortuna.canonical() -> float`\n- @return :: random float in range [0.0, 1.0), flat uniform.\n\n`Fortuna.random_float(a: Float, b: Float) -> Float`\n- @param a :: Float input\n- @param b :: Float input\n- @return :: random Float in range `[a, b)`, flat uniform distribution.\n\n`Fortuna.triangular(low: Float, high: Float, mode: Float) -> Float`\n- @param low :: Float, minimum output\n- @param high :: Float, maximum output\n- @param mode :: Float, most common output, mode must be in range `[low, high]`\n- @return :: random Float in range `[low, high]` with a linear distribution about the mode.\n\n`Fortuna.normal_variate(mean: Float, std_dev: Float) -> Float`\n- @param mean :: Float, sets the average output of the function.\n- @param std_dev :: Float, standard deviation. Specifies spread of data from the mean.\n\n`Fortuna.log_normal_variate(log_mean: Float, log_deviation: Float) -> Float`\n- @param log_mean :: Float, sets the log of the mean of the function.\n- @param log_deviation :: Float, log of the standard deviation. Specifies spread of data from the mean.\n\n`Fortuna.exponential_variate(lambda_rate: Float) -> Float`\n- Produces random non-negative floating-point values, distributed according to probability density function.\n- @param lambda_rate :: Float, \u03bb constant rate of a random event per unit of time/distance.\n- @return :: Float, the time/distance until the next random event. For example, this distribution describes the time between the clicks of a Geiger counter or the distance between point mutations in a DNA strand.\n\n`Fortuna.gamma_variate(shape: Float, scale: Float) -> Float`\n- Generalization of the exponential distribution.\n- Produces random positive floating-point values, distributed according to probability density function.    \n- @param shape :: Float, \u03b1 the number of independent exponentially distributed random variables.\n- @param scale :: Float, \u03b2 the scale factor or the mean of each of the distributed random variables.\n- @return :: Float, the sum of \u03b1 independent exponentially distributed random variables, each of which has a mean of \u03b2.\n\n`Fortuna.weibull_variate(shape: Float, scale: Float) -> Float`\n- Generalization of the exponential distribution.\n- Similar to the gamma distribution but uses a closed form distribution function.\n- Popular in reliability and survival analysis.\n\n`Fortuna.extreme_value_variate(location: Float, scale: Float) -> Float`\n- Based on Extreme Value Theory. \n- Used for statistical models of the magnitude of earthquakes and volcanoes.\n\n`Fortuna.chi_squared_variate(degrees_of_freedom: Float) -> Float`\n- Used with the Chi Squared Test and Null Hypotheses to test if sample data fits an expected distribution.\n\n`Fortuna.cauchy_variate(location: Float, scale: Float) -> Float`\n- @param location :: Float, specifies the location of the peak. The default value is 0.0.\n- @param scale :: Float, represents the half-width at half-maximum. The default value is 1.0.\n- @return :: Float, Continuous Distribution.\n\n`Fortuna.fisher_f_variate(degrees_of_freedom_1: Float, degrees_of_freedom_2: Float) -> Float`\n- F distributions often arise when comparing ratios of variances.\n\n`Fortuna.student_t_variate(degrees_of_freedom: Float) -> Float`\n- T distribution. Same as a normal distribution except it uses the sample standard deviation rather than the population standard deviation.\n- As degrees_of_freedom goes to infinity it converges with the normal distribution.\n\n`Fortuna.beta_variate(alpha: Float, beta: Float) -> Float`\n\n`Fortuna.pareto_variate(alpha: Float) -> Float`\n\n`Fortuna.vonmises_variate(mu: Float, kappa: Float) -> Float`\n\n\n### Random Truth Functions\n`Fortuna.percent_true(truth_factor: Float = 50.0) -> Boolean`\n- Produces a distribution of boolean values.\n- @param truth_factor :: Float, probability of True as a percentage. Default is 50 percent. Expected input range: `[0.0, 100.0]`, clamped.\n- @return :: Produces True or False based on the truth_factor as a percent of true.\n\n`Fortuna.bernoulli_variate(ratio_of_truth: Float) -> Boolean`\n- Produces a Bernoulli distribution of boolean values.\n- @param ratio_of_truth :: Float, the probability of True as a ratio. Expected input range: `[0.0, 1.0]`, clamped.\n- @return :: True or False\n\n\n### Shuffle Algorithm\n`Fortuna.shuffle(array: List[Any]) -> None`\n- Knuth B Shuffle Algorithm. Destructive, in-place shuffle.\n- @param array :: List to be shuffled.\n- @return :: None\n\n`Fortuna.knuth_a(array: List[Any]) -> None`\n- Knuth A Shuffle Algorithm. Destructive, in-place shuffle.\n- @param array :: List to be shuffled.\n- @return :: None\n\n`Fortuna.fisher_yates(array: List[Any]) -> None`\n- Fisher Yates Shuffle Algorithm. Destructive, in-place shuffle.\n- @param array :: List to be shuffled.\n- @return :: None\n\n\n### Utilities\n`Fortuna.sample(population: Sequence, k: int) -> List`\n- Replacement for `random.sample`, approximately 2x performance.\n- @param population :: Sequence of Any.\n- @param k :: Represents the number of samples to be returned. Param k must be <= len(population).\n- @return :: Returns list of k random samples from the population data without duplication.\n\n`Fortuna.flatten(maybe_callable, *args, flat=True, **kwargs) -> flatten(maybe_callable(*args, **kwargs))`\n- Recursively calls the input object and returns the result. The arguments are only passed in on the first evaluation.\n- If the maybe_callable is not callable it is simply returned without error. \n- Conceptually this is somewhat like collapsing the wave function. Often used as the last step in lazy evaluation.\n- @param maybe_callable :: Any Object that might be callable.\n- @param flat :: Boolean, default is True. Optional, keyword only. Disables flattening if flat is set to False, conceptually turns flatten into the identity function.\n- @param *args, **kwargs :: Optional arguments used to flatten the maybe_callable object.\n- @return :: Recursively Flattened Object.\n\n`Fortuna.smart_clamp(target: int, lo: int, hi: int) -> int`\n- Used to clamp the target in range `[lo, hi]` by saturating the bounds.\n- Essentially the same as median for exactly three integers.\n- @return :: Returns the middle value, input order does not matter (unlike std::clamp).\n\n`Fortuna.float_clamp(target: float, lo: float, hi: float) -> float`\n- Used to clamp the target in range `[lo, hi]` by saturating the bounds.\n- Essentially the same as median for exactly three floats.\n- @return :: Returns the middle value, input order does not matter (unlike std::clamp).\n\n`Fortuna.distribution_range(func: Callable, lo: int, hi: int) -> Callable`\nHigher-order function for producing integer distribution ranges based on a ZeroCool function.\nIf given a function like random_below, this function will produce random values\nwith the same distribution but in the range lo to hi, rather than from zero to N-1.\nEssentially, this turns a function like random_below(B+1) into random_int(A, B).\n\n- @param func: ZeroCool random distribution, F(N) -> `[0, N-1]`\n- @param lo: minimum limit\n- @param hi: maximum limit\n- @return: Callable() -> int\n    - @return: random value in range `[lo, hi]`\n\n`Fortuna.max_uint() -> int`\nMaximum unsigned integer. Should be 18446744073709551615.\n\n`Fortuna.max_int() -> int`\nMaximum integer. Should be 9223372036854775807.\n\n`Fortuna.min_int() -> int`\nMinimum integer. Should be -9223372036854775807.\n\n`Fortuna.max_float() -> float`\nMaximum floating point. Should be 1.7976931348623157e+308.\n\n`Fortuna.min_float() -> float`\nMinimum floating point. Should be -1.7976931348623157e+308.\n\n`Fortuna.min_above() -> float`\nMinimum float above zero. Should be 5e-324.\n\n`Fortuna.min_below() -> float`\nMinimum float below zero. Should be -5e-324.\n\n## Fortuna Development Log\n\n##### Fortuna 5.5.7\n- Storm Update 4.0.3\n\n##### Fortuna 5.5.6\n- Performance test update\n- Documentation update\n\n##### Fortuna 5.5.5\n- All platforms now require C++20\n\n##### Fortuna 5.5.4\n- Bug fixes\n\n##### Fortuna 5.5.3\n- Bug fixes\n\n##### Fortuna 5.5.2\n- Bug fixes\n\n##### Fortuna 5.5.1\n- Bug fixes\n\n##### Fortuna 5.5.0\n- Bug fixes\n\n##### Fortuna 5.4.2\n- Storm 3.9.2 update\n\n##### Fortuna 5.4.1\n- Bug fixes\n\n##### Fortuna 5.4.0\n- Adds DistributionRange\n- Changes signature of distribution_range, use DistributionRange for previous behavior\n\n##### Fortuna 5.3.2\n- FlexCat now handles (cycle, cycle) more intuitively\n\n##### Fortuna 5.3.1\n- Adds several float tests\n\n##### Fortuna 5.3.0\n- Storm Update v3.9.0\n- `lognormal_variate` -> `log_normal_variate`\n\n##### Fortuna 5.2.1\n- Bug fix (TruffleShuffle)\n\n##### Fortuna 5.2.0\n- Adds `QuantumMonty.cycle` method\n  - Supports FlexCat\n\n##### Fortuna 5.1.4\n- Documentation Update\n- Updates Installation Script\n  - Darwin now uses \"-std=c++20\"\n  - Linux now uses \"-std=c++17\"\n\n##### Fortuna 5.1.3\n- Storm 3.8.0 update\n- No longer requires Python.h\n\n##### Fortuna 5.1.2\n- Storm 3.7.1 update\n\n- ##### Fortuna 5.1.1\n- Storm 3.7.0 update\n\n##### Fortuna 5.1.0\n- Storm 3.6.4 update\n\n##### Fortuna 5.0.7\n- Installer patch\n\n##### Fortuna 5.0.6\n- Storm 3.6.3 update\n\n##### Fortuna 5.0.5\n- Documentation Update\n\n##### Fortuna 5.0.4\n- Performance Tuning\n\n##### Fortuna 5.0.3\n- Test Update\n\n##### Fortuna 5.0.2\n- Performance Tuning\n\n##### Fortuna 5.0.1\n- Bug Fixes\n\n##### Fortuna 5.0.0\n- Adds MSVC support\n\n##### Fortuna 4.4.4\n- Installation bug fix\n\n##### Fortuna 4.4.3\n- Storm 3.6.0 update\n  - Removes Storm::Engine::engine\n  - Fixes type bug in Storm::Meters::max_uint\n- Performance tests now use Python 3.10\n  - Incidental ~25% performance boost\n- Removes MonkeyScope as a requirement\n  - MonkeyScope should be installed separately\n\n##### Fortuna 4.4.2\n- Storm 3.5.8 update\n  - Adds float_clamp\n  - Adds max_uint\n\n##### Fortuna 4.4.1\n- Updates documentation\n- Fixes typos\n\n##### Fortuna 4.4.0\n- Storm 3.5.7 update\n- Adds seeding: Storm::Engine::seed\n\n##### Fortuna 4.3.5\n- Performance update `sample`\n\n##### Fortuna 4.3.4\n- Added `sample`\n\n##### Fortuna 4.3.3\n- TruffleShuffle update\n\n##### Fortuna 4.3.2\n- Fixes installer for Google Colab\n\n##### Fortuna 4.3.1\n- Fixes installer for Linux\n\n##### Fortuna 4.3.0\n- Updates Storm to 3.5.5\n- Adds minor documentation\n- Updates tests\n- Installer now requires C++20 compiler\n\n##### Fortuna 4.2.3\n- Updates Storm to 3.5.4\n\n##### Fortuna 4.2.2\n- Updates Storm to 3.5.3\n\n##### Fortuna 4.2.1\n- Updates Storm to 3.5.1\n\n##### Fortuna 4.2.0\n- Fixes a few docstrings, expands example code\n\n##### Fortuna 4.1.9\n- Updates documentation - installation notes, copyright date and other small tweaks\n\n##### Fortuna 4.1.8\n- Updates performance test output for Fortuna 4.1.x on Big Sur with Python 3.9.x\n\n##### Fortuna 4.1.7\n- Adds GitHub repo link to the project for PyPi\n- Adds minor documentation & example file updates\n\n##### Fortuna 4.1.6\n- Fixes 'zero rolls' bug in 'dice()'\n\n##### Fortuna 4.1.5\n- Fixes minor bug\n\n##### Fortuna 4.1.4\n- Updates requirements.txt\n\n##### Fortuna 4.1.3\n- Small refactoring\n\n##### Fortuna 4.1.2\n- Updates tests\n\n##### Fortuna 4.1.1\n- Fixes some minor typos\n\n##### Fortuna 4.1.0\n- Adds distribution_range utility\n\n##### Fortuna 4.0.0\n- RNG merge, adds all features from the RNG library that were not already here\n\n##### Fortuna 3.20.3\n- Minor low level Storm update\n- Minor test tweaks\n\n##### Fortuna 3.20.2\n- adds example: fortuna_extras/multi_threading.py\n\n##### Fortuna 3.20.1\n- fixes typos\n\n##### Fortuna 3.20.0\n- Updates Storm: 3.4.0: Storm is now Thread Safe\n- Adds platform limit meters\n- Deprecates MultiChoice\n\n##### Fortuna 3.19.1\n- fixes typos\n\n##### Fortuna 3.19.0\n- Storm 3.3.6 update\n\n##### Fortuna 3.18.2\n- Fixes typos\n\n##### Fortuna 3.18.1\n- Installer update\n\n##### Fortuna 3.18.0\n- Performance Enhancement\n- Storm 3.3.4 update\n- updated test output\n\n##### Fortuna 3.17.13\n- Fixes some typos\n\n##### Fortuna 3.17.12\n- Adds pyproject.toml file to ease the installation process\n\n##### Fortuna 3.17.11\n- Documentation Update\n\n##### Fortuna 3.17.10\n- Documentation Update\n\n##### Fortuna 3.17.9\n- Typo\n\n##### Fortuna 3.17.8\n- Typo\n\n##### Fortuna 3.17.7\n- Typo\n\n##### Fortuna 3.17.6\n- Documentation update\n\n##### Fortuna 3.17.5\n- Typos\n\n##### Fortuna 3.17.4\n- Reorganized\n\n##### Fortuna 3.17.3\n- Streamlining: dropped auxiliary packages.\n\n##### Fortuna 3.17.2\n- Documentation update\n\n##### Fortuna 3.17.1\n- Update for backwards compatibility for platforms that do not support std::clamp.\n\n##### Fortuna 3.17.0, internal\n- Installation issue detected on some platforms that lack std::clamp.\n\n##### Fortuna 3.16.9\n- Documentation Update\n\n##### Fortuna 3.16.8\n- TruffleShuffle update\n- Adds truffle_shuffle()\n\n##### Fortuna 3.16.7\n- Documentation Update\n\n##### Fortuna 3.16.6\n- Adds distribution_range()\n\n##### Fortuna 3.16.5\n- Documentation Update\n\n##### Fortuna 3.16.4\n- Documentation Update\n\n##### Fortuna 3.16.3\n- Major TruffleShuffle performance upgrade\n\n##### Fortuna 3.16.2 - Internal\n- Testing\n\n##### Fortuna 3.16.1\n- Documentation Update\n\n##### Fortuna 3.16.0\n- Storm 3.3.2 Update\n\n##### Fortuna 3.15.1\n- Docs updated\n\n##### Fortuna 3.15.0\n- Type Hints Clarified via Typing Module\n\n##### Fortuna 3.14.1\n- Fixed another installer bug affecting gcc.\n\n##### Fortuna 3.14.0\n- Minor TruffleShuffle Update\n- Fisher Yates, and Knuth A Shuffle Algorithms added for comparison with Fortuna.shuffle()\n    - Some platforms may prefer one over another. Intel favors Knuth B (Fortuna.shuffle) by more than double.\n\n##### Fortuna 3.13.0 - Internal\n- Development & Testing Environment Updated to Python 3.8\n    - Python3.8 brings a 10-20% performance boost over all.\n- RandomValue API redesign. Dependency Injection is now handled at instantiation rather than call time.\n\n##### Fortuna 3.12.2\n- Installer update.\n- Clarified the docs for MultiChoice.\n\n##### Fortuna 3.12.1\n- MultiChoice now accepts a default.\n\n##### Fortuna 3.12.0\n- MultiChoice added\n\n##### Fortuna 3.10.2\n- Doc string update for clarity.\n- Test update\n- MonkeyScope Update\n\n##### Fortuna 3.10.1\n- Documentation fix, RandomValue examples are now together.\n\n##### Fortuna 3.10.0\n- Fortuna now includes both RNG and Pyewacket.\n- Documentation update.\n\n##### Fortuna 3.9.11\n- Installer Update, properly installs MonkeyScope as intended.\n\n##### Fortuna 3.9.10\n- Fixed Typos\n\n##### Fortuna 3.9.9\n- Docs Update\n\n##### Fortuna 3.9.8\n- Test Update\n\n##### Fortuna 3.9.7\n- Tests for RNG and Pyewacket are now included in `fortuna_extras` package.\n\n##### Fortuna 3.9.6\n- Documentation update.\n\n##### Fortuna 3.9.5\n- Storm 3.2.2 Update.\n\n##### Fortuna 3.9.4\n- Documentation update.\n\n##### Fortuna 3.9.3\n- MonkeyScope update, 10% test suite performance improvement.\n\n##### Fortuna 3.9.2\n- Documentation update.\n\n##### Fortuna 3.9.1\n- `flatten_with` has been renamed to `flatten`. This should be non-breaking, please report any bugs.\n\n##### Fortuna 3.9.0 - Internal\n- Added many doc strings.\n- Corrected many typos in Docs.\n- The `flatten` function has been fully replaced by `flatten_with`. \n    - All classes that support automatic flattening can now accept arbitrary arguments at call time.\n    - `flatten_with` will be renamed to `flatten` in a future release.\n\n##### Fortuna 3.8.9\n- Fixed some typos.\n\n##### Fortuna 3.8.8\n- Fortuna now supports Python notebooks, python3.6 or higher required.\n\n##### Fortuna 3.8.7\n- Storm Update\n\n##### Fortuna 3.8.6\n- Attempting to make Fortuna compatible with Python Notebooks. \n\n##### Fortuna 3.8.5\n- Installer Config Update\n\n##### Fortuna 3.8.4\n- Installer Config Update\n\n##### Fortuna 3.8.3\n- Storm Update 3.2.0\n\n##### Fortuna 3.8.2\n- More Typo Fix\n\n##### Fortuna 3.8.1\n- Typo Fix\n\n##### Fortuna 3.8.0\n- Major API Update, several utilities have been deprecated. See MonkeyScope for replacements.\n    - distribution\n    - distribution_timer\n    - timer\n\n##### Fortuna 3.7.7\n- Documentation Update\n\n##### Fortuna 3.7.6\n- Install script update.\n\n##### Fortuna 3.7.5 - internal\n- Storm 3.1.1 Update\n- Added triangular function.\n\n##### Fortuna 3.7.4\n- Fixed: missing header in the project manifest, this may have caused building from source to fail.\n\n##### Fortuna 3.7.3\n- Storm Update\n\n##### Fortuna 3.7.2\n- Storm Update\n\n##### Fortuna 3.7.1\n- Bug fixes\n\n##### Fortuna 3.7.0 - internal\n- flatten_with() is now the default flattening algorithm for all Fortuna classes.\n\n##### Fortuna 3.6.5\n- Documentation Update\n- RandomValue: New flatten-with-arguments functionality.\n\n##### Fortuna 3.6.4\n- RandomValue added for testing\n\n##### Fortuna 3.6.3\n- Developer Update\n\n##### Fortuna 3.6.2\n- Installer Script Update\n\n##### Fortuna 3.6.1\n- Documentation Update\n\n##### Fortuna 3.6.0\n- Storm Update\n- Test Update\n- Bug fix for random_range(), negative stepping is now working as intended. This bug was introduced in 3.5.0.\n- Removed Features\n    - lazy_cat(): use QuantumMonty class instead.\n    - flex_cat(): use FlexCat class instead.\n    - truffle_shuffle(): use TruffleShuffle class instead.\n\n##### Fortuna 3.5.3 - internal\n- Features added for testing & development\n    - ActiveChoice class\n    - random_rotate() function\n\n##### Fortuna 3.5.2\n- Documentation Updates\n\n##### Fortuna 3.5.1\n- Test Update\n\n##### Fortuna 3.5.0\n- Storm Update\n- Minor Bug Fix: Truffle Shuffle\n- Deprecated Features\n    - lazy_cat(): use QuantumMonty class instead.\n    - flex_cat(): use FlexCat class instead.\n    - truffle_shuffle(): use TruffleShuffle class instead.\n\n##### Fortuna 3.4.9\n- Test Update\n\n##### Fortuna 3.4.8\n- Storm Update\n\n##### Fortuna 3.4.7\n- Bug fix for analytic_continuation.\n\n##### Fortuna 3.4.6\n- Docs Update\n\n##### Fortuna 3.4.5\n- Docs Update\n- Range Tests Added, see extras folder.\n\n##### Fortuna 3.4.4\n- ZeroCool Algorithm Bug Fixes\n- Typos Fixed\n\n##### Fortuna 3.4.3\n- Docs Update\n\n##### Fortuna 3.4.2\n- Typos Fixed\n\n##### Fortuna 3.4.1\n- Major Bug Fix: random_index()\n\n##### Fortuna 3.4.0 - internal\n- ZeroCool Poisson Algorithm Family Updated\n\n##### Fortuna 3.3.8 - internal\n- Docs Update\n\n##### Fortuna 3.3.7\n- Fixed Performance Bug: ZeroCool Linear Algorithm Family\n\n##### Fortuna 3.3.6\n- Docs Update\n\n##### Fortuna 3.3.5\n- ABI Updates\n- Bug Fixes\n\n##### Fortuna 3.3.4\n- Examples Update\n\n##### Fortuna 3.3.3\n- Test Suite Update\n\n##### Fortuna 3.3.2 - internal\n- Documentation Update\n\n##### Fortuna 3.3.1 - internal\n- Minor Bug Fix\n\n##### Fortuna 3.3.0 - internal\n- Added `plus_or_minus_gauss(N: int) -> int` random int in range [-N, N] Stretched Gaussian Distribution\n\n##### Fortuna 3.2.3\n- Small Typos Fixed\n\n##### Fortuna 3.2.2\n- Documentation update.\n\n##### Fortuna 3.2.1\n- Small Typo Fixed\n\n##### Fortuna 3.2.0\n- API updates:\n    - QunatumMonty.uniform -> QunatumMonty.flat_uniform\n    - QunatumMonty.front -> QunatumMonty.front_linear\n    - QunatumMonty.middle -> QunatumMonty.middle_linear\n    - QunatumMonty.back -> QunatumMonty.back_linear\n    - QunatumMonty.quantum -> QunatumMonty.quantum_linear\n    - randindex -> random_index\n    - randbelow -> random_below\n    - randrange -> random_range\n    - randint   -> random_int\n\n##### Fortuna 3.1.0\n- `discrete()` has been removed, see Weighted Choice.\n- `lazy_cat()` added.\n- All ZeroCool methods have been raised to top level API, for use with lazy_cat()\n\n##### Fortuna 3.0.1\n- minor typos.\n\n##### Fortuna 3.0.0\n- Storm 2 Rebuild.\n\n##### Fortuna 2.1.1\n- Small bug fixes.\n- Test updates.\n\n##### Fortuna 2.1.0, Major Feature Update\n- Fortuna now includes the best of RNG and Pyewacket.\n\n##### Fortuna 2.0.3\n- Bug fix.\n\n##### Fortuna 2.0.2\n- Clarified some documentation.\n\n##### Fortuna 2.0.1\n- Fixed some typos.\n\n##### Fortuna 2.0.0b1-10\n- Total rebuild. New RNG Storm Engine.\n\n##### Fortuna 1.26.7.1\n- README updated.\n\n##### Fortuna 1.26.7\n- Small bug fix.\n\n##### Fortuna 1.26.6\n- Updated README to reflect recent changes to the test script.\n\n##### Fortuna 1.26.5\n- Fixed small bug in test script.\n\n##### Fortuna 1.26.4\n- Updated documentation for clarity.\n- Fixed a minor typo in the test script.\n\n##### Fortuna 1.26.3\n- Clean build.\n\n##### Fortuna 1.26.2\n- Fixed some minor typos.\n\n##### Fortuna 1.26.1\n- Release.\n\n##### Fortuna 1.26.0 beta 2\n- Moved README and LICENSE files into fortuna_extras folder.\n\n##### Fortuna 1.26.0 beta 1\n- Dynamic version scheme implemented.\n- The Fortuna Extension now requires the fortuna_extras package, previously it was optional.\n\n##### Fortuna 1.25.4\n- Fixed some minor typos in the test script.\n\n##### Fortuna 1.25.3\n- Since version 1.24 Fortuna requires Python 3.7 or higher. This patch corrects an issue where the setup script incorrectly reported requiring Python 3.6 or higher.\n\n##### Fortuna 1.25.2\n- Updated test suite.\n- Major performance update for TruffleShuffle.\n- Minor performance update for QuantumMonty & FlexCat: cycle monty.\n\n##### Fortuna 1.25.1\n- Important bug fix for TruffleShuffle, QuantumMonty and FlexCat.\n\n##### Fortuna 1.25\n- Full 64bit support.\n- The Distribution & Performance Tests have been redesigned.\n- Bloat Control: Two experimental features have been removed.\n    - RandomWalk\n    - CatWalk\n- Bloat Control: Several utility functions have been removed from the top level API. These function remain in the Fortuna namespace for now, but may change in the future without warning.\n    - stretch_bell, internal only.\n    - min_max, not used anymore.\n    - analytic_continuation, internal only.\n    - flatten, internal only.\n\n##### Fortuna 1.24.3\n- Low level refactoring, non-breaking patch.\n\n##### Fortuna 1.24.2\n- Setup config updated to improve installation.\n\n##### Fortuna 1.24.1\n- Low level patch to avoid potential ADL issue. All low level function calls are now qualified.\n\n##### Fortuna 1.24\n- Documentation updated for even more clarity.\n- Bloat Control: Two utility functions that are no longer used in the module have been removed.\n    - n_samples -> use a list comprehension instead. `[f(x) for _ in range(n)]`\n    - bind -> use a lambda instead. `lambda: f(x)`\n\n##### Fortuna 1.23.7\n- Documentation updated for clarity.\n- Minor bug fixes.\n- TruffleShuffle has been redesigned slightly, it now uses a random rotate instead of swap.\n- Custom `__repr__` methods have been added to each class.\n\n##### Fortuna 1.23.6\n- New method for QuantumMonty: quantum_not_monty - produces the upside down quantum_monty.\n- New bias option for FlexCat: not_monty.\n\n##### Fortuna 1.23.5.1\n- Fixed some small typos.\n\n##### Fortuna 1.23.5\n- Documentation updated for clarity.\n- All sequence wrappers can now accept generators as input.\n- Six new functions added:\n    - random_float() -> float in range [0.0..1.0) exclusive, uniform flat distribution.\n    - percent_true_float(num: float) -> bool, Like percent_true but with floating point precision.\n    - plus_or_minus_linear_down(num: int) -> int in range [-num..num], upside down pyramid.\n    - plus_or_minus_curve_down(num: int) -> int in range [-num..num], upside down bell curve.\n    - mostly_not_middle(num: int) -> int in range [0..num], upside down pyramid.\n    - mostly_not_center(num: int) -> int in range [0..num], upside down bell curve.\n- Two new methods for QuantumMonty:\n    - mostly_not_middle\n    - mostly_not_center\n- Two new bias options for FlexCat, either can be used to define x and/or y-axis bias:\n    - not_middle\n    - not_center\n\n##### Fortuna 1.23.4.2\n- Fixed some minor typos in the README.md file.\n\n##### Fortuna 1.23.4.1\n- Fixed some minor typos in the test suite.\n\n##### Fortuna 1.23.4\n- Fortuna is now Production/Stable!\n- Fortuna and Fortuna Pure now use the same test suite.\n\n##### Fortuna 0.23.4, first release candidate.\n- RandomCycle, BlockCycle and TruffleShuffle have been refactored and combined into one class: TruffleShuffle.\n- QuantumMonty and FlexCat will now use the new TruffleShuffle for cycling.\n- Minor refactoring across the module.\n\n##### Fortuna 0.23.3, internal\n- Function shuffle(arr: list) added.\n\n##### Fortuna 0.23.2, internal\n- Simplified the plus_or_minus_curve(num: int) function, output will now always be bounded to the range [-num..num].\n- Function stretched_bell(num: int) added, this matches the previous behavior of an unbounded plus_or_minus_curve.\n\n##### Fortuna 0.23.1, internal\n- Small bug fixes and general clean up.\n\n##### Fortuna 0.23.0\n- The number of test cycles in the test suite has been reduced to 10,000 (down from 100,000). The performance of the pure python implementation and the c-extension are now directly comparable.\n- Minor tweaks made to the examples in `.../fortuna_extras/fortuna_examples.py`\n\n##### Fortuna 0.22.2, experimental features\n- BlockCycle class added.\n- RandomWalk class added.\n- CatWalk class added.\n\n##### Fortuna 0.22.1\n- Fortuna classes no longer return lists of values, this behavior has been extracted to a free function called n_samples.\n\n##### Fortuna 0.22.0, experimental features\n- Function bind added.\n- Function n_samples added.\n\n##### Fortuna 0.21.3\n- Flatten will no longer raise an error if passed a callable item that it can't call. It correctly returns such items in an uncalled state without error.\n- Simplified `.../fortuna_extras/fortuna_examples.py` - removed unnecessary class structure.\n\n##### Fortuna 0.21.2\n- Fix some minor bugs.\n\n##### Fortuna 0.21.1\n- Fixed a bug in `.../fortuna_extras/fortuna_examples.py`\n\n##### Fortuna 0.21.0\n- Function flatten added.\n- Flatten: The Fortuna classes will recursively unpack callable objects in the data set.\n\n##### Fortuna 0.20.10\n- Documentation updated.\n\n##### Fortuna 0.20.9\n- Minor bug fixes.\n\n##### Fortuna 0.20.8, internal\n- Testing cycle for potential new features.\n\n##### Fortuna 0.20.7\n- Documentation updated for clarity.\n\n##### Fortuna 0.20.6\n- Tests updated based on recent changes.\n\n##### Fortuna 0.20.5, internal\n- Documentation updated based on recent changes.\n\n##### Fortuna 0.20.4, internal\n- WeightedChoice (both types) can optionally return a list of samples rather than just one value, control the length of the list via the n_samples argument.\n\n##### Fortuna 0.20.3, internal\n- RandomCycle can optionally return a list of samples rather than just one value,\ncontrol the length of the list via the n_samples argument.\n\n##### Fortuna 0.20.2, internal\n- QuantumMonty can optionally return a list of samples rather than just one value,\ncontrol the length of the list via the n_samples argument.\n\n##### Fortuna 0.20.1, internal\n- FlexCat can optionally return a list of samples rather than just one value,\ncontrol the length of the list via the n_samples argument.\n\n##### Fortuna 0.20.0, internal\n- FlexCat now accepts a standard dict as input. The ordered(ness) of dict is now part of the standard in Python 3.7.1. Previously FlexCat required an OrderedDict, now it accepts either and treats them the same.\n\n##### Fortuna 0.19.7\n- Fixed bug in `.../fortuna_extras/fortuna_examples.py`.\n\n##### Fortuna 0.19.6\n- Updated documentation formatting.\n- Small performance tweak for QuantumMonty and FlexCat.\n\n##### Fortuna 0.19.5\n- Minor documentation update.\n\n##### Fortuna 0.19.4\n- Minor update to all classes for better debugging.\n\n##### Fortuna 0.19.3\n- Updated plus_or_minus_curve to allow unbounded output.\n\n##### Fortuna 0.19.2\n- Internal development cycle.\n- Minor update to FlexCat for better debugging.\n\n##### Fortuna 0.19.1\n- Internal development cycle.\n\n##### Fortuna 0.19.0\n- Updated documentation for clarity.\n- MultiCat has been removed, it is replaced by FlexCat.\n- Mostly has been removed, it is replaced by QuantumMonty.\n\n##### Fortuna 0.18.7\n- Fixed some more README typos.\n\n##### Fortuna 0.18.6\n- Fixed some README typos.\n\n##### Fortuna 0.18.5\n- Updated documentation.\n- Fixed another minor test bug.\n\n##### Fortuna 0.18.4\n- Updated documentation to reflect recent changes.\n- Fixed some small test bugs.\n- Reduced default number of test cycles to 10,000 - down from 100,000.\n\n##### Fortuna 0.18.3\n- Fixed some minor README typos.\n\n##### Fortuna 0.18.2\n- Fixed a bug with Fortuna Pure.\n\n##### Fortuna 0.18.1\n- Fixed some minor typos.\n- Added tests for `.../fortuna_extras/fortuna_pure.py`\n\n##### Fortuna 0.18.0\n- Introduced new test format, now includes average call time in nanoseconds.\n- Reduced default number of test cycles to 100,000 - down from 1,000,000.\n- Added pure Python implementation of Fortuna: `.../fortuna_extras/fortuna_pure.py`\n- Promoted several low level functions to top level.\n    - `zero_flat(num: int) -> int`\n    - `zero_cool(num: int) -> int`\n    - `zero_extreme(num: int) -> int`\n    - `max_cool(num: int) -> int`\n    - `max_extreme(num: int) -> int`\n    - `analytic_continuation(func: staticmethod, num: int) -> int`\n    - `min_max(num: int, lo: int, hi: int) -> int`\n\n##### Fortuna 0.17.3\n- Internal development cycle.\n\n##### Fortuna 0.17.2\n- User Requested: dice() and d() functions now support negative numbers as input.\n\n##### Fortuna 0.17.1\n- Fixed some minor typos.\n\n##### Fortuna 0.17.0\n- Added QuantumMonty to replace Mostly, same default behavior with more options.\n- Mostly is depreciated and may be removed in a future release.\n- Added FlexCat to replace MultiCat, same default behavior with more options.\n- MultiCat is depreciated and may be removed in a future release.\n- Expanded the Treasure Table example in `.../fortuna_extras/fortuna_examples.py`\n\n##### Fortuna 0.16.2\n- Minor refactoring for WeightedChoice.\n\n##### Fortuna 0.16.1\n- Redesigned fortuna_examples.py to feature a dynamic random magic item generator.\n- Raised cumulative_weighted_choice function to top level.\n- Added test for cumulative_weighted_choice as free function.\n- Updated MultiCat documentation for clarity.\n\n##### Fortuna 0.16.0\n- Pushed distribution_timer to the .pyx layer.\n- Changed default number of iterations of tests to 1 million, up form 1 hundred thousand.\n- Reordered tests to better match documentation.\n- Added Base Case Fortuna.fast_rand_below.\n- Added Base Case Fortuna.fast_d.\n- Added Base Case Fortuna.fast_dice.\n\n##### Fortuna 0.15.10\n- Internal Development Cycle\n\n##### Fortuna 0.15.9\n- Added Base Cases for random_value()\n- Added Base Case for randint()\n\n##### Fortuna 0.15.8\n- Clarified MultiCat Test\n\n##### Fortuna 0.15.7\n- Fixed minor typos.\n\n##### Fortuna 0.15.6\n- Fixed minor typos.\n- Simplified MultiCat example.\n\n##### Fortuna 0.15.5\n- Added MultiCat test.\n- Fixed some minor typos in docs.\n\n##### Fortuna 0.15.4\n- Performance optimization for both WeightedChoice() variants.\n- Cython update provides small performance enhancement across the board.\n- Compilation now leverages Python3 all the way down.\n- MultiCat pushed to the .pyx layer for better performance.\n\n##### Fortuna 0.15.3\n- Reworked the MultiCat example to include several randomizing strategies working in concert.\n- Added Multi Dice 10d10 performance tests.\n- Updated sudo code in documentation to be more pythonic.\n\n##### Fortuna 0.15.2\n- Fixed: Linux installation failure.\n- Added: complete source files to the distribution (.cpp .hpp .pyx).\n\n##### Fortuna 0.15.1\n- Updated & simplified distribution_timer in `fortuna_tests.py`\n- Readme updated, fixed some typos.\n- Known issue preventing successful installation on some linux platforms.\n\n##### Fortuna 0.15.0\n- Performance tweaks.\n- Readme updated, added some details.\n\n##### Fortuna 0.14.1\n- Readme updated, fixed some typos.\n\n##### Fortuna 0.14.0\n- Fixed a bug where the analytic continuation algorithm caused a rare issue during compilation on some platforms.\n\n##### Fortuna 0.13.3\n- Fixed Test Bug: percent sign was missing in output distributions.\n- Readme updated: added update history, fixed some typos.\n\n##### Fortuna 0.13.2\n- Readme updated for even more clarity.\n\n##### Fortuna 0.13.1\n- Readme updated for clarity.\n\n##### Fortuna 0.13.0\n- Minor Bug Fixes.\n- Readme updated for aesthetics.\n- Added Tests: `.../fortuna_extras/fortuna_tests.py`\n\n##### Fortuna 0.12.0\n- Internal test for future update.\n\n##### Fortuna 0.11.0\n- Initial Release: Public Beta\n\n##### Fortuna 0.10.0\n- Module name changed from Dice to Fortuna\n\n##### Dice 0.1.x - 0.9.x\n- Experimental Phase\n\n\n## Distribution and Performance Tests\nTestbed:\n- Hardware: Mac Studio: M1 Ultra\n- Software: macOS 14.5, Python 3.11.3\n\n```\nMonkeyScope: Fortuna Quick Test\nFortuna Version: 5.5.7\nStorm Version: 4.0.3\n\nSmart Clamp: Pass\nFloat Clamp: Pass\n\nData:\nsome_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n\nBase Case\nOutput Analysis: Random.choice(some_list)\nTypical Timing: 201 \u00b1 7 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 4\n Maximum: 9\n Mean: 4.509\n Std Deviation: 2.8726592507937956\nDistribution of 10000 samples:\n 0: 9.94%\n 1: 9.74%\n 2: 10.26%\n 3: 9.99%\n 4: 10.54%\n 5: 9.51%\n 6: 9.76%\n 7: 10.34%\n 8: 10.08%\n 9: 9.84%\n\nOutput Analysis: random_value(some_list)\nTypical Timing: 37 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 4\n Maximum: 9\n Mean: 4.512\n Std Deviation: 2.9028059325904447\nDistribution of 10000 samples:\n 0: 10.0%\n 1: 9.52%\n 2: 10.07%\n 3: 9.95%\n 4: 9.75%\n 5: 9.87%\n 6: 9.85%\n 7: 10.47%\n 8: 10.45%\n 9: 10.07%\n\n\nWide Distribution\nTruffle = TruffleShuffle(some_list)\nOutput Analysis: Truffle()\nTypical Timing: 204 \u00b1 5 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 4\n Maximum: 9\n Mean: 4.537\n Std Deviation: 2.861611402657569\nDistribution of 10000 samples:\n 0: 10.05%\n 1: 10.29%\n 2: 10.5%\n 3: 10.09%\n 4: 9.83%\n 5: 9.75%\n 6: 10.01%\n 7: 10.03%\n 8: 9.6%\n 9: 9.85%\n\ntruffle = truffle_shuffle(some_list)\nOutput Analysis: truffle()\nTypical Timing: 82 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 5\n Maximum: 9\n Mean: 4.533\n Std Deviation: 2.91090782821861\nDistribution of 10000 samples:\n 0: 10.18%\n 1: 9.83%\n 2: 9.91%\n 3: 10.05%\n 4: 9.85%\n 5: 10.04%\n 6: 10.09%\n 7: 10.12%\n 8: 9.78%\n 9: 10.15%\n\n\nQuantumMonty\nsome_tuple = tuple(i for i in range(10))\n\nmonty = QuantumMonty(some_tuple)\nOutput Analysis: monty()\nTypical Timing: 214 \u00b1 3 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 4\n Maximum: 9\n Mean: 4.51\n Std Deviation: 2.9547640566770523\nDistribution of 10000 samples:\n 0: 11.45%\n 1: 8.88%\n 2: 8.9%\n 3: 9.87%\n 4: 11.22%\n 5: 11.69%\n 6: 9.46%\n 7: 9.0%\n 8: 8.74%\n 9: 10.79%\n\nrand_value = <Fortuna.RandomValue object at 0x1005a0640>\nOutput Analysis: rand_value()\nTypical Timing: 168 \u00b1 5 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 4\n Maximum: 9\n Mean: 4.402\n Std Deviation: 2.8741358104057393\nDistribution of 10000 samples:\n 0: 10.14%\n 1: 10.08%\n 2: 9.97%\n 3: 10.18%\n 4: 10.2%\n 5: 10.25%\n 6: 10.34%\n 7: 9.59%\n 8: 9.3%\n 9: 9.95%\n\n\nWeighted Tables:\npopulation = ('A', 'B', 'C', 'D')\ncum_weights = (1, 3, 6, 10)\nrel_weights = (1, 2, 3, 4)\ncum_weighted_table = zip(cum_weights, population)\nrel_weighted_table = zip(rel_weights, population)\n\nCumulative Base Case\nOutput Analysis: Random.choices(population, cum_weights=cum_weights)\nTypical Timing: 550 \u00b1 10 ns\nDistribution of 10000 samples:\n A: 9.91%\n B: 19.71%\n C: 29.7%\n D: 40.68%\n\ncum_weighted_choice = CumulativeWeightedChoice(cum_weighted_table)\nOutput Analysis: cum_weighted_choice()\nTypical Timing: 168 \u00b1 3 ns\nDistribution of 10000 samples:\n A: 10.4%\n B: 20.28%\n C: 29.51%\n D: 39.81%\n\nOutput Analysis: cumulative_weighted_choice(tuple(zip(cum_weights, population)))\nTypical Timing: 76 \u00b1 2 ns\nDistribution of 10000 samples:\n A: 9.99%\n B: 19.66%\n C: 29.61%\n D: 40.74%\n\nRelative Base Case\nOutput Analysis: Random.choices(population, weights=rel_weights)\nTypical Timing: 694 \u00b1 24 ns\nDistribution of 10000 samples:\n A: 9.62%\n B: 20.54%\n C: 29.58%\n D: 40.26%\n\nrel_weighted_choice = RelativeWeightedChoice(rel_weighted_table)\nOutput Analysis: rel_weighted_choice()\nTypical Timing: 174 \u00b1 8 ns\nDistribution of 10000 samples:\n A: 9.98%\n B: 20.85%\n C: 29.59%\n D: 39.58%\n\n\nRandom Matrix Values:\nsome_matrix = {'A': (1, 2, 3, 4), 'B': (10, 20, 30, 40), 'C': (100, 200, 300, 400)}\n\nflex_cat = FlexCat(some_matrix)\nOutput Analysis: flex_cat()\nTypical Timing: 380 \u00b1 13 ns\nStatistics of 1000 samples:\n Minimum: 1\n Median: 4\n Maximum: 400\n Mean: 34.157\n Std Deviation: 80.14226808703467\nDistribution of 10000 samples:\n 1: 13.78%\n 2: 13.78%\n 3: 13.78%\n 4: 13.85%\n 10: 8.33%\n 20: 8.33%\n 30: 8.53%\n 40: 8.37%\n 100: 2.92%\n 200: 2.9%\n 300: 2.67%\n 400: 2.76%\n\nOutput Analysis: flex_cat(\"C\")\nTypical Timing: 252 \u00b1 10 ns\nStatistics of 1000 samples:\n Minimum: 100\n Median: 200\n Maximum: 400\n Mean: 249.8\n Std Deviation: 112.75048856955199\nDistribution of 10000 samples:\n 100: 24.93%\n 200: 24.87%\n 300: 24.91%\n 400: 25.29%\n\n\nRandom Integers:\nBase Case\nOutput Analysis: Random.randrange(10)\nTypical Timing: 158 \u00b1 4 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 5\n Maximum: 9\n Mean: 4.632\n Std Deviation: 2.871030967931001\nDistribution of 10000 samples:\n 0: 9.99%\n 1: 9.83%\n 2: 10.13%\n 3: 10.28%\n 4: 9.77%\n 5: 9.95%\n 6: 9.8%\n 7: 10.03%\n 8: 10.21%\n 9: 10.01%\n\nOutput Analysis: random_below(10)\nTypical Timing: 35 \u00b1 3 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 4\n Maximum: 9\n Mean: 4.436\n Std Deviation: 2.8757910518975773\nDistribution of 10000 samples:\n 0: 10.06%\n 1: 10.17%\n 2: 9.9%\n 3: 9.97%\n 4: 10.37%\n 5: 10.42%\n 6: 9.37%\n 7: 9.35%\n 8: 9.78%\n 9: 10.61%\n\nOutput Analysis: random_index(10)\nTypical Timing: 34 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 4\n Maximum: 9\n Mean: 4.505\n Std Deviation: 2.887960407504804\nDistribution of 10000 samples:\n 0: 9.7%\n 1: 10.18%\n 2: 10.66%\n 3: 10.43%\n 4: 9.98%\n 5: 9.92%\n 6: 9.16%\n 7: 9.8%\n 8: 9.97%\n 9: 10.2%\n\nOutput Analysis: random_range(10)\nTypical Timing: 40 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: 0\n Median: 4\n Maximum: 9\n Mean: 4.4\n Std Deviation: 2.8660450474851604\nDistribution of 10000 samples:\n 0: 10.08%\n 1: 9.78%\n 2: 10.29%\n 3: 10.12%\n 4: 9.62%\n 5: 9.7%\n 6: 10.77%\n 7: 9.72%\n 8: 9.87%\n 9: 10.05%\n\nOutput Analysis: random_below(-10)\nTypical Timing: 42 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: -9\n Median: -4\n Maximum: 0\n Mean: -4.422\n Std Deviation: 2.8628852774975306\nDistribution of 10000 samples:\n -9: 9.96%\n -8: 10.42%\n -7: 9.78%\n -6: 10.19%\n -5: 10.09%\n -4: 9.85%\n -3: 10.1%\n -2: 9.83%\n -1: 9.32%\n 0: 10.46%\n\nOutput Analysis: random_index(-10)\nTypical Timing: 44 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: -10\n Median: -6\n Maximum: -1\n Mean: -5.515\n Std Deviation: 2.8635598430930296\nDistribution of 10000 samples:\n -10: 9.44%\n -9: 10.15%\n -8: 10.31%\n -7: 9.71%\n -6: 10.39%\n -5: 9.79%\n -4: 10.11%\n -3: 10.12%\n -2: 9.81%\n -1: 10.17%\n\nOutput Analysis: random_range(-10)\nTypical Timing: 53 \u00b1 3 ns\nStatistics of 1000 samples:\n Minimum: -10\n Median: -5\n Maximum: -1\n Mean: -5.46\n Std Deviation: 2.824247931109515\nDistribution of 10000 samples:\n -10: 9.42%\n -9: 9.57%\n -8: 9.83%\n -7: 9.95%\n -6: 10.67%\n -5: 10.12%\n -4: 10.27%\n -3: 10.02%\n -2: 10.29%\n -1: 9.86%\n\nBase Case\nOutput Analysis: Random.randrange(1, 10)\nTypical Timing: 193 \u00b1 4 ns\nStatistics of 1000 samples:\n Minimum: 1\n Median: 5\n Maximum: 9\n Mean: 5.096\n Std Deviation: 2.5454396993964057\nDistribution of 10000 samples:\n 1: 10.89%\n 2: 10.8%\n 3: 11.46%\n 4: 11.15%\n 5: 11.33%\n 6: 11.04%\n 7: 10.73%\n 8: 11.11%\n 9: 11.49%\n\nOutput Analysis: random_range(1, 10)\nTypical Timing: 42 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 1\n Median: 5\n Maximum: 9\n Mean: 4.811\n Std Deviation: 2.5771924493372476\nDistribution of 10000 samples:\n 1: 11.16%\n 2: 11.57%\n 3: 11.29%\n 4: 11.15%\n 5: 11.19%\n 6: 10.49%\n 7: 11.61%\n 8: 10.53%\n 9: 11.01%\n\nOutput Analysis: random_range(10, 1)\nTypical Timing: 44 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: 1\n Median: 5\n Maximum: 9\n Mean: 5.066\n Std Deviation: 2.5616803481711385\nDistribution of 10000 samples:\n 1: 11.32%\n 2: 10.91%\n 3: 10.62%\n 4: 10.68%\n 5: 11.47%\n 6: 11.39%\n 7: 11.08%\n 8: 11.4%\n 9: 11.13%\n\nBase Case\nOutput Analysis: Random.randint(-5, 5)\nTypical Timing: 211 \u00b1 4 ns\nStatistics of 1000 samples:\n Minimum: -5\n Median: 0\n Maximum: 5\n Mean: -0.172\n Std Deviation: 3.1954071143794223\nDistribution of 10000 samples:\n -5: 9.1%\n -4: 9.43%\n -3: 9.43%\n -2: 9.05%\n -1: 8.65%\n 0: 9.24%\n 1: 9.35%\n 2: 8.64%\n 3: 9.21%\n 4: 9.13%\n 5: 8.77%\n\nOutput Analysis: random_int(-5, 5)\nTypical Timing: 29 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: -5\n Median: 0\n Maximum: 5\n Mean: 0.035\n Std Deviation: 3.290075926114715\nDistribution of 10000 samples:\n -5: 9.38%\n -4: 9.6%\n -3: 8.92%\n -2: 9.07%\n -1: 8.77%\n 0: 8.86%\n 1: 8.91%\n 2: 8.8%\n 3: 9.29%\n 4: 9.21%\n 5: 9.19%\n\nOutput Analysis: random_uint(18446744073709551605, 18446744073709551615)\nTypical Timing: 43 \u00b1 3 ns\nStatistics of 1000 samples:\n Minimum: 18446744073709551605\n Median: 18446744073709551610\n Maximum: 18446744073709551615\n Mean: 1.8446744073709552e+19\n Std Deviation: 3.105866289041659\nDistribution of 10000 samples:\n 18446744073709551605: 8.82%\n 18446744073709551606: 9.03%\n 18446744073709551607: 9.47%\n 18446744073709551608: 9.1%\n 18446744073709551609: 8.88%\n 18446744073709551610: 9.39%\n 18446744073709551611: 8.8%\n 18446744073709551612: 9.37%\n 18446744073709551613: 9.03%\n 18446744073709551614: 9.05%\n 18446744073709551615: 9.06%\n\nBase Case\nOutput Analysis: Random.randrange(1, 20, 2)\nTypical Timing: 221 \u00b1 5 ns\nStatistics of 1000 samples:\n Minimum: 1\n Median: 11\n Maximum: 19\n Mean: 10.026\n Std Deviation: 5.8049135239916385\nDistribution of 10000 samples:\n 1: 10.21%\n 3: 10.31%\n 5: 10.57%\n 7: 10.17%\n 9: 9.76%\n 11: 9.74%\n 13: 10.21%\n 15: 9.5%\n 17: 9.74%\n 19: 9.79%\n\nOutput Analysis: random_range(1, 20, 2)\nTypical Timing: 43 \u00b1 4 ns\nStatistics of 1000 samples:\n Minimum: 1\n Median: 9\n Maximum: 19\n Mean: 9.996\n Std Deviation: 5.722300999486896\nDistribution of 10000 samples:\n 1: 10.05%\n 3: 9.56%\n 5: 10.42%\n 7: 10.47%\n 9: 9.98%\n 11: 9.84%\n 13: 10.15%\n 15: 10.03%\n 17: 10.06%\n 19: 9.44%\n\nOutput Analysis: random_range(1, 20, -2)\nTypical Timing: 41 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 2\n Median: 12\n Maximum: 20\n Mean: 11.032\n Std Deviation: 5.841326655572097\nDistribution of 10000 samples:\n 2: 9.93%\n 4: 10.2%\n 6: 9.63%\n 8: 9.75%\n 10: 10.4%\n 12: 9.73%\n 14: 9.76%\n 16: 10.45%\n 18: 10.02%\n 20: 10.13%\n\nOutput Analysis: random_range(20, 1, -2)\nTypical Timing: 41 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 2\n Median: 10\n Maximum: 20\n Mean: 11.074\n Std Deviation: 5.8169029870164035\nDistribution of 10000 samples:\n 2: 9.78%\n 4: 9.93%\n 6: 10.16%\n 8: 10.14%\n 10: 10.3%\n 12: 10.38%\n 14: 9.96%\n 16: 10.12%\n 18: 9.36%\n 20: 9.87%\n\nOutput Analysis: d(10)\nTypical Timing: 30 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 1\n Median: 5\n Maximum: 10\n Mean: 5.582\n Std Deviation: 2.9085624861322366\nDistribution of 10000 samples:\n 1: 10.01%\n 2: 9.96%\n 3: 10.15%\n 4: 10.11%\n 5: 9.95%\n 6: 10.3%\n 7: 9.93%\n 8: 9.83%\n 9: 9.78%\n 10: 9.98%\n\nOutput Analysis: dice(3, 6)\nTypical Timing: 49 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 3\n Median: 11\n Maximum: 18\n Mean: 10.471\n Std Deviation: 2.901995964949052\nDistribution of 10000 samples:\n 3: 0.48%\n 4: 1.42%\n 5: 2.58%\n 6: 4.76%\n 7: 7.13%\n 8: 9.71%\n 9: 12.2%\n 10: 12.51%\n 11: 12.7%\n 12: 11.38%\n 13: 9.52%\n 14: 7.02%\n 15: 4.32%\n 16: 2.71%\n 17: 1.1%\n 18: 0.46%\n\nOutput Analysis: ability_dice(4)\nTypical Timing: 108 \u00b1 5 ns\nStatistics of 1000 samples:\n Minimum: 3\n Median: 12\n Maximum: 18\n Mean: 12.314\n Std Deviation: 2.873614737862691\nDistribution of 10000 samples:\n 3: 0.08%\n 4: 0.27%\n 5: 0.82%\n 6: 1.46%\n 7: 2.96%\n 8: 4.85%\n 9: 7.22%\n 10: 9.42%\n 11: 11.61%\n 12: 13.07%\n 13: 12.94%\n 14: 12.26%\n 15: 9.88%\n 16: 7.09%\n 17: 4.42%\n 18: 1.65%\n\nOutput Analysis: plus_or_minus(5)\nTypical Timing: 29 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: -5\n Median: 0\n Maximum: 5\n Mean: 0.087\n Std Deviation: 3.164719015401912\nDistribution of 10000 samples:\n -5: 9.08%\n -4: 9.25%\n -3: 9.32%\n -2: 8.91%\n -1: 9.67%\n 0: 8.58%\n 1: 9.31%\n 2: 8.84%\n 3: 8.55%\n 4: 9.27%\n 5: 9.22%\n\nOutput Analysis: plus_or_minus_linear(5)\nTypical Timing: 38 \u00b1 3 ns\nStatistics of 1000 samples:\n Minimum: -5\n Median: 0\n Maximum: 5\n Mean: 0.044\n Std Deviation: 2.3945349857117972\nDistribution of 10000 samples:\n -5: 2.55%\n -4: 5.45%\n -3: 8.43%\n -2: 10.99%\n -1: 14.14%\n 0: 16.35%\n 1: 14.12%\n 2: 11.01%\n 3: 8.09%\n 4: 6.21%\n 5: 2.66%\n\nOutput Analysis: plus_or_minus_gauss(5)\nTypical Timing: 47 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: -4\n Median: 0\n Maximum: 5\n Mean: -0.017\n Std Deviation: 1.5732724449967928\nDistribution of 10000 samples:\n -5: 0.14%\n -4: 1.15%\n -3: 4.64%\n -2: 11.32%\n -1: 20.18%\n 0: 24.35%\n 1: 20.52%\n 2: 11.85%\n 3: 4.49%\n 4: 1.12%\n 5: 0.24%\n\n\nRandom Floats:\nBase Case\nTypical Timing: 23 \u00b1 4 ns\nTypical Timing: 22 \u00b1 1 ns\nBase Case\nOutput Analysis: Random.uniform(0.0, 10.0)\nTypical Timing: 69 \u00b1 3 ns\nStatistics of 1000 samples:\n Minimum: 0.011491348414168767\n Median: (4.864106432965989, 4.87476386080537)\n Maximum: 9.998975606887786\n Mean: 4.9785131650173975\n Std Deviation: 2.9655419609680567\nfloor distribution of 10000:\n 0: 10.18%\n 1: 9.35%\n 2: 10.04%\n 3: 10.08%\n 4: 10.19%\n 5: 9.96%\n 6: 9.76%\n 7: 10.57%\n 8: 10.18%\n 9: 9.69%\n\nOutput Analysis: random_float(0.0, 10.0)\nTypical Timing: 25 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 0.03210525587881108\n Median: (4.696951734946467, 4.709570710781074)\n Maximum: 9.961774148426375\n Mean: 4.867057634751466\n Std Deviation: 2.9069667036119227\nfloor distribution of 10000:\n 0: 9.65%\n 1: 9.93%\n 2: 9.65%\n 3: 10.26%\n 4: 10.27%\n 5: 9.86%\n 6: 10.28%\n 7: 10.82%\n 8: 9.63%\n 9: 9.65%\n\nBase Case\nOutput Analysis: Random.triangular(0.0, 10.0, 5.0)\nTypical Timing: 135 \u00b1 3 ns\nStatistics of 1000 samples:\n Minimum: 0.08318487265393275\n Median: (5.074400575842807, 5.076236960606817)\n Maximum: 9.86020329872816\n Mean: 5.074641841399253\n Std Deviation: 2.0463510010786328\nround distribution of 10000:\n 0: 0.5%\n 1: 3.82%\n 2: 8.18%\n 3: 11.74%\n 4: 15.27%\n 5: 19.32%\n 6: 16.51%\n 7: 11.92%\n 8: 8.21%\n 9: 4.02%\n 10: 0.51%\n\nOutput Analysis: triangular(0.0, 10.0, 5.0)\nTypical Timing: 32 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: 0.21886578707056858\n Median: (5.031083905154265, 5.033130381148204)\n Maximum: 9.78452945728682\n Mean: 4.982342578514234\n Std Deviation: 2.044268582894984\nround distribution of 10000:\n 0: 0.37%\n 1: 4.02%\n 2: 7.83%\n 3: 12.55%\n 4: 16.52%\n 5: 19.23%\n 6: 15.76%\n 7: 11.4%\n 8: 7.91%\n 9: 4.08%\n 10: 0.33%\n\nBase Case\nOutput Analysis: Random.vonmisesvariate(0.0, 1.0)\nTypical Timing: 341 \u00b1 5 ns\nStatistics of 1000 samples:\n Minimum: 0.0007364213608687178\n Median: (3.2146509907496976, 3.2230542329649627)\n Maximum: 6.282561190269031\n Mean: 3.137266146755877\n Std Deviation: 2.280037965797396\nround distribution of 10000:\n 0: 16.4%\n 1: 21.61%\n 2: 8.65%\n 3: 4.69%\n 4: 6.42%\n 5: 17.56%\n 6: 24.67%\n\nOutput Analysis: vonmises_variate(0.0, 1.0)\nTypical Timing: 84 \u00b1 3 ns\nStatistics of 1000 samples:\n Minimum: 7.088059328659505e-05\n Median: (3.5055989465049833, 3.508751599689046)\n Maximum: 6.2730768899479425\n Mean: 3.2129097988310913\n Std Deviation: 2.2707594804908298\nround distribution of 10000:\n 0: 16.39%\n 1: 21.58%\n 2: 8.3%\n 3: 4.9%\n 4: 7.32%\n 5: 17.04%\n 6: 24.47%\n\nBase Case\nOutput Analysis: Random.expovariate(2.0)\nTypical Timing: 107 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 0.004825293155053518\n Median: (0.3339475590771567, 0.33504768894276243)\n Maximum: 4.924657346562189\n Mean: 0.5024383639101334\n Std Deviation: 0.5373505558771798\nround distribution of 10000:\n 0: 63.64%\n 1: 31.26%\n 2: 4.32%\n 3: 0.68%\n 4: 0.08%\n 5: 0.02%\n\nOutput Analysis: exponential_variate(2.0)\nTypical Timing: 28 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: 0.0008941806654377442\n Median: (0.34448056659480314, 0.344557537072367)\n Maximum: 3.0533118950029623\n Mean: 0.5096220478734231\n Std Deviation: 0.50236109475291\nround distribution of 10000:\n 0: 62.87%\n 1: 32.27%\n 2: 4.27%\n 3: 0.54%\n 4: 0.05%\n\nBase Case\nOutput Analysis: Random.gammavariate(1.0, 1.0)\nTypical Timing: 154 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 0.0001043518216335623\n Median: (0.7238448324637033, 0.7306763314084282)\n Maximum: 7.489967691809953\n Mean: 1.066017494471302\n Std Deviation: 1.067530967972691\nround distribution of 10000:\n 0: 39.16%\n 1: 38.38%\n 2: 14.53%\n 3: 4.67%\n 4: 2.09%\n 5: 0.76%\n 6: 0.2%\n 7: 0.16%\n 8: 0.02%\n 9: 0.02%\n 10: 0.01%\n\nOutput Analysis: gamma_variate(1.0, 1.0)\nTypical Timing: 32 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: 0.002317786591353518\n Median: (0.6550548060085771, 0.6592478760092841)\n Maximum: 6.316459901730412\n Mean: 1.0054777222895088\n Std Deviation: 1.0299820868076435\nround distribution of 10000:\n 0: 39.55%\n 1: 37.81%\n 2: 14.32%\n 3: 5.1%\n 4: 1.98%\n 5: 0.73%\n 6: 0.33%\n 7: 0.12%\n 8: 0.04%\n 9: 0.02%\n\nBase Case\nOutput Analysis: Random.weibullvariate(1.0, 1.0)\nTypical Timing: 145 \u00b1 4 ns\nStatistics of 1000 samples:\n Minimum: 0.0018598740936713763\n Median: (0.7184252544835716, 0.7204452672520786)\n Maximum: 8.937730186393916\n Mean: 1.015706636040901\n Std Deviation: 1.0140779194830194\nround distribution of 10000:\n 0: 39.15%\n 1: 38.31%\n 2: 13.99%\n 3: 5.19%\n 4: 2.19%\n 5: 0.7%\n 6: 0.29%\n 7: 0.09%\n 8: 0.07%\n 9: 0.01%\n 10: 0.01%\n\nOutput Analysis: weibull_variate(1.0, 1.0)\nTypical Timing: 58 \u00b1 2 ns\nStatistics of 1000 samples:\n Minimum: 0.0008976759063179232\n Median: (0.6488083376899645, 0.6498074418129876)\n Maximum: 6.412002684271835\n Mean: 0.9987298818928606\n Std Deviation: 1.0025110411063485\nround distribution of 10000:\n 0: 39.52%\n 1: 37.8%\n 2: 14.71%\n 3: 5.21%\n 4: 1.7%\n 5: 0.61%\n 6: 0.29%\n 7: 0.13%\n 8: 0.03%\n\nBase Case\nOutput Analysis: Random.normalvariate(0.0, 1.0)\nTypical Timing: 241 \u00b1 9 ns\nStatistics of 1000 samples:\n Minimum: -2.975886446266224\n Median: (-0.034644481967302285, -0.03332564557428542)\n Maximum: 3.2915980692325637\n Mean: -0.03332087302211955\n Std Deviation: 0.9981712501163037\nround distribution of 10000:\n -4: 0.02%\n -3: 0.71%\n -2: 5.84%\n -1: 24.44%\n 0: 37.57%\n 1: 24.81%\n 2: 6.12%\n 3: 0.48%\n 4: 0.01%\n\nOutput Analysis: normal_variate(0.0, 1.0)\nTypical Timing: 44 \u00b1 3 ns\nStatistics of 1000 samples:\n Minimum: -3.0006136683798967\n Median: (-0.04418867780200639, -0.03976817325860958)\n Maximum: 3.490472892098393\n Mean: -0.056023156777119124\n Std Deviation: 0.9771304060721205\nround distribution of 10000:\n -4: 0.02%\n -3: 0.6%\n -2: 6.0%\n -1: 23.54%\n 0: 39.24%\n 1: 24.08%\n 2: 6.06%\n 3: 0.45%\n 4: 0.01%\n\nBase Case\nOutput Analysis: Random.lognormvariate(0.0, 1.0)\nTypical Timing: 307 \u00b1 8 ns\nStatistics of 1000 samples:\n Minimum: 0.049952190226108\n Median: (0.973103795271095, 0.9740483847848048)\n Maximum: 42.36144152111983\n Mean: 1.654451546936058\n Std Deviation: 2.3731300362626664\nround distribution of 10000:\n 0: 24.14%\n 1: 41.12%\n 2: 15.86%\n 3: 7.66%\n 4: 3.94%\n 5: 2.63%\n 6: 1.43%\n 7: 0.9%\n 8: 0.57%\n 9: 0.44%\n 10: 0.27%\n 11: 0.23%\n 12: 0.16%\n 13: 0.17%\n 14: 0.06%\n 15: 0.06%\n 16: 0.09%\n 17: 0.07%\n 18: 0.05%\n 19: 0.01%\n 20: 0.03%\n 21: 0.02%\n 23: 0.01%\n 24: 0.01%\n 25: 0.03%\n 32: 0.01%\n 37: 0.01%\n 40: 0.01%\n 42: 0.01%\n\nOutput Analysis: log_normal_variate(0.0, 1.0)\nTypical Timing: 65 \u00b1 4 ns\nStatistics of 1000 samples:\n Minimum: 0.039892082110843385\n Median: (1.050183988800905, 1.0511189773868062)\n Maximum: 23.405607550185486\n Mean: 1.5802205512040923\n Std Deviation: 1.8388570144462795\nround distribution of 10000:\n 0: 25.02%\n 1: 41.51%\n 2: 16.0%\n 3: 7.22%\n 4: 3.69%\n 5: 2.25%\n 6: 1.26%\n 7: 0.87%\n 8: 0.53%\n 9: 0.38%\n 10: 0.29%\n 11: 0.21%\n 12: 0.18%\n 13: 0.09%\n 14: 0.11%\n 15: 0.07%\n 16: 0.06%\n 17: 0.03%\n 18: 0.03%\n 19: 0.05%\n 20: 0.01%\n 22: 0.02%\n 23: 0.03%\n 24: 0.01%\n 25: 0.01%\n 26: 0.01%\n 27: 0.01%\n 28: 0.01%\n 29: 0.01%\n 31: 0.01%\n 33: 0.01%\n 39: 0.01%\n\ntimer(beta_variate, 1.0, 1.0)\nTypical Timing: 44 \u00b1 1 ns\n\ntimer(pareto_variate, 1.0)\nTypical Timing: 36 \u00b1 2 ns\n\ntimer(bernoulli_variate, 0.5)\nTypical Timing: 21 \u00b1 1 ns\n\ntimer(binomial_variate, 3, 0.5)\nTypical Timing: 85 \u00b1 2 ns\n\ntimer(negative_binomial_variate, 3, 0.5)\nTypical Timing: 56 \u00b1 2 ns\n\ntimer(geometric_variate, 0.5)\nTypical Timing: 38 \u00b1 1 ns\n\ntimer(poisson_variate, 0.5)\nTypical Timing: 39 \u00b1 1 ns\n\ntimer(extreme_value_variate, 0.0, 2.0)\nTypical Timing: 44 \u00b1 1 ns\n\ntimer(chi_squared_variate, 5.0)\nTypical Timing: 67 \u00b1 4 ns\n\ntimer(cauchy_variate, 0.0, 2.0)\nTypical Timing: 35 \u00b1 1 ns\n\ntimer(fisher_f_variate, 2.0, 3.0)\nTypical Timing: 83 \u00b1 3 ns\n\ntimer(student_t_variate, 5.0)\nTypical Timing: 84 \u00b1 2 ns\n\nRandom Booleans:\nOutput Analysis: percent_true(33.33)\nTypical Timing: 21 \u00b1 1 ns\nStatistics of 1000 samples:\n Minimum: False\n Median: False\n Maximum: True\n Mean: 0.322\n Std Deviation: 0.46747677432631296\nDistribution of 10000 samples:\n False: 66.89%\n True: 33.11%\n\n\nShuffle Performance:\n\tsome_small_list = [i for i in range(10)]\n\tsome_med_list = [i for i in range(100)]\n\tsome_large_list = [i for i in range(1000)]\n\nBase Case:\nRandom.shuffle()  # fisher_yates in python\nTypical Timing: 1405 \u00b1 18 ns\nTypical Timing: 12325 \u00b1 182 ns\nTypical Timing: 135945 \u00b1 1404 ns\n\nFortuna.shuffle()  # knuth_b in cython\nTypical Timing: 215 \u00b1 7 ns\nTypical Timing: 1945 \u00b1 34 ns\nTypical Timing: 18661 \u00b1 726 ns\n\nFortuna.knuth_a()  # knuth_a in cython\nTypical Timing: 445 \u00b1 16 ns\nTypical Timing: 3613 \u00b1 30 ns\nTypical Timing: 41406 \u00b1 459 ns\n\nFortuna.fisher_yates()  # fisher_yates in cython\nTypical Timing: 467 \u00b1 8 ns\nTypical Timing: 3590 \u00b1 24 ns\nTypical Timing: 41282 \u00b1 163 ns\n\n\nClamp Performance:\nsmart_clamp(3, 2, 1) # should be 2:  2\nTypical Timing: 38 \u00b1 2 ns\nfloat_clamp(3.0, 2.0, 1.0) # should be 2.0:  2.0\nTypical Timing: 33 \u00b1 3 ns\n\n\n-------------------------------------------------------------------------\nTotal Test Time: 1.039 seconds\n```\n\n\n## Legal Information\nFortuna is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License. \nSee online version of this license here: <http://creativecommons.org/licenses/by-nc/3.0/>\n\nOther licensing options are available, please contact the author for details: [Robert Sharp](mailto:webmaster@sharpdesigndigital.com)\n",
    "bugtrack_url": null,
    "license": "Free for non-commercial use",
    "summary": "High Performance Random Value Toolkit",
    "version": "5.5.8",
    "project_urls": {
        "Homepage": "https://github.com/BrokenShell/Fortuna"
    },
    "split_keywords": [
        "fortuna",
        " high performance random value toolkit",
        " random patterns",
        " data perturbation",
        " game dice",
        " weightedchoice",
        " random value generator",
        " gaussian distribution",
        " linear distribution",
        " truffleshuffle",
        " flexcat",
        " percent true",
        " zerocool",
        " quantummonty",
        " custom distribution",
        " rarity table",
        " d20",
        " generative modeling",
        " multithreading aware random engine",
        " bernoulli",
        " binomial",
        " negative_binomial",
        " geometric",
        " poisson",
        " lognormal",
        " exponential",
        " gamma",
        " weibull",
        " extreme_value",
        " chi_squared",
        " cauchy",
        " fisher_f",
        " student_t",
        " pareto",
        " vonmises",
        " triangular"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae7184b370a75e9be16abea2fac4be5b9a57d2792a51fce1f51d3fee6b960b8c",
                "md5": "2a94c6c1fa196802852f8d27edefd7e2",
                "sha256": "3aded81b1ed94bc943370a6f02fc8d4d8dbbf9d516438361d5f91c6d03dde075"
            },
            "downloads": -1,
            "filename": "Fortuna-5.5.8-cp311-cp311-macosx_10_9_universal2.whl",
            "has_sig": false,
            "md5_digest": "2a94c6c1fa196802852f8d27edefd7e2",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.7",
            "size": 355598,
            "upload_time": "2024-06-23T17:52:25",
            "upload_time_iso_8601": "2024-06-23T17:52:25.898958Z",
            "url": "https://files.pythonhosted.org/packages/ae/71/84b370a75e9be16abea2fac4be5b9a57d2792a51fce1f51d3fee6b960b8c/Fortuna-5.5.8-cp311-cp311-macosx_10_9_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c03f5c3099c911aea13b1ba80310ae2e66c2d0bf693a9fa74d036af87c2b0f87",
                "md5": "78aa06903b09a79dda50198765db1a4c",
                "sha256": "489f494b2a8360c10b307da0331b3a9cccd1802423d4a46ebb7f6efc9a83f853"
            },
            "downloads": -1,
            "filename": "fortuna-5.5.8.tar.gz",
            "has_sig": false,
            "md5_digest": "78aa06903b09a79dda50198765db1a4c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 259679,
            "upload_time": "2024-06-23T17:52:30",
            "upload_time_iso_8601": "2024-06-23T17:52:30.890877Z",
            "url": "https://files.pythonhosted.org/packages/c0/3f/5c3099c911aea13b1ba80310ae2e66c2d0bf693a9fa74d036af87c2b0f87/fortuna-5.5.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-23 17:52:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "BrokenShell",
    "github_project": "Fortuna",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "fortuna"
}
        
Elapsed time: 3.91628s