aea.runtime
This module contains the implementation of runtime for economic agent (AEA).
RuntimeStates Objects
Runtime states.
BaseRuntime Objects
Abstract runtime class to create implementations.
__init__
 | __init__(agent: AbstractAgent, multiplexer_options: Dict, loop_mode: Optional[str] = None, loop: Optional[AbstractEventLoop] = None, threaded: bool = False, task_manager_mode: Optional[str] = None) -> None
Init runtime.
Arguments:
- agent: Agent to run.
- multiplexer_options: options for the multiplexer.
- loop_mode: agent main loop mode.
- loop: optional event loop. if not provided a new one will be created.
- threaded: if True, run in threaded mode, else async
- task_manager_mode: mode of the task manager.
storage
Get optional storage.
loop_mode
Get current loop mode.
task_manager
Get the task manager.
loop
Get event loop.
agent_loop
Get the agent loop.
multiplexer
Get multiplexer.
is_running
Get running state of the runtime.
is_stopped
Get stopped state of the runtime.
state
Get runtime state.
Returns:
RuntimeStates
decision_maker
Return decision maker if set.
set_decision_maker
Set decision maker with handler provided.
set_loop
Set event loop to be used.
Arguments:
- loop: event loop to use.
AsyncRuntime Objects
Asynchronous runtime: uses asyncio loop for multiplexer and async agent main loop.
__init__
 | __init__(agent: AbstractAgent, multiplexer_options: Dict, loop_mode: Optional[str] = None, loop: Optional[AbstractEventLoop] = None, threaded: bool = False, task_manager_mode: Optional[str] = None) -> None
Init runtime.
Arguments:
- agent: Agent to run.
- multiplexer_options: options for the multiplexer.
- loop_mode: agent main loop mode.
- loop: optional event loop. if not provided a new one will be created.
- threaded: if True, run in threaded mode, else async
- task_manager_mode: mode of the task manager.
set_loop
Set event loop to be used.
Arguments:
- loop: event loop to use.
run
Start runtime task.
Starts multiplexer and agent loop.
stop_runtime
Stop runtime coroutine.
Stop main loop. Tear down the agent.. Disconnect multiplexer.
run_runtime
Run runtime which means start agent loop, multiplexer and storage.
ThreadedRuntime Objects
Run agent and multiplexer in different threads with own asyncio loops.