# `Monty.Attention.AttentionSystem`
[🔗](https://github.com/d-led/ex.tbp.monty/blob/v0.1.0/packages/ex_tbp_monty_core/lib/monty/attention/attention_system.ex#L1)

What attention does to a step — Monty's `attention/attention_system.py`.

Sensors propose where to look (`Monty.Cmp.AttentionRegion`), the goal generator
proposes what to do (`Monty.Cmp.Goal`), and the attention system sits between
them: it keeps a grid of how interesting each part of space has been, and it
answers which goals are worth pursuing given that grid.

Monty declares the contract as a `Protocol` over `step`, `reset` and
`state_dict`, and the systems are objects with a `_grid` they mutate. Here the
system is a struct and `step/3` answers `{system, goals}` — the caller threads
the system, so what a step did is visible in its return value rather than only
in the object afterwards.

# `reset`

```elixir
@callback reset(system :: term()) :: system :: term()
```

Forget everything attention has learned.

# `state_dict`

```elixir
@callback state_dict(system :: term()) :: Monty.Memento.t()
```

The system's state, for a recording run.

# `step`

```elixir
@callback step(system :: term(), [Monty.Cmp.Goal.t()], [Monty.Cmp.AttentionRegion.t()]) ::
  {system :: term(), [Monty.Cmp.Goal.t()]}
```

Act on one step's goals given where the sensors looked.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
