easylocal::solvers::pipeline_stage
A stage of a pipeline: a named runner, with an optional target cost, a number of attempts, and an optional time limit and evaluation budget.
Synopsis
Declared in <easylocal/solvers/pipeline.hpp>
template<class Runner>
class pipeline_stage;
Description
A stage is built by stage(name, runner) and refined by with_target(), with_attempts(), until_feasible(), with_timeout() and with_max_evaluations(), each returning the refined stage, or with & and the modifiers target(), attempts(), until_feasible(), timeout() and max_evaluations().
Type Aliases
| Name | Description |
|---|---|
bound_runner_type | The runner bound to an Input. |
cost_type | The cost of the runner, in which the stage's target is written. |
input_type | The Input of the runner. |
runner_type | The runner, unbound. |
solution_type | The solution of the runner. |
Member Functions
| Name | Description |
|---|---|
pipeline_stage [constructor] | The stage name running runner, once, with no target. |
name | The stage's name, which prefixes its parameters. |
parameters | The stage's own parameters (attempts, timeout, max_evaluations). |
restarts | Whether the attempts after the first start from a new solution (with_restart()). |
runner | The runner. |
target | The target cost, if any. |
until_feasible | The same stage on the hard cost only, until it is zero: a feasible solution. |
until_feasible | The same stage on the hard cost only, until it is zero: a feasible solution. |
with_attempts | The same stage, run up to count times while it does not reach its target, keeping the best run. |
with_attempts | The same stage, run up to count times while it does not reach its target, keeping the best run. |
with_max_evaluations | The same stage, stopped once it has made count evaluations, all its attempts together. |
with_max_evaluations | The same stage, stopped once it has made count evaluations, all its attempts together. |
with_restart | The same stage, whose attempts after the first start from a new solution built as initialization says, rather than from the solution the stage received: initialization::initial, random or automatic, rejected at compile time when the runner does not support it. |
with_restart | The same stage, whose attempts after the first start from a new solution built as initialization says, rather than from the solution the stage received: initialization::initial, random or automatic, rejected at compile time when the runner does not support it. |
with_target | The same stage, stopping as soon as its best cost reaches target. |
with_target | The same stage, stopping as soon as its best cost reaches target. |
with_timeout | The same stage, stopped once seconds have passed since it started. |
with_timeout | The same stage, stopped once seconds have passed since it started. |
with_timeout | The same stage, stopped once limit has passed since it started, all its attempts together. |
with_timeout | The same stage, stopped once limit has passed since it started, all its attempts together. |
Friends
| Name | Description |
|---|---|
easylocal::solvers::Pipeline | Runners in sequence over the same Input and Solution: each stage starts from the solution of the previous one, the first from an initial solution. |
easylocal::solvers::pipeline_stage | A stage of a pipeline: a named runner, with an optional target cost, a number of attempts, and an optional time limit and evaluation budget. |
Non-Member Functions
| Name | Description |
|---|---|
operator& | The stage with a target: stage.with_target(target.cost). |
operator& | The stage with a number of attempts: stage.with_attempts(attempts.count). |
operator& | The stage with a time limit or an evaluation budget: stage & timeout(10s), as stage.with_timeout(10s), and stage & max_evaluations(5000), as stage.with_max_evaluations(5000). |
operator& | The stage whose attempts after the first start from a new solution: stage.with_restart(restart.initialization). |
operator& | The stage on the hard cost until it is zero: stage.until_feasible(). |
operator| | The pipeline of two stages: pipeline(first, second). |
pipeline | A pipeline of stages, in order: pipeline(a, b, c) is a | b | c, and pipeline(a) the pipeline of one stage, which then() extends. |
stage | The stage name of a pipeline, running runner. |