GuardedJsonDict

Source:

Local role: Guarded dictionary wrapper used in mutable fields of ModelObject.

Big-picture role: Prevents direct mutations when authority lock is active through World.

Inheritance:

  • dict[str, Any]

Parameters and fields:

  • initial: Mapping[str, Any] | None
  • mutation_guard: MutationGuard

Methods:

  • set_mutation_guard(...)
  • guarded mutators: __setitem__, __delitem__, clear, pop, popitem, setdefault, update
  • __deepcopy__(...)

See also:

Ometeotl

A Python library to build complex multi-agent simulations, wargames, and AI-driven strategies