# `Monty.Cmp.Goal`
[🔗](https://github.com/d-led/ex.tbp.monty/blob/v0.1.0/packages/ex_tbp_monty_core/lib/monty/cmp/goal.ex#L1)

A target state on the cortical messaging protocol.

Mirrors `tbp/monty/cmp.py::Goal`. A goal is a `Message` whose location and
features are the values the receiver should achieve; `confidence` is the
conviction with which the goal generator believes it should be acted upon,
and `goal_tolerances` says how closely each element has to match before the
goal counts as achieved.

Unlike a message, every state field may be `nil`: "go to that object" does not
specify a location, and "move that way" does not specify an object.

# `t`

```elixir
@type t() :: %Monty.Cmp.Goal{
  confidence: float(),
  goal_tolerances: map() | nil,
  info: map(),
  location: [float()] | nil,
  morphological_features: map() | nil,
  non_morphological_features: map() | nil,
  pass_message: boolean(),
  process_features_in_lm: boolean(),
  sender_id: String.t(),
  sender_type: :sm | :lm | :gsg
}
```

# `new`

```elixir
@spec new(map() | keyword()) :: {:ok, t()} | {:error, term()}
```

Builds a goal. Fields a goal generator did not decide are simply absent.

---

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