[gecode-users] Fwd: Multi-objective Model with Searchcombinators in Gecode

Mohamed Rezgui kyo.alone at gmail.com
Wed Mar 12 20:22:20 CET 2014


---------- Forwarded message ----------
From: Mohamed Rezgui <kyo.alone at gmail.com>
Date: 2014-03-12 20:21 GMT+01:00
Subject: Fwd: [gecode-users] Multi-objective Model with
Searchcombinators in Gecode
To: Guido Tack <tack at gecode.org>


Dear Guido,

I compile successfully searchcombinators with gecode 4.2.1 (I change
with the appropriate API).
I would like to know how can I set 3 ou several objectives (on
lexicographic multi-objective) please ?
I test with different approaches and it does not work.

Other question how can I print pretty like output with trace_solution
I found a bug with concatenation "*" ++ "\n" (it does not work).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
include "globals.mzn";
include "searchcombinators.mzn";

annotation lexicoMinimize3obj(var int: obj1, var int: obj2, var int:
obj3, ann: s) =
let {
%% minimise => svar int: best1 = ub(obj1)
%% maximize => svar int: best1 = lb(obj1)
svar int: best1 = ub(obj1),

%% minimise => svar int: best2 = ub(obj3)
%% maximize => svar int: best2 = lb(obj3)
svar int: best2 = ub(obj2),

%% minimise => svar int: best2 = ub(obj3)
%% maximize => svar int: best2 = lb(obj3)
svar int: best3 = ub(obj3)
}
in (


  portfolio([

%% minimise => obj1 < lv("best1")
%% maximize => obj1 > lv("best1")
and(
post(obj1 < lv("best1"), and(s,assign(best1,obj1))),
prune
),

%% minimise => obj2 < lv("best2")
%% maximize => obj2 > lv("best2")
post(obj1=lv("best1"),
post(obj2 < lv("best2"), and(s,assign(best2,obj2)))),


%% minimise => obj3 < lv("best3")
%% maximize => obj3 > lv("best3")
post(obj2=lv("best2"),
post(obj3 < lv("best3"), and(s,assign(best3,obj3))))

  ])

);

% Variables
var 0..10: obj1;
var 1..10: obj2;
var 2..10: obj3;

%% call
solve
   :: print([obj1, obj2, obj3], lexicoMinimize3obj(obj1, obj2, obj3,
int_search([obj1, obj3, obj2], input_order, assign_ub)
   ))
 satisfy;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Best Regards,
Mohammed REZGUI


-- 
Cordialement,
Mohamed REZGUI



More information about the users mailing list