# `Tune.Search.Program.Context`
[🔗](https://github.com/mikehostetler/tune/blob/v0.5.0/lib/tune/search/program/context.ex#L1)

Internal operations and program data for one search strategy.

Shared candidate, limit, accounting, random, and result state belongs to
`Tune.Search.Study`.

# `t`

```elixir
@type t() :: %Tune.Search.Program.Context{
  failure_score: term(),
  optimizer: term(),
  run_options: term(),
  scores: term(),
  selector: term(),
  study: term(),
  train: term(),
  validation: term()
}
```

# `best`

```elixir
@spec best(t()) :: {:ok, Tune.Program.t(), t()} | {:error, Exception.t(), t()}
```

# `budget`

```elixir
@spec budget(t()) :: non_neg_integer() | nil
```

# `consider`

```elixir
@spec consider(t(), Tune.Program.t(), Tune.Evaluation.t() | nil, map()) ::
  {String.t(), t()}
```

# `evaluate`

```elixir
@spec evaluate(t(), Tune.Program.t(), [Tune.Case.t()]) :: {Tune.Evaluation.t(), t()}
```

# `evaluate_validation`

```elixir
@spec evaluate_validation(t(), Tune.Program.t()) :: {Tune.Evaluation.t(), t()}
```

# `exhausted?`

```elixir
@spec exhausted?(t()) :: boolean()
```

# `incumbent`

```elixir
@spec incumbent(t()) :: Tune.Candidate.t() | nil
```

# `limit_error`

```elixir
@spec limit_error(atom()) :: Exception.t()
```

# `max_model_calls`

```elixir
@spec max_model_calls(t()) :: non_neg_integer() | nil
```

# `new`

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

# `note`

```elixir
@spec note(t(), atom(), term()) :: t()
```

# `notes`

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

# `propose`

```elixir
@spec propose(t(), Tune.Predictor.t(), map(), atom()) ::
  {{:ok, map()} | {:error, term()}, t()}
```

# `random`

```elixir
@spec random(t()) :: {float(), t()}
```

# `result`

```elixir
@spec result(t(), term(), map(), keyword()) :: Tune.Result.t()
```

# `run`

```elixir
@spec run(t(), Tune.Program.t(), map(), atom()) ::
  {{:ok, Tune.Prediction.t()} | {:error, term()}, t()}
```

# `sample`

```elixir
@spec sample(t(), list(), non_neg_integer()) :: {list(), t()}
```

# `score`

```elixir
@spec score(t(), Tune.Case.t(), Tune.Prediction.t()) ::
  {{:ok, %{score: number(), feedback: String.t() | nil}} | {:error, term()},
   t()}
```

# `seed`

```elixir
@spec seed(t()) :: term()
```

# `shuffle`

```elixir
@spec shuffle(t(), list()) :: {list(), t()}
```

# `stop`

```elixir
@spec stop(t(), atom()) :: t()
```

# `stop_reason`

```elixir
@spec stop_reason(t()) :: atom() | nil
```

# `uniform`

```elixir
@spec uniform(t(), pos_integer()) :: {non_neg_integer(), t()}
```

---

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