Gecode::Activity Class Reference
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. | |
| void | decay (int i) |
| Decay activity value at position i. | |
| void | acquire (void) |
| Acquire mutex. | |
| void | release (void) |
| Release mutex. | |
Protected Attributes | |
| Storage * | storage |
| Pointer to storage object. | |
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. | |
Constructors and initialization | |
|
| |
| static const Activity | def |
| Default (empty) activity information. | |
| Activity (void) | |
| Construct as not yet intialized. | |
| Activity (const Activity &a) | |
| Copy constructor. | |
| Activity & | operator= (const Activity &a) |
| Assignment operator. | |
| 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. | |
| 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. | |
| bool | initialized (void) const |
| Test whether already initialized. | |
| void | set (Space &home, double a=0.0) |
| Set activity to a. | |
Update and delete activity information | |
|
| |
| void | update (Space &home, bool share, Activity &a) |
| Updating during cloning. | |
| ~Activity (void) | |
| Destructor. | |
Information access | |
|
| |
| double | operator[] (int i) const |
| Return activity value at position i. | |
| int | size (void) const |
| Return number of activity values. | |
Decay factor for aging | |
|
| |
| void | decay (Space &home, double d) |
| Set decay factor to d. | |
| double | decay (const Space &home) const |
| Return decay factor. | |
Detailed Description
Class for activity management.
Definition at line 44 of file activity.hpp.
Constructor & Destructor Documentation
| Gecode::Activity::Activity | ( | void | ) | [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 335 of file activity.hpp.
| Gecode::Activity::Activity | ( | const Activity & | a | ) |
Copy constructor.
Definition at line 44 of file activity.cpp.
| Gecode::Activity::Activity | ( | Home | home, | |
| ViewArray< View > & | x, | |||
| double | d, | |||
| typename BranchTraits< typename View::VarType >::Merit | bm | |||
| ) | [inline] |
Initialize for views x and decay factor d and activity as defined by bm.
Definition at line 344 of file activity.hpp.
| Gecode::Activity::~Activity | ( | void | ) |
Destructor.
Definition at line 74 of file activity.cpp.
Member Function Documentation
| void Gecode::Activity::update | ( | int | i | ) | [inline, protected] |
Update activity value at position i.
Definition at line 303 of file activity.hpp.
| void Gecode::Activity::decay | ( | int | i | ) | [inline, protected] |
Decay activity value at position i.
Definition at line 309 of file activity.hpp.
| void Gecode::Activity::acquire | ( | void | ) | [inline, protected] |
Acquire mutex.
Definition at line 325 of file activity.hpp.
| void Gecode::Activity::release | ( | void | ) | [inline, protected] |
Release mutex.
Definition at line 329 of file activity.hpp.
Assignment operator.
Definition at line 54 of file activity.cpp.
| void Gecode::Activity::init | ( | Home | home, | |
| ViewArray< View > & | x, | |||
| double | d, | |||
| typename BranchTraits< typename View::VarType >::Merit | bm | |||
| ) | [inline] |
Initialize for views x and decay factor d and activity as defined by bm.
Definition at line 352 of file activity.hpp.
| bool Gecode::Activity::initialized | ( | void | ) | const [inline] |
Test whether already initialized.
Definition at line 338 of file activity.hpp.
| void Gecode::Activity::set | ( | Space & | home, | |
| double | a = 0.0 | |||
| ) |
Set activity to a.
Definition at line 94 of file activity.cpp.
Updating during cloning.
Definition at line 86 of file activity.cpp.
| double Gecode::Activity::operator[] | ( | int | i | ) | const [inline] |
Return activity value at position i.
Definition at line 315 of file activity.hpp.
| int Gecode::Activity::size | ( | void | ) | const [inline] |
Return number of activity values.
Definition at line 321 of file activity.hpp.
| void Gecode::Activity::decay | ( | Space & | home, | |
| double | d | |||
| ) |
Set decay factor to d.
Definition at line 102 of file activity.cpp.
| double Gecode::Activity::decay | ( | const Space & | home | ) | const |
Return decay factor.
Definition at line 111 of file activity.cpp.
Friends And Related Function Documentation
| std::basic_ostream< Char, Traits > & operator<< | ( | std::basic_ostream< Char, Traits > & | os, | |
| const Activity & | a | |||
| ) | [related] |
Print activity values enclosed in curly brackets.
Definition at line 361 of file activity.hpp.
Member Data Documentation
Storage* Gecode::Activity::storage [protected] |
Pointer to storage object.
Definition at line 74 of file activity.hpp.
const Activity Gecode::Activity::def [static] |
Default (empty) activity information.
Definition at line 114 of file activity.hpp.
The documentation for this class was generated from the following files:
- gecode/kernel/activity.hpp (Revision: 13949)
- gecode/kernel/activity.cpp (Revision: 14124)
