Skip to content

Actions

Awaitable actions.

BaseAction

Base of all internal awaitable actions. Simulation authors should not use this directly.

Source code in src/asimpy/actions.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class BaseAction:
    """
    Base of all internal awaitable actions. Simulation authors should not use this directly.
    """

    def __init__(self, env: "Environment"):
        """
        Construct a new awaitable action.

        Args:
            env: simulation environment.
        """
        self._env = env

    def __await__(self) -> Any:
        """Handle `await`."""
        yield self
        return None

__await__()

Handle await.

Source code in src/asimpy/actions.py
23
24
25
26
def __await__(self) -> Any:
    """Handle `await`."""
    yield self
    return None

__init__(env)

Construct a new awaitable action.

Parameters:

Name Type Description Default
env Environment

simulation environment.

required
Source code in src/asimpy/actions.py
14
15
16
17
18
19
20
21
def __init__(self, env: "Environment"):
    """
    Construct a new awaitable action.

    Args:
        env: simulation environment.
    """
    self._env = env