# `Monty.Frameworks.Models.MotorPolicies.NaiveScanPolicy`
[🔗](https://github.com/d-led/ex.tbp.monty/blob/v0.1.0/packages/ex_tbp_monty_core/lib/monty/frameworks/models/motor_policies/naive_scan_policy.ex#L1)

A policy that scans the object in a square spiral and nothing else.

Mirrors `tbp/monty/frameworks/models/motor_policies.py::NaiveScanPolicy`, the
simplest thing that collects a view worth matching: look up, turn left, look
down, turn right, each by the same fixed amount, with each leg one step longer
than the last on alternating sides:

    1x up, 1x left, 2x down, 2x right, 3x up, 3x left, ...

Monty draws the picture: `|_ _ _|` round and round, outward. What makes it
worth having is that nothing in it is learned: every action is fixed at
construction, so it is the policy an experiment uses to ask what the *sensor*
sees rather than what a policy decides.

It is an `InformedPolicy` in Monty, but it overrides the step completely: the
percept, the state, the observations and the goal are all ignored. The
constructor still takes an action sampler, as Monty's does, and never draws
from it — the actions it makes are the four it was built with.

# `t`

```elixir
@type t() :: %Monty.Frameworks.Models.MotorPolicies.NaiveScanPolicy{
  action_sampler: Monty.Frameworks.Actions.ActionSamplers.ActionSampler.t(),
  agent_id: atom() | String.t(),
  current_action_id: non_neg_integer(),
  fixed_amount: float(),
  step_on_action: non_neg_integer(),
  steps_per_action: pos_integer()
}
```

# `call`

```elixir
@spec call(
  t(),
  Monty.Context.t(),
  map() | nil,
  Monty.Frameworks.Models.MotorSystemState.t(),
  Monty.Cmp.Message.t() | nil,
  Monty.Cmp.Goal.t() | nil
) :: {Monty.Frameworks.Models.MotorPolicies.MotorPolicyResult.t(), t()}
```

The next action of the spiral, and nothing else.

`motor_only_step` stays false: every one of these actions is something the
learning modules want to see, which is the whole point of scanning.

# `check_cycle_action`

```elixir
@spec check_cycle_action(t()) :: t()
```

Moves to the next leg of the spiral once the current one is long enough.

Monty's `check_cycle_action`. After the second and the fourth leg of each
circuit the leg gets one step longer, so the square grows by one on every
side.

# `new`

```elixir
@spec new(keyword()) :: t()
```

A spiral scanner for `:agent_id`, turning `:fixed_amount` degrees a leg.

The action sampler is required because Monty's constructor takes one — it is
never asked for anything.

# `reset`

```elixir
@spec reset(t()) :: t()
```

Starts the next episode at the first leg, with legs one step long.

# `state_dict`

```elixir
@spec state_dict(t()) :: map()
```

Nothing to report: the spiral is fixed at construction.

---

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