Bounds consistent global cardinality propagator. More...
#include <gcc.hh>
Public Member Functions | |
virtual Actor * | copy (Space &home, bool share) |
Copy propagator during cloning. More... | |
virtual PropCost | cost (const Space &home, const ModEventDelta &med) const |
Cost funtion. More... | |
virtual ExecStatus | propagate (Space &home, const ModEventDelta &med) |
Perform propagation. More... | |
virtual size_t | dispose (Space &home) |
Destructor. More... | |
![]() | |
ModEventDelta | modeventdelta (void) const |
Return the modification event delta. More... | |
virtual ExecStatus | advise (Space &home, Advisor &a, const Delta &d) |
Advise function. More... | |
double | afc (const Space &home) const |
Return the accumlated failure count. More... | |
![]() |
Static Public Member Functions | |
static ExecStatus | post (Home home, ViewArray< IntView > &x, ViewArray< Card > &k) |
Post propagator for views x and cardinalities k. More... | |
![]() | |
static void * | operator new (size_t s, Space &home) |
Allocate memory from space. More... | |
static void | operator delete (void *p, Space &home) |
No-op for exceptions. More... | |
Protected Member Functions | |
Bnd (Space &home, bool share, Bnd< Card > &p) | |
Constructor for cloning p. More... | |
ExecStatus | pruneCards (Space &home) |
Prune cardinality variables with 0 maximum occurrence. More... | |
ExecStatus | lbc (Space &home, int &nb, HallInfo hall[], Rank rank[], int mu[], int nu[]) |
Lower Bounds constraint (LBC) stating ![]() | |
ExecStatus | ubc (Space &home, int &nb, HallInfo hall[], Rank rank[], int mu[], int nu[]) |
Upper Bounds constraint (UBC) stating ![]() | |
Bnd (Home home, ViewArray< IntView > &, ViewArray< Card > &, bool, bool) | |
Constructor for posting. More... | |
![]() | |
Propagator (Home home) | |
Constructor for posting. More... | |
Propagator (Space &home, bool share, Propagator &p) | |
Constructor for cloning p. More... | |
Propagator * | fwd (void) const |
Return forwarding pointer during copying. More... | |
Protected Attributes | |
ViewArray< IntView > | x |
Views on which to perform bounds-propagation. More... | |
ViewArray< IntView > | y |
Views on which to perform value-propagation (subset of x ) More... | |
ViewArray< Card > | k |
Array containing either fixed cardinalities or CardViews. More... | |
PartialSum< Card > | lps |
Data structure storing the sum of the views lower bounds Necessary for reasoning about the interval capacities in the propagation algorithm. More... | |
PartialSum< Card > | ups |
Data structure storing the sum of the views upper bounds. More... | |
bool | card_fixed |
Stores whether cardinalities are all assigned. More... | |
bool | skip_lbc |
Stores whether the minium required occurences of the cardinalities are all zero. If so, we do not need to perform lower bounds propagation. More... | |
Bounds consistent global cardinality propagator.
The algorithm is taken from: Claude-Guy Quimper, Peter van Beek, Alejandro López-Ortiz, Alexander Golynski, and Sayyed Bashir Sadjad. An Efficient Bounds Consistency Algorithm for the Global Cardinality Constraint, CP 2003, pages 600-614.
This implementation uses the code that is provided by Peter Van Beek: http://ai.uwaterloo.ca/~vanbeek/software/software.html The code here has only been slightly modified to fit Gecode (taking idempotent/non-idempotent propagation into account) and uses a more efficient layout of datastructures (keeping the number of different arrays small).
The Bnd class is used to post the propagator and BndImp is the actual implementation taking shared variables into account.
Requires
|
inlineprotected |
|
protected |
|
inlineprotected |
Lower Bounds constraint (LBC) stating Hence the lbc constraints the variables such that every value occurs at least as often as specified by its lower cardinality bound.
|
inlineprotected |
Upper Bounds constraint (UBC) stating Hence the ubc constraints the variables such that no value occurs more often than specified by its upper cardinality bound.
|
virtual |
|
virtual |
|
virtual |
|
inlinevirtual |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |