Random Distribution

Contains the abstract definition of a random distribution. It allows to create custom distributions as expressions that can be used in the framework.

Example

Creating the distribution:

class SomeRandomDistribution(RandomDistribution):
    _min: float

    def __init__(self, min: float):
        self._min = min

    def generate(self) -> float:
        raise random() + min

    def generate_list(self, size: int) -> List[float]:
        r = []
        for i in range(size):
            r.append(self.generate())
        return r
class gsf.core.mathematics.distributions.random_distribution.RandomDistribution

Bases: gsf.core.expressions.expression.Expression

Math random distribution

abstract generate()Union[float, int]

Generates a value following the distribution

abstract generate_list(size: int)Union[List[float], List[int]]

Generates a list of values following the distribution

Parameters

size (int) – Size of the list