|
Boost Users : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-08-10 16:12:19
Timothy Perrigo <tperrigo_at_[hidden]> writes:
> Dave wrote:
>> Need more info.
>>
>> Does each id map to just one type, or might there be different types
>> using the same ID in different registries of type R?
>>
>> Is the id a runtime value, or is it known at compile-time?
>>
>
> Thanks for the reply...I'll try to give as much background information
> as I can without clouding the issue. We're working on a constraint
> processing system. Particular problems will be modeled with variables
> with values within certain domains and subject to certain constraints.
> These constraints, when propagated, will narrow the domains of the
> variables, but some form of searching will be required to bind all the
> variables to values and find a feasible solution. The idea behind the
> registry I mentioned is for it to serve as a snapshot of the current
> state of the system (at a specific point in a search, for example).
> The "same" variables will exist in different registries, but may have
> different domains since their sets of possible values may have been
> reduced due to decisions made during the search.
Actually all that background info clouds the issue.
> So to answer your first question, a particular id will always
> correspond to a variable of a given type, though its value at that
> point in time (i.e, in that registry) may differ from the same
> variable in a different registry.
OK.
> Right now, the id is a runtime value; whenever a new constrained
> variable is created, it is given a new id.
But does it *need* to be a runtime value? If so, something like
Gennadiy's solution is the only choice. If not, you can do something
much more efficient with MPL.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net