Source code for negmas.situated.monitors

from __future__ import annotations
from typing import TYPE_CHECKING, Any

from .entity import Entity

if TYPE_CHECKING:
    from .world import World


__all__ = ["StatsMonitor", "WorldMonitor"]


[docs] class StatsMonitor(Entity): """A monitor object capable of receiving stats of a world"""
[docs] def init(self, stats: dict[str, Any], world_name: str): """Called to initialize the monitor before running first step"""
[docs] def step(self, stats: dict[str, Any], world_name: str): """Called at the END of every simulation step"""
[docs] class WorldMonitor(Entity): """A monitor object capable of monitoring a world. It has read/write access to the world"""
[docs] def init(self, world: World): """Called to initialize the monitor before running first step"""
[docs] def step(self, world: World): """Called at the END of every simulation step"""