as2fm.jani_generator.jani_entries.jani_variable.JaniVariable
- class as2fm.jani_generator.jani_entries.jani_variable.JaniVariable(v_name: str, v_type: Type[bool | int | float | MutableSequence[int] | MutableSequence[float]], init_value: JaniExpression | JaniValue | None = None, v_transient: bool = False)
Bases:
object
- __init__(v_name: str, v_type: Type[bool | int | float | MutableSequence[int] | MutableSequence[float]], init_value: JaniExpression | JaniValue | None = None, v_transient: bool = False)
Methods
__init__
(v_name, v_type[, init_value, ...])as_dict
()Return the variable as a dictionary.
from_dict
(variable_dict)Get initial expression.
get_type
()Get type.
name
()Get name.
python_type_from_json
(json_type)Translate a (Jani) type string or dict to a Python type.
python_type_to_json
(v_type)Translate a Python type to the name of the type in Jani.
- as_dict()
Return the variable as a dictionary.
- get_init_expr() JaniExpression | None
Get initial expression. if available. None otherwise.
- get_type() Type[bool | int | float | MutableSequence[int] | MutableSequence[float]]
Get type.
- name()
Get name.
- static python_type_from_json(json_type: str | dict) bool | int | float | MutableSequence[int] | MutableSequence[float]
Translate a (Jani) type string or dict to a Python type.
- static python_type_to_json(v_type: Type[bool | int | float | MutableSequence[int] | MutableSequence[float]]) str | dict
Translate a Python type to the name of the type in Jani.
// Types // We cover only the most basic types at the moment. // In the remainder of the specification, all requirements like “y must be of type x” are // to be interpreted as “type x must be assignable from y’s type”. var BasicType = schema([ “bool”, // assignable from bool “int”, // numeric; assignable from int and bounded int “real” // numeric; assignable from all numeric types ]); src https://docs.google.com/document/d/ 1BDQIzPBtscxJFFlDUEPIo8ivKHgXT8_X6hz5quq7jK0/edit