Brain-5D-Space / src /embodiment /environment.py
github-actions[bot]
Sync: publish Space API fix
5e0b58b
Raw History Blame Contribute Delete
892 Bytes
"""Environment contracts for embodied Brain-5D experiments."""
from __future__ import annotations
from typing import Protocol, runtime_checkable
from .models import ActionCommand, EnvironmentKind, EnvironmentObservation
@runtime_checkable
class EnvironmentAdapter(Protocol):
"""Reset/step contract shared by simulation, physical, and digital worlds."""
@property
def environment_id(self) -> str:
"""Return a stable environment identifier."""
...
@property
def kind(self) -> EnvironmentKind:
"""Return the environment category."""
...
def reset(self, seed: int | None = None) -> EnvironmentObservation:
"""Start a new episode and return its initial observation."""
...
def step(self, action: ActionCommand) -> EnvironmentObservation:
"""Advance the environment by applying one action."""
...