aea.runtime

This module contains the implementation of runtime for economic agent (AEA).

RuntimeStates Objects

class RuntimeStates(Enum)

Runtime states.

BaseRuntime Objects

class BaseRuntime(ABC)

Abstract runtime class to create implementations.

__init__

 | __init__(agent: "Agent", loop: Optional[AbstractEventLoop] = None) -> None

Init runtime.

Arguments:

  • agent: Agent to run.
  • loop: optional event loop. if not provided a new one will be created.

Returns:

None

start

 | start() -> None

Start agent using runtime.

stop

 | stop() -> None

Stop agent and runtime.

is_running

 | @property
 | is_running() -> bool

Get running state of the runtime.

is_stopped

 | @property
 | is_stopped() -> bool

Get stopped state of the runtime.

set_loop

 | set_loop(loop: AbstractEventLoop) -> None

Set event loop to be used.

Arguments:

  • loop: event loop to use.

AsyncRuntime Objects

class AsyncRuntime(BaseRuntime)

Asynchronous runtime: uses asyncio loop for multiplexer and async agent main loop.

__init__

 | __init__(agent: "Agent", loop: Optional[AbstractEventLoop] = None) -> None

Init runtime.

Arguments:

  • agent: Agent to run.
  • loop: optional event loop. if not provided a new one will be created.

Returns:

None

set_loop

 | set_loop(loop: AbstractEventLoop) -> None

Set event loop to be used.

Arguments:

  • loop: event loop to use.

run_runtime

 | async run_runtime() -> None

Run agent and starts multiplexer.

ThreadedRuntime Objects

class ThreadedRuntime(BaseRuntime)

Run agent and multiplexer in different threads with own asyncio loops.