[gecode-users] consistency level for relations in MiniModel

Guido Tack tack at gecode.org
Thu Mar 24 09:08:50 CET 2011


Kish Shen wrote:

> Hi,
> 
> I am now looking at updating the ECLiPSe's gecode interface to the latest version of gecode.
> 
> I have been using gecode 3.3 for the ECLiPSe interface because I have been using the old facilities for LinRel and LinExpr, by breaking down user's expression (which may be non-linear) into subexpressions and posting them. It looks like this can now all be done by using the relation facilities of MiniModel, so I do not need to break the expressions down myself.
> 
> However, I am not very clear if I can specify the consistency level for relations and expressions I post using expr() and rel() of MiniModel. In my current code, where linear relations are posted using post, I am able to specify the consistency level. This allowed me to let the user (at the ECLiPSe level) to specify a consistency level for their (possibly non-linear) expressions and relations, with the understanding that the consistency level might not be achieved for parts of the expression (e.g. the non-linear parts).
> 
> I have been looking at the current Modelling and Programming with Gecode, in particular the MiniModel chapter, and it is not clear to me that you can specify a consistency level for rel (and expr). Can the consistency level be specified?

Yes, no problem:
http://www.gecode.org/doc-latest/reference/group__TaskModelMiniModelPost.html

> On a related point, the MiniModel chapter show example of specifying the expressions and relations directly in C++. In my code, I will be translating user specified relations/expressions to gecode data structures. In the existing code, LinExpr and LinRel are constructed
> in my C++ code, and I will need to be able to do the same thing with IntExpr. I cannot find IntExpr in the (web-based) Gecode Reference Documentation, probably because I don't know where to look. I looked in the "Direct modelling support" page in the Programming models section,
> but I found only the linear relations and expressions that I am already using.

The problem is that there's no class called IntExpr.  In the code it's separated into LinExpr and NonLinExpr. We'll have to fix that (either renaming LinExpr to IntExpr or adapting the docs).  So what you have to do is construct a LinExpr, just like before, and then post it using expr or rel, which accept an IntConLevel argument.

> I guess my first question (about consistency level) is also because I don't know which section in the reference documentation to look up the rel/expr facilities described in the MiniModel chapter.

Right, the links are missing, sorry for that and thanks for the pointer.  I'll update MPG accordingly.  For the complete MiniModel reference, it's best to start from the MiniModel overview page:
http://www.gecode.org/doc-latest/reference/group__TaskModelMiniModel.html

Cheers,
	Guido

-- 
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/







More information about the users mailing list