Strategy

Source:

Local role: Declarative strategy tree composed of StrategyNode objects and their StrategyOutcomeBranch links.

Big-picture role: Current strategy-layer root object. It is the first model-level structure that chains action projections through successive perceived states.

Inheritance:

Parameters and fields:

  • id: str
  • actor_id: str
  • goal_id: Optional[str]
  • root_node_id: str
  • nodes: list[StrategyNode]
  • projection_policy: str

Methods:

  • add_node(node) -> None
  • get_node(node_id) -> Optional[StrategyNode]
  • validate_tree() -> None
  • to_dict() -> dict
  • from_dict(data) -> Strategy

Important behavior:

  • validates that root_node_id exists
  • validates branch ids are unique per node
  • validates branch child references
  • validates that child nodes consume the parent node’s projected successor perception when a parent branch links to that child

Builder functions in the same source module:

  • build_linear_strategy(...)
  • build_branching_strategy(...)

See also:

Ometeotl

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