[gecode-users] Identifying an IntVar
Guido Tack
tack at ps.uni-sb.de
Mon Mar 17 19:30:22 CET 2008
David Rijsman wrote:
> I am building my own somewhat generic tracing for certain search
> operators and for this I have created my own branching to create my
> own tracing in a Branching::commit. This in itself is no problem but
> now I would like to map the variable(s), on which tell operation(s)
> will be executed in the commit, back to variables in for example an
> array in my derived Space (for example the variable we execute a tell
> on is the third variable in the array in my space). As the IntVar
> instances have no identifier attributes this seems impossible. Am I
> missing some possibilities? And if I would like to add an identifier
> attribute to for example an IntVar I should do this in IntVarImp?
I'm not sure I understand every detail of what you're trying to do,
let me try to summarize: you have an array of IntVars in your space,
and tracing means that you output what's happening during a commit.
And of course you want to say something like "variable no. 3 was
modified", where 3 is the index in the global array?
Our generic solution for this is a VarMap, which belongs to the new
reflection API. You can find a small tutorial on reflection here:
http://www.gecode.org/gecode-doc-latest/PageReflection.html
Cheers,
Guido
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2436 bytes
Desc: not available
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080317/1faeb960/attachment.bin>
More information about the gecode-users
mailing list