monte_carlo.RandomVariable
RandomVariable( name, parent=None, *, value=None, stdev=None, values=None, value_range=None,)Args
- name (str): Name of the random variable.
- parent (Component | Model | Technology | None): Parent object to the variable. Instance of
Component,Model, orTechnology. - value (float | int | complex | None): Mean variable value (normal distribution).
- stdev (float | int | None): Standard deviation for the value (normal distribution).
- values (Sequence[float | int | complex] | None): Sequence of values (discrete set of values).
- value_range (Sequence[float | int] | None): Lower and upper value bounds (uniform distribution).
Note
If a value if set with no standard deviation, the variable assumes the fixed value.
See Also
Methods
Section titled “Methods”| Method | Description |
|---|---|
set_by_cdf | Set the value of this variable from a cumulative distribution function |
size | Size of this variable, if countable. |
set_by_cdf
Section titled “set_by_cdf”set_by_cdf(self, cdf)Set the value of this variable from a cumulative distribution function (CDF) value in range 0 to 1.
Args
- cdf (float): CDF value.
Returns
New variable value.
size(self)Size of this variable, if countable.
Fixed-value variables have a size of 1, whereas the size of variables
with a discrete value set are the number of options in the set.
Variables with normal or uniform distributions nahe no size and will
return None.
Returns
Variable size or None.
Attributes
Section titled “Attributes”| Attribute | Description |
|---|---|
name | str: Random variable name. |
parent | Component | Model | Technology | None: Random variable parent. |
properties | Properties: Object properties. |
type | str: Random variable type (read only). |
value | object: Current random variable value (read only). |
value_spec | dict[str, object]: Value specification for this variable, interpreted based on the variable type (read only). |
str: Random variable name.
parent
Section titled “parent”Component | Model | Technology | None: Random variable parent.
properties
Section titled “properties”Properties: Object properties.
str: Random variable type (read only).
object: Current random variable value (read only).
value_spec
Section titled “value_spec”dict[str, object]: Value specification for this variable, interpreted based on the variable type (read only).