RandomGenerator

The RandomGenerator class is used to generate random variables in the model.

To import this class use:

import ru.biosoft.physicell.core.RandomGenerator

All members of the RandomGenerator class are presented below.

Members of the RandomGenerator class

Class member

Description

boolean checkRandom(double probability)

probability - probability (range [0, 1]).

Returns true if probability > a randomly generated number from the range [0, 1].

Example of usage.

double UniformRandom()

Returns a random number with a uniform distribution between 0 and 1.

Example of usage.

double UniformRandom(double value1, double value2)

value1 - number.
value2 - number.

Returns a random number with a uniform distribution from value1 to value2.

Example of usage.

double NormalRandom(double mean, double SD)

mean - average value.
SD - standard deviation.

Returns a normally distributed random number with mean mean and standard deviation SD.

Example of usage.

double NormalRestricted(double mean, double SD, double min, double max)

mean - average value.
SD - standard deviation.
min - minimum value.
max - maximum value.

Returns a normally distributed random number with mean mean, standard deviation SD, minimum value min and maximum value max.
If the value of this number is outside the specified range, the closest valid number is returned.

Example of usage.