[gecode-users] dynamic model

Christian Schulte cschulte at kth.se
Wed Feb 1 10:18:30 CET 2012


Hi Alexis,

 

Yep, I know ILOG CP reasonably well. But I have to admit it is really clear
what you are trying to achieve.

 

If you just want to solve goals that are a conjunction that corresponds to
posting the respective goals inside a space. 

 

As you say yourself, disjunctive goals corresponds to a choice generated by
a brancher. Posting a new brancher inside the commit function of some other
brancher is possible in fact. I am not really sure what you mean by the
return type, but let me try: posting a brancher does not fail. So what you
can do inside the commit function is to post a new brancher and return ES_OK
as ExecStatus (signalling that the commit indeed did not fail, a commit
could fail if it for example posted a new constraint).

 

I hope that helps somewhat.

 

Best

Christian

 

--

Christian Schulte, www.ict.kth.se/~cschulte/

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Alexis Cothenet
Sent: Tuesday, January 31, 2012 9:57 PM
To: users at gecode.org
Subject: [gecode-users] dynamic model

 

Hi all,

I'm currently studying the possibilty to migrate to Gecode a software
written with ILOG CP.
The actual model is computed dynamically using goals. I don't know if any of
you are a bit familiar with it, but if yes this is in essence what is done:
solver.solve (goal1 & goal2).
goal1 could be asking for the variable toto to be 0:
goal1-> toto=0
goal2 could be a combination of other goals:
goal2 -> goal3 || goal4 etc...(i mean goal4 could be another combination of
goals...).


I'm reading the very good tutorial "Modeling and Programming with Gecode",
actually i'm with the chapter 28 for implementing branchers.
It seems to me that for doing the equivalent of ILOG CP, i should have in a
space:
call branch1 (in order to replace goal1)
call branch2 (in order to replace goal2).

and implement the branch2 in order its choice have 2 alternatives
and doing  in branch2::commit something like { if a=0 return branch3 else
return branch4}.
The problem is that it doesn't seem to work like that since it claims an
ExecStatus type return.

Is it possible to create new branchers inside branchers so that the result
of the commit branch would call the commit of other branchers and so on ?

Thank you very much by advance for your support.

Best regards,
Alexis






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20120201/95f3eb10/attachment.htm>


More information about the users mailing list