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

Guido Tack tack at gecode.org
Wed Mar 12 20:35:28 CET 2014


Hi,

you'd have to be a bit more specific than "does not work".  Did the two objective version work?  In your code the second stage does not do a "prune" when it's done like the first stage, so it will actually never switch to the third stage.

Output is rather limited at the moment, the code you're using was written as a prototype for a paper, not a production quality system.

Cheers,
Guido

On 13 Mar 2014, at 6:21 am, Mohamed Rezgui <kyo.alone at gmail.com> wrote:

> 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




More information about the users mailing list