Update lexicographic_minimize definition

This commit is contained in:
Jip J. Dekker 2021-07-09 13:32:31 +10:00
parent 3a623816c8
commit 8f6d5f1835
No known key found for this signature in database
GPG Key ID: 517DF4A00618C9C3

View File

@ -205,31 +205,23 @@ It required that, once a solution is found, each subsequent solution must either
We can model this strategy restarts as such: We can model this strategy restarts as such:
\begin{mzn} \begin{mzn}
predicate lex_minimize(array[int] of var int: o) = predicate lex_minimize(array[int] of var int: o) =
let { let {
var index_set(o): stage var min(index_set(o))..max(index_set(o))+1: stage;
array[index_set(o)] of var int: best; } in if status() = START then
} in if status() = START then stage = min(index_set(o))
stage = min(index_set(o)) elseif status() = UNSAT then
else stage = lastval(stage) + 1
if status() = UNSAT then else /* status() = SAT */
if lastval(stage) < l then stage = lastval(stage)
stage = lastval(stage) + 1 /\ o[stage] < sol(o[stage])
else endif
complete() % we are finished /\ forall(i in min(index_set(o))..stage-1) (
endif o[i] = sol(o[i])
else )
stage = lastval(stage) /\ if stage > max(index_set(o)) then
/\ best[stage] = sol(_objective) complete()
endif endif;
/\ for(i in min(index_set(o))..stage-1) (
o[i] = lastval(best[i])
)
/\ if status() = SAT then
o[stage] < sol(_objective)
endif
/\ _objective = o[stage]
endif;
\end{mzn} \end{mzn}
The lexicographic objective changes the objective at each stage in the evaluation. The lexicographic objective changes the objective at each stage in the evaluation.