# `Monty.Frameworks.Environments.PositioningProcedures`
[🔗](https://github.com/d-led/ex.tbp.monty/blob/v0.1.0/packages/ex_tbp_monty_core/lib/monty/frameworks/positioning_procedures.ex#L1)

Where the agent stands before an episode starts, and how it gets there.

Mirrors `tbp/monty/frameworks/environments/positioning_procedures.py`. Monty's
evaluation episodes do not begin from wherever the simulation left the agent:
they begin from a position a procedure chose, so that "the first view of the
object" means the same thing in every episode and in every experiment. This
module holds the two functions that read an observation for that purpose, and
the module tree holds the procedures themselves.

## What counts as being on an object

Both functions read the *semantic* channel — the ids the environment stamped on
each pixel — and never the depth. A pixel that returned a depth but carries no
semantic id is background, which is the same distinction the salience module
makes (`OnObjectObservation`).

# `depth_at_center`

```elixir
@spec depth_at_center(map(), atom() | String.t(), atom() | String.t()) :: float()
```

The depth at the centre pixel of one sensor's view.

Monty's `PositioningProcedure.depth_at_center`, a static method there; a
function here because nothing about it depends on a procedure's state.

# `get_perc_on_obj_semantic`

```elixir
@spec get_perc_on_obj_semantic([[integer()]], integer() | :any) :: float()
```

How much of the view is on an object, as a fraction of its pixels.

`:any` counts every pixel with a semantic id; an integer counts only the
pixels of that object. Monty's `get_perc_on_obj_semantic`.

# `result`

```elixir
@spec result(map()) ::
  Monty.Frameworks.Environments.PositioningProcedures.PositioningProcedureResult.t()
```

The result a procedure answers with when it has nothing else to say.

---

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