[gecode-users] Custom constraint to external progam

Pedro Salgueiro pds at di.uevora.pt
Thu Nov 13 10:52:36 CET 2008


Hi!

I have been experimenting Gecode for a while, and now I want to make
something wich I don't know if its possible:

I want to create a new "custom" constraint that allows to
relate/constraint a variable with a function that receives two other
gecode variables as parameters. This function will be something
completely external to gecode, and evan c++, so, by the the this
function is called the gecode variables that are used on it should
already have some values assigned to it.

Here's how it would look:

post(this, cvars[0] < 5)
post(this, cvars[1] < cvars[0] + 2)
post(this, new_constraint(cvars[2], run_something(cvars[0], cvars[1])

In this example, we could just assume that the "new_constraint" is used
to make sure that cvars[2] "<" run_something(cvars[0],cvars[1]).

Is this possible to do? If so, where should I start?

Thank you all
Pedro Salgueiro





More information about the gecode-users mailing list