Gecode::ViewValAssignment< View, Val, ValSel > Class Template Reference
[Generic branching based on view and value selection]
Inherits Gecode::Branching.
Detailed Description
template<class View, class Val, class ValSel>
class Gecode::ViewValAssignment< View, Val, ValSel >
Generic assignment.
Implements view-based assignment for an array of views (of type View) and value (of type Val). The behaviour is defined by the class ValSel (which value is selected for assignment).
The class ValSel must implement two member functions:
- Val val(const Space* home, View x) const returns the value (most likely determined by x) to branch with.
- Gecode::ModEvent tell(Space* home, unsigned int a, View x, Val n) performs a tell on x with value n (the value for a is always 0, it is present such that assignments can use the same value selection as branchings).
For examples, see integer branchings .
Definition at line 135 of file branching.icc.
Public Member Functions | |
ViewValAssignment (Space *home, ViewArray< View > &x) | |
Constructor for creation. | |
virtual bool | status (const Space *home) const |
Check status of branching, return true if alternatives left. | |
virtual const BranchingDesc * | description (const Space *home) const |
Return branching description (of type Gecode::PosValDesc). | |
virtual ExecStatus | commit (Space *home, const BranchingDesc *d, unsigned int a) |
Perform commit for branching description d and alternative a. | |
virtual Reflection::ActorSpec | spec (const Space *home, Reflection::VarMap &m) const |
Return specification for this assignment given a variable map m. | |
virtual Reflection::BranchingSpec | branchingSpec (const Space *home, Reflection::VarMap &m, const BranchingDesc *d) const |
Return specification for a branch. | |
virtual Actor * | copy (Space *home, bool share) |
Perform cloning. | |
Static Public Member Functions | |
static Support::Symbol | ati (void) |
Actor type identifier of this assignment. | |
static void | post (Space *home, Reflection::VarMap &m, const Reflection::ActorSpec &spec) |
Post assignment according to specification. | |
Protected Member Functions | |
ViewValAssignment (Space *home, bool share, ViewValAssignment &b) | |
Protected Attributes | |
ViewArray< View > | x |
Views to branch on. | |
int | start |
Unassigned views start at x[start] Constructor for cloning b. |
Constructor & Destructor Documentation
Gecode::ViewValAssignment< View, Val, ValSel >::ViewValAssignment | ( | Space * | home, | |
bool | share, | |||
ViewValAssignment< View, Val, ValSel > & | b | |||
) | [inline, protected] |
Definition at line 353 of file branching.icc.
Gecode::ViewValAssignment< View, Val, ValSel >::ViewValAssignment | ( | Space * | home, | |
ViewArray< View > & | x | |||
) | [inline] |
Member Function Documentation
bool Gecode::ViewValAssignment< View, Val, ValSel >::status | ( | const Space * | home | ) | const [inline, virtual] |
Check status of branching, return true if alternatives left.
Implements Gecode::Branching.
Definition at line 368 of file branching.icc.
const BranchingDesc * Gecode::ViewValAssignment< View, Val, ValSel >::description | ( | const Space * | home | ) | const [inline, virtual] |
Return branching description (of type Gecode::PosValDesc).
Implements Gecode::Branching.
Definition at line 380 of file branching.icc.
ExecStatus Gecode::ViewValAssignment< View, Val, ValSel >::commit | ( | Space * | home, | |
const BranchingDesc * | d, | |||
unsigned int | a | |||
) | [inline, virtual] |
Perform commit for branching description d and alternative a.
Implements Gecode::Branching.
Definition at line 389 of file branching.icc.
Reflection::ActorSpec Gecode::ViewValAssignment< View, Val, ValSel >::spec | ( | const Space * | home, | |
Reflection::VarMap & | m | |||
) | const [inline, virtual] |
Return specification for this assignment given a variable map m.
Reimplemented from Gecode::Actor.
Definition at line 414 of file branching.icc.
Reflection::BranchingSpec Gecode::ViewValAssignment< View, Val, ValSel >::branchingSpec | ( | const Space * | home, | |
Reflection::VarMap & | m, | |||
const BranchingDesc * | d | |||
) | const [inline, virtual] |
Return specification for a branch.
Reimplemented from Gecode::Branching.
Definition at line 422 of file branching.icc.
Support::Symbol Gecode::ViewValAssignment< View, Val, ValSel >::ati | ( | void | ) | [inline, static] |
void Gecode::ViewValAssignment< View, Val, ValSel >::post | ( | Space * | home, | |
Reflection::VarMap & | m, | |||
const Reflection::ActorSpec & | spec | |||
) | [inline, static] |
Actor * Gecode::ViewValAssignment< View, Val, ValSel >::copy | ( | Space * | home, | |
bool | share | |||
) | [inline, virtual] |
Member Data Documentation
ViewArray<View> Gecode::ViewValAssignment< View, Val, ValSel >::x [protected] |
int Gecode::ViewValAssignment< View, Val, ValSel >::start [mutable, protected] |
Unassigned views start at x[start] Constructor for cloning b.
Definition at line 138 of file branching.icc.
The documentation for this class was generated from the following file:
- gecode/kernel/branching.icc (Revision: 7658)