Saving arguments during variable selection

25 views
Skip to first unread message

marcus...@gmail.com

unread,
Jun 30, 2023, 1:42:16 PM6/30/23
to Gecode
Hello,

To select the variable x of a IntVarArray X to branch, I execute

branch(X, INT_VAR_MERIT_MAX(f), INT_VAL(g)) 

The merit returned by the function f is done by evaluating the values of each variable x of X. During this execution, I therefore know not only which variable to branch but also which value V to give it. Can I save this value as a class attribute and retrieve it when calling the g function? Are there any special precautions to take?

Thanks for your help,
Marcus

marcus...@gmail.com

unread,
Jun 30, 2023, 5:43:13 PM6/30/23
to Gecode

Allow me to make some clarifications:
 I have class attributes that are not Gecode types (std::map of c++ structures for example).
 These attributes are used during branching (when choosing a variable in INT_VAR_MERIT_MAX and choosing the value in INT_VAL) 
- Can we avoid copying these class attributes when calling the update method (containers can be large) ? 
- Does it work? I am thinking in particular of whats happen during recomputation, cloning, displacement new...

THANKS
Marcus


Reply all
Reply to author
Forward
0 new messages