Source code for tbp.monty.attention.attention_system
# Copyright 2026 Thousand Brains Project
#
# Copyright may exist in Contributors' modifications
# and/or contributions to the work.
#
# Use of this source code is governed by the MIT
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
from __future__ import annotations
from typing import Protocol, Sequence
from tbp.monty.cmp import AttentionRegion, Goal
from tbp.monty.memento import Memento
[docs]class AttentionSystemProtocol(Protocol):
self, goals: Sequence[Goal], regions: Sequence[AttentionRegion]
) -> list[Goal]: ...
[docs] def reset(self) -> None: ...
[docs] def state_dict(self) -> Memento: ...
[docs]class NoopAttentionSystem(AttentionSystemProtocol):
[docs] def step(
self,
goals: Sequence[Goal],
regions: Sequence[AttentionRegion], # noqa: ARG002
) -> list[Goal]:
return list(goals)
[docs] def reset(self) -> None:
"""Nothing to reset."""
[docs] def state_dict(self) -> Memento:
return {}