NoiseRule

Source:

Local role: Abstract distortion policy over sensed copies.

Big-picture role: Extensibility seam that injects uncertainty and bias into Perception built by Sensor.

Inheritance:

  • abstract base class

Methods:

  • apply_to_space(space, actor_id) -> Tuple[Space, JsonMap]
  • apply_to_membership(membership, actor_id) -> Tuple[SpaceObjectMembership, JsonMap]
  • apply_to_relation(relation, actor_id) -> Tuple[SpaceRelation, JsonMap]

Example:

import copy
from ometeotl_core.model.sensor import NoiseRule

class LabelObfuscationRule(NoiseRule):
    """Replaces space labels with '???' to model imperfect identification."""

    def apply_to_space(self, space, actor_id):
        s = copy.deepcopy(space)
        s.set_attribute("label", "???")
        return s, {"obfuscated": True}

    def apply_to_membership(self, membership, actor_id):
        return membership, {}

    def apply_to_relation(self, relation, actor_id):
        return relation, {}

See also:

Ometeotl

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