Recording activities for integer and Boolean variables. More...
#include <int.hh>
Public Member Functions | |
IntActivity (void) | |
Construct as not yet initialized. More... | |
IntActivity (const IntActivity &a) | |
Copy constructor. More... | |
IntActivity & | operator= (const IntActivity &a) |
Assignment operator. More... | |
IntActivity (Home home, const IntVarArgs &x, double d=1.0, IntBranchMerit bm=NULL) | |
Initialize for integer variables x with decay factor d. More... | |
IntActivity (Home home, const BoolVarArgs &x, double d=1.0, BoolBranchMerit bm=NULL) | |
Initialize for Boolean variables x with decay factor d. More... | |
void | init (Home home, const IntVarArgs &x, double d=1.0, IntBranchMerit bm=NULL) |
Initialize for integer variables x with decay factor d. More... | |
void | init (Home home, const BoolVarArgs &x, double d=1.0, BoolBranchMerit bm=NULL) |
Initialize for Boolean variables x with decay factor d. More... | |
![]() | |
Activity (void) | |
Construct as not yet intialized. More... | |
Activity (const Activity &a) | |
Copy constructor. More... | |
Activity & | operator= (const Activity &a) |
Assignment operator. More... | |
template<class View > | |
Activity (Home home, ViewArray< View > &x, double d, typename BranchTraits< typename View::VarType >::Merit bm) | |
Initialize for views x and decay factor d and activity as defined by bm. More... | |
template<class View > | |
void | init (Home home, ViewArray< View > &x, double d, typename BranchTraits< typename View::VarType >::Merit bm) |
Initialize for views x and decay factor d and activity as defined by bm. More... | |
bool | initialized (void) const |
Test whether already initialized. More... | |
void | set (Space &home, double a=0.0) |
Set activity to a. More... | |
void | update (Space &home, bool share, Activity &a) |
Updating during cloning. More... | |
~Activity (void) | |
Destructor. More... | |
double | operator[] (int i) const |
Return activity value at position i. More... | |
int | size (void) const |
Return number of activity values. More... | |
void | decay (Space &home, double d) |
Set decay factor to d. More... | |
double | decay (const Space &home) const |
Return decay factor. More... | |
Additional Inherited Members | |
![]() | |
static const Activity | def |
Default (empty) activity information. More... | |
![]() | |
void | update (int i) |
Update activity value at position i. More... | |
void | decay (int i) |
Decay activity value at position i. More... | |
void | acquire (void) |
Acquire mutex. More... | |
void | release (void) |
Release mutex. More... | |
![]() | |
Storage * | storage |
Pointer to storage object. More... | |
![]() | |
template<class Char , class Traits > | |
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const Activity &a) |
Print activity values enclosed in curly brackets. More... | |
|
inline |
Construct as not yet initialized.
The only member functions that can be used on a constructed but not yet initialized activity storage is init or the assignment operator.
Definition at line 41 of file activity.hpp.
|
inline |
Copy constructor.
Definition at line 44 of file activity.hpp.
Gecode::IntActivity::IntActivity | ( | Home | home, |
const IntVarArgs & | x, | ||
double | d = 1.0 , |
||
IntBranchMerit | bm = NULL |
||
) |
Initialize for integer variables x with decay factor d.
If the branch merit function bm is different from NULL, the activity for each variable is initialized with the merit returned by bm.
Definition at line 42 of file activity.cpp.
Gecode::IntActivity::IntActivity | ( | Home | home, |
const BoolVarArgs & | x, | ||
double | d = 1.0 , |
||
BoolBranchMerit | bm = NULL |
||
) |
Initialize for Boolean variables x with decay factor d.
If the branch merit function bm is different from NULL, the activity for each variable is initialized with the merit returned by bm.
Definition at line 48 of file activity.cpp.
|
inline |
Assignment operator.
Definition at line 48 of file activity.hpp.
void Gecode::IntActivity::init | ( | Home | home, |
const IntVarArgs & | x, | ||
double | d = 1.0 , |
||
IntBranchMerit | bm = NULL |
||
) |
Initialize for integer variables x with decay factor d.
If the branch merit function bm is different from NULL, the activity for each variable is initialized with the merit returned by bm.
This member function can only be used once and only if the activity storage has been constructed with the default constructor.
Definition at line 55 of file activity.cpp.
void Gecode::IntActivity::init | ( | Home | home, |
const BoolVarArgs & | x, | ||
double | d = 1.0 , |
||
BoolBranchMerit | bm = NULL |
||
) |
Initialize for Boolean variables x with decay factor d.
If the branch merit function bm is different from NULL, the activity for each variable is initialized with the merit returned by bm.
This member function can only be used once and only if the activity storage has been constructed with the default constructor.
Definition at line 62 of file activity.cpp.