|
| Assignment (const FiniteDomainVector &domains) |
| construct empty
|
|
const auto & | operator[] (var_idx_t i) const |
| get value of a variable (read only)
|
|
auto & | operator[] (var_idx_t i) |
| get value of a variable (read/write)
|
|
const auto & | values () const |
| get values (read only)
|
|
auto | size () const |
| get number of variables in assignment
|
|
auto | is_det (var_idx_t i) const |
| check whether variable is determined
|
|
void | set_undet (var_idx_t i) |
| set variables to undetermined
|
|
void | set_undet (const std::vector< var_idx_t > &xs) |
| set variables to undetermined
|
|
void | inc (var_idx_t i) |
| increment value of variable
|
|
template<class FeatureNetwork > |
auto | make_iterator (const std::vector< var_idx_t > &vars, const FeatureNetwork &cn, const std::vector< const typename FeatureNetwork::constraint_t * > &constraints, const std::vector< const typename FeatureNetwork::function_t * > &functions, const typename FeatureNetwork::fun_value_t &initial_value) |
| make sub-assignment iterator
|
|
template<class Function , class EP > |
auto | eval_determined (const std::vector< const Function * > &functions, const EP &) |
| evaluate constraints/functions where all variables are already determined
|
|
template<class CN > |
auto | make_iterator (const std::vector< var_idx_t > &vars, const CN &cn, const std::vector< const typename CN::constraint_t * > &constraints, const std::vector< const typename CN::function_t * > &functions, const typename CN::fun_value_t &initial_value) |
|
A (partial) assignment of variables to values.
An object of Assignment associates values to a series of /finite domain/ variables (indexed 0..n-1); typically the variables belong to a constraint network CN (
- See also
- FeatureNetwork).
In an assignment for the CN, variables are associated to values in their finite integer domain (according to CN) or are undetermined (encoded domain specifically!). Assignments are total, if no variable is undetermined.
Partial assignments can be enumerated using objects of class AssignmentIterator. Such iterators are generated for an assignment using make_iterator; typically they are used to iterate over a subset of the variables in the CN while evaluating functions and checking constraints.
An assignment is valid for a set of constraints, iff all the constraints are satisfied (evaluate to true). The value of an assignment for a set of functions is the product (as defined by the EvaluationPolicy) of the function values for the assignment. Only assignments with non-zero (zero def'd by EvaluationPolicy) evaluation are valid for the functions.