Skip to content

unienv_interface.remote.protocol

Shared protocol method capabilities, independent of client and server.

ResourceKind module-attribute

ResourceKind = Literal['env', 'world', 'node']

ExecutionMode module-attribute

ExecutionMode = Literal['env', 'components']

OperationKind module-attribute

OperationKind = Literal['reset', 'reload', 'step']

WireMessage module-attribute

WireMessage = Dict[str, Any]

Descriptor module-attribute

Descriptor = Dict[str, Any]

ResetResult module-attribute

ResetResult = Tuple[Any, Any, Dict[str, Any]]

Reward module-attribute

Reward = Union[SupportsFloat, 'ArrayAPIArray']

Signal module-attribute

Signal = Union[bool, 'ArrayAPIArray']

StepResult module-attribute

StepResult = Tuple[Any, Reward, Signal, Signal, Dict[str, Any]]

FIELDS module-attribute

FIELDS: Dict[ResourceKind, Set[str]] = {'env': {'context', 'observation', 'reward', 'terminated', 'truncated', 'info', 'render'}, 'node': {'context', 'observation', 'reward', 'terminated', 'truncated', 'info', 'render'}, 'world': {'dt'}}

PRIORITIES module-attribute

PRIORITIES: Tuple[str, ...] = tuple(f'{phase}_priorities' for phase in ('reset', 'reload', 'after_reset', 'after_reload', 'pre_environment_step', 'post_environment_step'))

METHODS module-attribute

METHODS: Dict[ResourceKind, Dict[str, Dict[str, bool]]] = {'env': {'reset': {'mutation': True}, 'step': {'mutation': True}, 'render': {'mutation': False}, 'reload': {'mutation': True, 'optional': True}}, 'world': {'step': {'mutation': True}, 'reset': {'mutation': True}, 'reload': {'mutation': True}, 'after_reset': {'mutation': True}, 'after_reload': {'mutation': True}}, 'node': {'reset': {'mutation': True}, 'reload': {'mutation': True}, 'after_reset': {'mutation': True}, 'after_reload': {'mutation': True}, 'pre_environment_step': {'mutation': True}, 'post_environment_step': {'mutation': True}, 'set_next_action': {'mutation': True}, 'get_context': {'mutation': False}, 'get_observation': {'mutation': False}, 'get_reward': {'mutation': False}, 'get_termination': {'mutation': False}, 'get_truncation': {'mutation': False}, 'get_info': {'mutation': False}, 'render': {'mutation': False}}}

BoundarySnapshot

Bases: TypedDict

sequence instance-attribute

sequence: int

revision instance-attribute

revision: int

fields instance-attribute

fields: List[str]

data instance-attribute

data: Dict[str, Any]