Class for activity management. More...
#include <activity.hpp>
Classes | |
class | Recorder |
Propagator for recording activity information. More... | |
class | Storage |
Object for storing activity values. More... | |
Protected Member Functions | |
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... | |
void | init (int n, double d) |
Initialize for n views with decay factor d. More... | |
Protected Attributes | |
Storage * | storage |
Pointer to storage object. More... | |
Related Functions | |
(Note that these are not member functions.) | |
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... | |
Constructors and initialization | |
static const Activity | def |
Default (empty) activity information. 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) | |
Initialize for views x and decay factor d. More... | |
template<class View > | |
void | init (Home home, ViewArray< View > &x, double d) |
Initialize for views x and decay factor d. More... | |
bool | initialized (void) const |
Test whether already initialized. More... | |
void | set (Space &home, double a=0.0) |
Set activity to a. More... | |
Update and delete activity information | |
void | update (Space &home, bool share, Activity &a) |
Updating during cloning. More... | |
~Activity (void) | |
Destructor. More... | |
Information access | |
double | operator[] (int i) const |
Return activity value at position i. More... | |
int | size (void) const |
Return number of activity values. More... | |
Decay factor for aging | |
void | decay (Space &home, double d) |
Set decay factor to d. More... | |
double | decay (const Space &home) const |
Return decay factor. More... | |
Class for activity management.
Definition at line 44 of file activity.hpp.
|
inline |
Construct as not yet intialized.
The only member functions that can be used on a constructed but not yet initialized activity storage is init and the assignment operator.
Definition at line 331 of file activity.hpp.
Gecode::Activity::Activity | ( | const Activity & | a) |
Copy constructor.
Definition at line 50 of file activity.cpp.
|
inline |
Initialize for views x and decay factor d.
Definition at line 340 of file activity.hpp.
Gecode::Activity::~Activity | ( | void | ) |
Destructor.
Definition at line 80 of file activity.cpp.
|
inlineprotected |
Update activity value at position i.
Definition at line 299 of file activity.hpp.
|
inlineprotected |
Decay activity value at position i.
Definition at line 305 of file activity.hpp.
|
inlineprotected |
Acquire mutex.
Definition at line 321 of file activity.hpp.
|
inlineprotected |
Release mutex.
Definition at line 325 of file activity.hpp.
|
protected |
Initialize for n views with decay factor d.
This member function can only be used once and only if the activity storage has been constructed with the default constructor.
Definition at line 45 of file activity.cpp.
Assignment operator.
Definition at line 60 of file activity.cpp.
|
inline |
Initialize for views x and decay factor d.
Definition at line 346 of file activity.hpp.
|
inline |
Test whether already initialized.
Definition at line 334 of file activity.hpp.
void Gecode::Activity::set | ( | Space & | home, |
double | a = 0.0 |
||
) |
Set activity to a.
Definition at line 100 of file activity.cpp.
Updating during cloning.
Definition at line 92 of file activity.cpp.
|
inline |
Return activity value at position i.
Definition at line 311 of file activity.hpp.
|
inline |
Return number of activity values.
Definition at line 317 of file activity.hpp.
void Gecode::Activity::decay | ( | Space & | home, |
double | d | ||
) |
Set decay factor to d.
Definition at line 108 of file activity.cpp.
double Gecode::Activity::decay | ( | const Space & | home) | const |
Return decay factor.
Definition at line 115 of file activity.cpp.
|
related |
Print activity values enclosed in curly brackets.
Definition at line 353 of file activity.hpp.
|
protected |
Pointer to storage object.
Definition at line 72 of file activity.hpp.
|
static |
Default (empty) activity information.
Definition at line 119 of file activity.hpp.