From 77722f0f871325ac417659b6c69eaa9ef7f5a922 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Mon, 26 Jul 2021 12:01:17 +1000 Subject: [PATCH] Fix the pareto front predicate --- assets/listing/inc_pareto.mzn | 13 ++++++++++++- chapters/5_incremental.tex | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/assets/listing/inc_pareto.mzn b/assets/listing/inc_pareto.mzn index 00d3fb1..f02e3fe 100644 --- a/assets/listing/inc_pareto.mzn +++ b/assets/listing/inc_pareto.mzn @@ -9,11 +9,22 @@ predicate pareto_optimal(var int: obj1, var int: obj2) = nsol = 0 elseif status() = UNSAT then complete() % we are finished! - elseif + elsif status() = SAT then nsol = sol(nsol) + 1 /\ s1[nsol] = sol(obj1) /\ s2[nsol] = sol(obj2) endif /\ for(i in 1..nsol) ( obj1 < lastval(s1[i]) \/ obj2 < lastval(s2[i]) + ) /\ for(i in 1..ms) ( + if i in 1..nsol-1 then + s1[i] = lastval(s1[i]) /\ + s2[i] = lastval(s2[i]) /\ + elsif i = nsol /\ status() != SAT then + s1[i] = lastval(s1[i]) /\ + s2[i] = lastval(s2[i]) /\ + elseif i in nsol+1..ms then + s1[i] = lb(obj1) /\ + s2[i] = lb(obj2) + endif ); diff --git a/chapters/5_incremental.tex b/chapters/5_incremental.tex index 1a740cf..d95acc2 100644 --- a/chapters/5_incremental.tex +++ b/chapters/5_incremental.tex @@ -266,6 +266,7 @@ If we do not find any \glspl{sol}, then we finish the entire search. Otherwise, we record that we have one more \gls{sol}. We store the \gls{sol} values in \mzninline{s1} and \mzninline{s2} \glspl{array}. Before each \gls{restart} we add \constraints{} removing Pareto dominated \glspl{sol}, based on each previous \gls{sol}. +Additionally, we maintain the \glspl{sol} stored in \mzninline{s1} and \mzninline{s2} by assigning them to their previous value and avoid search on the unused spaces in the \glspl{array} by assignment them to the lower bound of their respective \gls{objective}. \section{Rewriting of Meta-Optimisation Algorithms}\label{sec:inc-solver-extension}