wholecell.utils.random
random.py
Special random number generators. Most are holdovers from the original port.
- wholecell.utils.random.make_elongation_rates(random, size, base, amplified, ceiling, time_step, variable_elongation=False)[source]
Create an array of rates where all values are at a base rate except for a set which is at another rate. Also performs a stochastic rounding of values after applying the provided time step.
- Parameters:
random (RandomState) – for generating random numbers.
size (int) – size of new array of rates.
base (int) – unadjusted value for all rates.
amplified (array[int]) – indexes of each rate to adjust.
ceiling (int) – adjusted rate for amplified indexes.
time_step (float) – the current time step.
variable_elongation (bool) – whether to add amplified values to the array.
- Returns:
- new array with lengths to extend for base and adjusted
rates multiplied by the time step
- Return type:
array[int]
- wholecell.utils.random.make_elongation_rates_flat(size, base, amplified, ceiling, variable_elongation=False)[source]
Create an array of rates where all values are at a base rate except for a set which is at another rate.
- Parameters:
- Returns:
new array with base and adjusted rates.
- Return type:
rates