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

Keep only the goals that land in a place attention wants looked at: Monty's
`attention/goal_filter.py::HardGoalFilter`.

The rules, in Monty's order:

  - an empty grid filters nothing — it has no opinion yet;
  - a goal that lands outside the grid is dropped, unless *every* voxel is
    inhibited, in which case the grid means "not here" everywhere and a goal
    elsewhere is as good as any;
  - a goal in an inhibited voxel is dropped;
  - a goal in a positively weighted voxel is kept.

A goal that carries no location is never filtered: it is not a place, so there
is nothing to look up, and the filter's job is about places. Such goals come
back after the ones that were looked up, in Monty's order.

---

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