ProjectionTool

Source:

Local role: Abstract contract for deriving assumption sets and successor perceived states from Action, Perception, and Resource inputs.

Big-picture role: Extensibility seam for projection logic that stays separate from strategy-node construction while still feeding it with projected successor states.

Inheritance:

  • abstract base class

Methods:

  • project_action(action, perception, resources=()) -> ActionProjection
  • project_actions(actions, perception, resources=()) -> ProjectionBatch

Example:

from ometeotl_core.model.projection import ProjectionTool, ActionProjection

class CustomProjectionTool(ProjectionTool):
    """Minimal projection tool: marks every action as 'projected' unconditionally."""

    def project_action(self, action, perception, resources=()):
        return ActionProjection(
            action_id=action.id,
            actor_id=action.actor_id,
            source_perception_id=perception.id,
            source_id=perception.source_id,
            status="projected",
            resource_ids=[r.id for r in resources],
            assumptions=[],
        )

# Batch projection is inherited from the base class
tool = CustomProjectionTool()
batch = tool.project_actions([action1, action2], perception)

See also:

Ometeotl

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