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

A policy that takes one sampled action, whatever the step looked like.

Mirrors `tbp/monty/frameworks/models/motor_policies.py::BasePolicy`, the
bottom of the policy hierarchy: it ignores the observations, the state, the
percept and the goal, and asks its sampler for an action. What it is for is
the experiments that only need the body to wander — and being the parent that
every other policy is built on.

The sampler is a `Monty.Frameworks.Actions.ActionSamplers` struct, as Monty's
is, and the random stream it draws from lives on the policy: `nil` until the
first draw, then whatever that draw left behind. Monty reads the stream from
the runtime context and mutates it there; a struct cannot be mutated here, so
the policy owns it and `ActionSampler.stream/3` starts it from the context
(`docs/monty-differences.md` §2.5).

# `t`

```elixir
@type t() :: %Monty.Frameworks.Models.MotorPolicies.BasePolicy{
  action_sampler: Monty.Frameworks.Actions.ActionSamplers.ActionSampler.t(),
  agent_id: atom() | String.t(),
  rng: :rand.state() | nil
}
```

# `call`

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

One sampled action, and nothing else.

`motor_only_step` stays false: a single sample is a real move, and the
learning modules have something to look at afterwards.

# `new`

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

A policy that takes whatever `:action_sampler` chooses for `:agent_id`.

# `reset`

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

Forgets the stream, so the next step draws from the episode again.

Monty's reset is a no-op because its stream belongs to the context rather
than to the policy.

# `state_dict`

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

Nothing to report.

---

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