[gecode-users] branching...

Christian Schulte cschulte at kth.se
Thu Dec 21 14:59:17 CET 2006


Let me just take one quick one (as I am on holidays almost and have to run).
Currently you can mix Int and Bool, from Gecode 2.0 on, you will not be able
to do that. 

More after the holidays...

Christian

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Kilian Sprotte
Sent: Thursday, December 21, 2006 1:43 PM
To: users at gecode.org
Subject: [gecode-users] branching...


Hi,

thinking about how to make gecol at least a little more flexible, I have
some general little questions. :)

As gecol does not allow for subclassing Space
(the SWIG CFFI wrapper creation is not really ready
yet for c++), I am using the following hard-wired problem
space:

class GecolSpace : public Space {
protected:
   IntVarArray  ints;
   BoolVarArray bools;
   SetVarArray  sets;
public:
[...]

I have seen that it is possible to call branch twice -
for example for the ints and then for the bools, in order
to have both of them distributed.

My first question:
If I wanted to consider ints and bools together for branching, for example
giving them a naive predefined, but not regular ordering like:

i1 i2 b1 i3 i4 i5 i6 b2 b3 i7 b4 b5 b6

Can I put them into an IntVarArgs array and treat them together?

My second question:
If I wanted to add my own ViewSel class....

Do I actually need to change branch in branch.cc
http://www.gecode.org/gecode-doc-latest/int_2branch_8cc- 
source.html#l00029 ?

and add my own 'case'....

Probably I can just instantiate the ViewValBranching directly?

Sorry for asking this c++ questions, I would be very grateful about a  
few
words, what the necessary steps are....

Maybe it is more interesting for you what kind of custom distribution
strategy I have in mind.

Lets say my problem has only int vars. I would like to decide the order of
distribution according to the value (if it is already assigned) of  
another
var that each var points to.
In other words, I conceptually sort my vars according to a key and then pick
the first. There is a (fixed) mapping of each var to another one that serves
for the key. If it is not yet assigned, we could say the key value was +inf.

This is actually very musically, as e.g. vars representing pitches  
can be chosen according to their time in the score, which is  
represented by the start time var of the chord they belong to. :)

I am keeping some good memories of the flexibility of {FD.distribute  
+Dist +Xv} in Oz....
For experimenting, I am hoping to provide at some point something  
similar in Lisp,
by using callbacks....

All of this is not so easy for a musician,
but I need to do it :-P

Merry Xmas,

   Kilian




_______________________________________________
Gecode users mailing list
users at gecode.org https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list