Source code for negmas.situated.simple

from __future__ import annotations
from abc import ABC
from typing import TYPE_CHECKING, Any, Collection

from negmas.serialization import to_flat_dict

from .world import World

if TYPE_CHECKING:
    from .breaches import Breach
    from .contract import Contract

__all__ = ["SimpleWorld"]


[docs] class SimpleWorld(World, ABC): """ Represents a simple world with no simulation and sane values for most callbacks and methods. """
[docs] def delete_executed_contracts(self) -> None: pass
[docs] def post_step_stats(self): pass
[docs] def pre_step_stats(self): pass
[docs] def order_contracts_for_execution( self, contracts: Collection[Contract] ) -> Collection[Contract]: return contracts
[docs] def contract_record(self, contract: Contract) -> dict[str, Any]: return to_flat_dict(contract, deep=True)
[docs] def breach_record(self, breach: Breach) -> dict[str, Any]: return to_flat_dict(breach, deep=True)
[docs] def contract_size(self, contract: Contract) -> float: return 1.0