[gecode-users] Add constraints to Flatzinc sharing parameters between them

Andrea Pretto a.pretto at miriade.it
Wed Sep 26 09:41:30 CEST 2012


Thanks.
Yes, I'm worried about performance (memory consumption). The arrays are
very large, and there are many constraint invocation.

For the "global hash table" approach, I thought something like this:

% flatzinc
predicate my_declare_param(int: param_id, array[int] of int:
params1, array[int] of int: params2);

predicate my_con(var int: x, var int: y, var int: param_id);

...

my_declare_param(3, [1,2,3,4,..], [1,2,3,4..])
my_con(a, b, 3)

% end flatzinc

I add a predicate my_declare_param for registering params, wich "register"
(in a global map) the parameters giving them and ID wich is PARAM_ID as
argument.
Then in the constraint (instead of arrays) I give the ID (PARAM_ID above)
to specify which parameters declared before I want to use.

Is that did you mean  ??

Thanks in advance.
Cheers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20120926/8f2fd1d8/attachment.html>


More information about the users mailing list