CoverageRule

Source:

Local role: Abstract visibility policy.

Big-picture role: Extensibility seam controlling which spaces, memberships, and relations enter Perception through Sensor.

Inheritance:

  • abstract base class

Methods:

  • covers_space(space, actor_id, world) -> bool
  • covers_membership(membership, actor_id, world) -> bool
  • covers_relation(relation, actor_id, world) -> bool

Example:

from ometeotl_core.model.sensor import CoverageRule

class PhysicalOnlyCoverageRule(CoverageRule):
    """Only include physical spaces and their memberships/relations."""

    def covers_space(self, space, actor_id, world):
        return space.kind == "physical"

    def covers_membership(self, membership, actor_id, world):
        space = world.get_space(membership.space_id)
        return space is not None and space.kind == "physical"

    def covers_relation(self, relation, actor_id, world):
        return True

See also:

Ometeotl

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