Gecode::ViewValBranching< View, Val, ViewSel, ValSel > Class Template Reference
[Generic branching based on view and value selection]
Inherits Gecode::Branching.
Detailed Description
template<class View, class Val, class ViewSel, class ValSel>
class Gecode::ViewValBranching< View, Val, ViewSel, ValSel >
Generic branching.
Implements view-based branching for an array of views (of type View) and value (of type Val). The behaviour is defined by the class ViewSel (which view is selected for branching) and the class ValSel (which value is selected for branching).
The class ViewSel must implement two member functions:
- Gecode::ViewSelStatus init(View x) Initializes view selection with the View . If x is known to be a best one, VSS_COMMIT should be returned. Otherwise, either VSS_NONE or VSS_SELECT should be returned.
- Gecode::ViewSelStatus select(View x) If x is not better that the previously selected view, return VSS_NONE. If it is better, return VSS_SELECT. If it is a best view, return VSS_COMMIT.
The class VarSel must implement two member functions:
- Val val(View) returns the value to branch with.
- Gecode::ModEvent tell(Space*, unsigned int a, View x, Val n) performs a tell for alternative a on x with value n.
For examples, see integer branchings .
Definition at line 68 of file branching.icc.
Public Member Functions | |
ViewValBranching (Space *home, ViewArray< View > &x) | |
Constructor for creation. | |
virtual unsigned int | branch (Space *home) |
Perform branching (selects view). | |
virtual BranchingDesc * | description (void) |
Return branching description (of type Gecode::PosValDesc). | |
virtual ExecStatus | commit (Space *home, unsigned int a, BranchingDesc *d) |
Perform commit for alternative a and branching description d. | |
virtual Actor * | copy (Space *home, bool share) |
Perform cloning. | |
Protected Member Functions | |
ViewValBranching (Space *home, bool share, ViewValBranching &b) | |
Constructor for cloning b. | |
Protected Attributes | |
ViewArray< View > | x |
Views to branch on. | |
int | start |
Unassigned variables start at x[start]. | |
int | next |
Next variable to branch is x[next]. |
Constructor & Destructor Documentation
Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::ViewValBranching | ( | Space * | home, | |
bool | share, | |||
ViewValBranching< View, Val, ViewSel, ValSel > & | b | |||
) | [inline, protected] |
Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::ViewValBranching | ( | Space * | home, | |
ViewArray< View > & | x | |||
) | [inline] |
Member Function Documentation
unsigned int Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::branch | ( | Space * | home | ) | [virtual] |
Perform branching (selects view).
Implements Gecode::Branching.
Definition at line 173 of file branching.icc.
BranchingDesc * Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::description | ( | void | ) | [virtual] |
Return branching description (of type Gecode::PosValDesc).
Implements Gecode::Branching.
Definition at line 199 of file branching.icc.
ExecStatus Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::commit | ( | Space * | home, | |
unsigned int | a, | |||
BranchingDesc * | d | |||
) | [virtual] |
Perform commit for alternative a and branching description d.
Implements Gecode::Branching.
Definition at line 207 of file branching.icc.
Actor * Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::copy | ( | Space * | home, | |
bool | share | |||
) | [virtual] |
Member Data Documentation
ViewArray<View> Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::x [protected] |
int Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::start [protected] |
int Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::next [protected] |
The documentation for this class was generated from the following file:
- gecode/kernel/branching.icc (Revision: 3259)