Update lexicographic_minimize definition
This commit is contained in:
parent
3a623816c8
commit
8f6d5f1835
@ -207,28 +207,20 @@ 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))
|
||||||
else
|
elseif status() = UNSAT then
|
||||||
if status() = UNSAT then
|
|
||||||
if lastval(stage) < l then
|
|
||||||
stage = lastval(stage) + 1
|
stage = lastval(stage) + 1
|
||||||
else
|
else /* status() = SAT */
|
||||||
complete() % we are finished
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
stage = lastval(stage)
|
stage = lastval(stage)
|
||||||
/\ best[stage] = sol(_objective)
|
/\ o[stage] < sol(o[stage])
|
||||||
endif
|
endif
|
||||||
/\ for(i in min(index_set(o))..stage-1) (
|
/\ forall(i in min(index_set(o))..stage-1) (
|
||||||
o[i] = lastval(best[i])
|
o[i] = sol(o[i])
|
||||||
)
|
)
|
||||||
/\ if status() = SAT then
|
/\ if stage > max(index_set(o)) then
|
||||||
o[stage] < sol(_objective)
|
complete()
|
||||||
endif
|
|
||||||
/\ _objective = o[stage]
|
|
||||||
endif;
|
endif;
|
||||||
\end{mzn}
|
\end{mzn}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user