[gecode-users] doing multiple minimising searches with the same space

Kish Shen kisshen at cisco.com
Tue Jul 21 19:07:36 CEST 2009


Guido Tack wrote:
> Christian Schulte wrote:
>> There is special support for specialized "constrain" functions which just
>> return a cost variable, you might want to check that in "Modeling with
>> Gecode". Rather than fixing a particular cost variable you can use a cost
>> function that then decides which variable to return depending on which 
>> cost
>> variable you want use now. Remember: any problem can be solved with one
>> additional level of indirection ;-)
> 
> Exactly!  You can even use actual assignment instead of an equality 
> constraint.  I.e., your space has a member "IntVar cost" that the cost 
> function returns.  When you initialize optimization for variable x, you 
> execute "space.cost = x" instead of posting the constraint "rel(space, 
> cost, IRT_EQ, x)".  That way, you can change that assignment later when 
> you start the next search!  You just have to make sure that you actually 
> do make such an assignment before you start search, and that you update 
> cost (as usual) in the copy constructor.
> 
> Cheers,
>     Guido
> 
Hi Christian and Guido,

Thanks for your replies!

I was looking at the "Modelling with Gecode", or at least an early 
version that Guido sent me. What I wasn't aware of was that you can do a 
simple assignment between two IntVars, as in "space.cost = x". This 
probably reflect my lack of knowledge in C++, but what exactly does such 
an assignment mean?

Thanks and cheers,

Kish


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.




More information about the gecode-users mailing list