Skip to content

incremental

Stepable

Bases: Protocol

Base class for stepable environments.

Stepable environments are environments that can be advanced by a step. Usually, this is combined with an observable to provide a stream of data.

step() abstractmethod

Advance the environment by one step.

Source code in src/flowcean/core/environment/incremental.py
21
22
23
@abstractmethod
def step(self) -> None:
    """Advance the environment by one step."""

Finished

Bases: Exception

Exception raised when the environment is finished.

This exception is raised when the environment is finished, and no more data can be retrieved.

IncrementalEnvironment

Bases: Environment, Stepable, Iterable[Data], Protocol

Base class for incremental environments.

Incremental environments are environments that can be advanced by a step and provide a stream of data. The data can be observed at each step.

num_steps()

Return the number of steps in the environment.

Returns:

Type Description
int | None

The number of steps in the environment, or None if the number of

int | None

steps is unknown.

Source code in src/flowcean/core/environment/incremental.py
57
58
59
60
61
62
63
64
def num_steps(self) -> int | None:
    """Return the number of steps in the environment.

    Returns:
        The number of steps in the environment, or None if the number of
        steps is unknown.
    """
    return None