# 4.2.7.1. On Restart¶

These annotations and functions provide the basic building blocks to implement meta-heuristics triggered on restart and governed search with the use of solver internal values and functionality.

In this section: STATUS, basic_lns, complete, last_val, round_robin, sol, uniform_on_restart, on_restart.

## Constants¶

### STATUS¶

 set of int: STATUS  Reports the status of the solver (before restarting).

## Functions and Predicates¶

### basic_lns¶

 predicate basic_lns(var bool: nbh)  ‘basic_lns’ provides LNS in its simplest form where one nbh is applied on every restart.

### complete¶

 predicate complete()  When complete is set to ‘true’, then it marks the search as complete.

### last_val¶

 predicate last_val(var bool: x) function var float: last_val(var float: x) function var $$E: last_val(var$$E: x) function var opt $$E: last_val(var opt$$E: x) function var set of $$E: last_val(var set of$$E: x)  Provides access to last values taken by a model variables. The last_val functions are only safe to use when the STATUS has been SAT or OPT.

### round_robin¶

 predicate round_robin(array [int] of var bool: nbhs)  round_robin provides a metaheuristic for LNS where each neighbourhood is chosen sequentially.

### sol¶

 predicate sol(var bool: x) function var float: sol(var float: x) function var $$E: sol(var$$E: x) function var opt $$E: sol(var opt$$E: x) function var set of $$E: sol(var set of$$E: x) function array [$$E] of var bool: sol(array [$$E] of var bool: x) function array [$$E] of var float: sol(array [$$E] of var float: x) function array [$$E] of var$$F: sol(array [$$E] of var$$F: x)  Provides access to solution values of model variables. The sol function are only safe to use when the STATUS has been SAT or OPT.

### uniform_on_restart¶

 1. function var $$E: uniform_on_restart($$E: low, $$E: high) 2. function var$$E: uniform_on_restart(set of E: S) 3. function var float: uniform_on_restart(float: low, float: high)  Returns a new random value between low and high chosen from a uniform distribution whenver the solver restarts. Returns a new random value from the set S chosen from a uniform distribution whenver the solver restarts. Returns a new random value between low and high chosen from a uniform distribution whenver the solver restarts.

## Annotations¶

### on_restart¶

 annotation on_restart(string: pred)  A search annotation that triggers a function to be executed on restart