Gecode::Space Class Reference
Computation spaces. More...
#include <core.hpp>
Public Member Functions | |
Space (void) | |
Default constructor. | |
Space (bool share, Space &s) | |
Constructor for cloning. | |
virtual | ~Space (void) |
Destructor. | |
virtual Space * | copy (bool share)=0 |
Copying member function. | |
virtual void | constrain (const Space &best) |
Constrain function for best solution search. | |
virtual bool | master (const MetaInfo &mi) |
Master configuration function for meta search engines. | |
virtual bool | slave (const MetaInfo &mi) |
Slave configuration function for meta search engines. | |
SpaceStatus | status (StatusStatistics &stat=unused_status) |
Query space status. | |
const Choice * | choice (void) |
Create new choice for current brancher. | |
const Choice * | choice (Archive &e) const |
Create new choice from e. | |
Space * | clone (bool share_data=true, bool share_info=true, CloneStatistics &stat=unused_clone) const |
Clone space. | |
void | commit (const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit) |
Commit choice c for alternative a. | |
void | trycommit (const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit) |
If possible, commit choice c for alternative a. | |
NGL * | ngl (const Choice &c, unsigned int a) |
Create no-good literal for choice c and alternative a. | |
void | print (const Choice &c, unsigned int a, std::ostream &o) const |
Print branch for choice c and alternative a. | |
void | notice (Actor &a, ActorProperty p, bool duplicate=false) |
Notice actor property. | |
void | ignore (Actor &a, ActorProperty p, bool duplicate=false) |
Ignore actor property. | |
ExecStatus | ES_SUBSUMED (Propagator &p) |
ExecStatus | ES_SUBSUMED_DISPOSED (Propagator &p, size_t s) |
Propagator p is subsumed | |
ExecStatus | ES_FIX_PARTIAL (Propagator &p, const ModEventDelta &med) |
Propagator p has computed partial fixpoint | |
ExecStatus | ES_NOFIX_PARTIAL (Propagator &p, const ModEventDelta &med) |
Propagator p has not computed partial fixpoint | |
template<class A > | |
ExecStatus | ES_FIX_DISPOSE (Council< A > &c, A &a) |
Advisor a must be disposed | |
template<class A > | |
ExecStatus | ES_NOFIX_DISPOSE (Council< A > &c, A &a) |
Advisor a must be disposed and its propagator must be run | |
template<class A > | |
ExecStatus | ES_NOFIX_DISPOSE_FORCE (Council< A > &c, A &a) |
Advisor a must be disposed and its propagator must be forcefully rescheduled | |
void | fail (void) |
Fail space. | |
bool | failed (void) const |
Check whether space is failed. | |
bool | stable (void) const |
Return if space is stable (at fixpoint or failed). | |
template<class T > | |
T * | alloc (long unsigned int n) |
Allocate block of n objects of type T from space heap. | |
template<class T > | |
T * | alloc (long int n) |
Allocate block of n objects of type T from space heap. | |
template<class T > | |
T * | alloc (unsigned int n) |
Allocate block of n objects of type T from space heap. | |
template<class T > | |
T * | alloc (int n) |
Allocate block of n objects of type T from space heap. | |
template<class T > | |
void | free (T *b, long unsigned int n) |
Delete n objects allocated from space heap starting at b. | |
template<class T > | |
void | free (T *b, long int n) |
Delete n objects allocated from space heap starting at b. | |
template<class T > | |
void | free (T *b, unsigned int n) |
Delete n objects allocated from space heap starting at b. | |
template<class T > | |
void | free (T *b, int n) |
Delete n objects allocated from space heap starting at b. | |
template<class T > | |
T * | realloc (T *b, long unsigned int n, long unsigned int m) |
Reallocate block of n objects starting at b to m objects of type T from the space heap. | |
template<class T > | |
T * | realloc (T *b, long int n, long int m) |
Reallocate block of n objects starting at b to m objects of type T from the space heap. | |
template<class T > | |
T * | realloc (T *b, unsigned int n, unsigned int m) |
Reallocate block of n objects starting at b to m objects of type T from the space heap. | |
template<class T > | |
T * | realloc (T *b, int n, int m) |
Reallocate block of n objects starting at b to m objects of type T from the space heap. | |
template<class T > | |
T ** | realloc (T **b, long unsigned int n, long unsigned int m) |
Reallocate block of n pointers starting at b to m objects of type T* from the space heap. | |
template<class T > | |
T ** | realloc (T **b, long int n, long int m) |
Reallocate block of n pointers starting at b to m objects of type T* from the space heap. | |
template<class T > | |
T ** | realloc (T **b, unsigned int n, unsigned int m) |
Reallocate block of n pointers starting at b to m objects of type T* from the space heap. | |
template<class T > | |
T ** | realloc (T **b, int n, int m) |
Reallocate block of n pointers starting at b to m objects of type T* from the space heap. | |
void * | ralloc (size_t s) |
Allocate memory on space heap. | |
void | rfree (void *p, size_t s) |
Free memory previously allocated with alloc (might be reused later). | |
void * | rrealloc (void *b, size_t n, size_t m) |
Reallocate memory block starting at b from size n to size s. | |
template<size_t > | |
void * | fl_alloc (void) |
Allocate from freelist-managed memory. | |
template<size_t > | |
void | fl_dispose (FreeList *f, FreeList *l) |
Return freelist-managed memory to freelist. | |
void | flush (void) |
Flush cached memory blocks. | |
Conversion from Space to Home | |
| |
Home | operator() (Propagator &p) |
Return a home for this space with the information that p is being rewritten. | |
Home | operator() (PropagatorGroup pg) |
Return a home for this space with propagator group information pg. | |
Home | operator() (BrancherGroup bg) |
Return a home for this space with brancher group information bg. | |
| |
template<class T > | |
T & | construct (void) |
Construction routines. | |
template<class T , typename A1 > | |
T & | construct (A1 const &a1) |
Constructs a single object of type T from space heap using a unary constructor. | |
template<class T , typename A1 , typename A2 > | |
T & | construct (A1 const &a1, A2 const &a2) |
Constructs a single object of type T from space heap using a binary constructor. | |
template<class T , typename A1 , typename A2 , typename A3 > | |
T & | construct (A1 const &a1, A2 const &a2, A3 const &a3) |
Constructs a single object of type T from space heap using a ternary constructor. | |
template<class T , typename A1 , typename A2 , typename A3 , typename A4 > | |
T & | construct (A1 const &a1, A2 const &a2, A3 const &a3, A4 const &a4) |
Constructs a single object of type T from space heap using a quaternary constructor. | |
template<class T , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 > | |
T & | construct (A1 const &a1, A2 const &a2, A3 const &a3, A4 const &a4, A5 const &a5) |
Constructs a single object of type T from space heap using a quinary constructor. | |
Low-level support for AFC | |
| |
void | afc_decay (double d) |
Set AFC decay factor to d | |
double | afc_decay (void) const |
Return AFC decay factor. |
Detailed Description
Computation spaces.
Definition at line 1748 of file core.hpp.
Member Function Documentation
Home Gecode::Space::operator() | ( | Propagator & | p | ) | [inline] |
Home Gecode::Space::operator() | ( | PropagatorGroup | pg | ) |
Return a home for this space with propagator group information pg.
Home Gecode::Space::operator() | ( | BrancherGroup | bg | ) |
Return a home for this space with brancher group information bg.
template<class T >
T & Gecode::Space::construct | ( | void | ) | [inline] |
template<class T , typename A1 >
T & Gecode::Space::construct | ( | A1 const & | a1 | ) | [inline] |
template<class T , typename A1 , typename A2 >
T & Gecode::Space::construct | ( | A1 const & | a1, | |
A2 const & | a2 | |||
) | [inline] |
template<class T , typename A1 , typename A2 , typename A3 >
T & Gecode::Space::construct | ( | A1 const & | a1, | |
A2 const & | a2, | |||
A3 const & | a3 | |||
) | [inline] |
template<class T , typename A1 , typename A2 , typename A3 , typename A4 >
T & Gecode::Space::construct | ( | A1 const & | a1, | |
A2 const & | a2, | |||
A3 const & | a3, | |||
A4 const & | a4 | |||
) | [inline] |
template<class T , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
T & Gecode::Space::construct | ( | A1 const & | a1, | |
A2 const & | a2, | |||
A3 const & | a3, | |||
A4 const & | a4, | |||
A5 const & | a5 | |||
) | [inline] |
void Gecode::Space::afc_decay | ( | double | d | ) | [inline] |
double Gecode::Space::afc_decay | ( | void | ) | const [inline] |
Member Data Documentation
Cost level with next propagator to be executed.
This maintains the following invariant (but only if the space does not perform propagation):
- If active points to a queue, this queue might contain a propagator. However, there will be at least one queue containing a propagator.
- Otherwise, active is smaller than the first queue or larger than the last queue. Then, the space is stable.
- If active is larger than the last queue, the space is failed.
ActorLink Gecode::Space::queue[PropCost::AC_MAX+1] |
unsigned int Gecode::Space::bid_sc |
unsigned int Gecode::Space::n_sub |
struct { ... } Gecode::Space::p |
Data only available during propagation or branching.
struct { ... } Gecode::Space::c |
Data available only during copying.
The documentation for this class was generated from the following files:
- gecode/kernel/core.hpp (Revision: 15597)
- gecode/kernel/core.cpp (Revision: 15597)
- gecode/kernel/var-imp.hpp