stormvogel.model.variable¶
A model variable.
Attributes¶
Classes¶
A bounded integer domain [lo, hi]. |
|
A boolean domain {False, True}. |
|
A finite categorical domain with an explicit ordered set of values. |
|
A named observable predicate with a required domain and an optional defining expression. |
Module Contents¶
- class stormvogel.model.variable.IntDomain¶
A bounded integer domain [lo, hi].
- Parameters:
lo – Lower bound (inclusive).
hi – Upper bound (inclusive).
allow_none – Whether
Noneis a valid value.
- lo: int¶
- hi: int¶
- allow_none: bool = False¶
- contains(value: Any) bool¶
- __repr__()¶
- class stormvogel.model.variable.BoolDomain¶
A boolean domain {False, True}.
- Parameters:
allow_none – Whether
Noneis a valid value.
- allow_none: bool = False¶
- contains(value: Any) bool¶
- __repr__()¶
- class stormvogel.model.variable.CategoricalDomain¶
A finite categorical domain with an explicit ordered set of values.
- Parameters:
values – All valid values, as a tuple to preserve order.
allow_none – Whether
Noneis a valid value.
- values: tuple[Any, Ellipsis]¶
- allow_none: bool = False¶
- contains(value: Any) bool¶
- __repr__()¶
- stormvogel.model.variable.VariableDomain¶
- class stormvogel.model.variable.Variable¶
- label: str¶
- domain: VariableDomain | None = None¶
- __lt__(other)¶
- check_valuation(value: Any) None¶
Raise
ValueErrorifvalueis outside this variable’s declared domain.
- __repr__()¶
- __str__¶
- class stormvogel.model.variable.Predicate¶
A named observable predicate with a required domain and an optional defining expression.
- Parameters:
label – Human-readable name for the predicate.
domain – The domain of values this predicate can take.
expr – Optional callable
f(valuations) -> valuethat computes the predicate value from a state’s{Variable: value}dict.Nonewhen the predicate was imported from an external tool and the expression is not available.
- label: str¶
- domain: VariableDomain¶
- check_valuation(value: Any) None¶
Raise
ValueErrorifvalueis outside this predicate’s domain.
- __repr__()¶
- __str__¶
- stormvogel.model.variable.VariableKey¶