Generated on Wed Jul 27 2011 15:09:06 for Gecode by doxygen 1.7.4
Gecode::VarImp< VIC > Class Template Reference

Base-class for variable implementations. More...

#include <core.hpp>

List of all members.

Public Member Functions

 VarImp (Space &home)
 Creation.
 VarImp (void)
 Creation of static instances.

Protected Member Functions

void cancel (Space &home)
 Cancel all subscriptions when variable implementation is assigned.
bool advise (Space &home, ModEvent me, Delta &d)
 Run advisors when variable implementation has been modified with modification event me and domain change d.
void schedule (Space &home, PropCond pc1, PropCond pc2, ModEvent me)
 Schedule subscribed propagators.

Dependencies

void subscribe (Space &home, Propagator &p, PropCond pc, bool assigned, ModEvent me, bool schedule)
 Subscribe propagator p with propagation condition pc.
void cancel (Space &home, Propagator &p, PropCond pc, bool assigned)
 Cancel subscription of propagator p with propagation condition pc.
void subscribe (Space &home, Advisor &a, bool assigned)
 Subscribe advisor a to variable.
void cancel (Space &home, Advisor &a, bool assigned)
 Cancel subscription of advisor a.
unsigned int degree (void) const
 Return degree (number of subscribed propagators and advisors)
double afc (void) const
 Return accumulated failure count (plus degree)

Cloning variables

 VarImp (Space &home, bool share, VarImp &x)
 Constructor for cloning.
bool copied (void) const
 Is variable already copied.
VarImpforward (void) const
 Use forward pointer if variable already copied.
VarImpnext (void) const
 Return next copied variable.

Variable implementation-dependent propagator support

static void schedule (Space &home, Propagator &p, ModEvent me, bool force=false)
 Schedule propagator p with modification event me.
static ModEvent me (const ModEventDelta &med)
 Project modification event for this variable type from med.
static ModEventDelta med (ModEvent me)
 Translate modification event me into modification event delta.
static ModEvent me_combine (ModEvent me1, ModEvent me2)
 Combine modifications events me1 and me2.

Delta information for advisors

static ModEvent modevent (const Delta &d)
 Return modification event.

Bit management

unsigned int bits (void) const
 Provide access to free bits.
unsigned int & bits (void)
 Provide access to free bits.

Memory management

static void * operator new (size_t, Space &)
 Allocate memory from space.
static void operator delete (void *, Space &)
 Return memory to space.
static void operator delete (void *)
 Needed for exceptions.

Detailed Description

template<class VIC>
class Gecode::VarImp< VIC >

Base-class for variable implementations.

Implements variable implementation for variable implementation configuration of type VIC.

Definition at line 285 of file core.hpp.


Constructor & Destructor Documentation

template<class VIC >
Gecode::VarImp< VIC >::VarImp ( Space home) [inline]

Creation.

Definition at line 2944 of file core.hpp.

template<class VIC >
Gecode::VarImp< VIC >::VarImp ( void  ) [inline]

Creation of static instances.

Definition at line 2953 of file core.hpp.

template<class VIC >
Gecode::VarImp< VIC >::VarImp ( Space home,
bool  share,
VarImp< VIC > &  x 
) [inline]

Constructor for cloning.

Definition at line 3046 of file core.hpp.


Member Function Documentation

template<class VIC >
void Gecode::VarImp< VIC >::cancel ( Space home) [inline, protected]

Cancel all subscriptions when variable implementation is assigned.

Definition at line 3271 of file core.hpp.

template<class VIC >
bool Gecode::VarImp< VIC >::advise ( Space home,
ModEvent  me,
Delta d 
) [inline, protected]

Run advisors when variable implementation has been modified with modification event me and domain change d.

Returns false if an advisor has failed.

Definition at line 3284 of file core.hpp.

template<class VIC >
void Gecode::VarImp< VIC >::subscribe ( Space home,
Propagator p,
PropCond  pc,
bool  assigned,
ModEvent  me,
bool  schedule 
)

Subscribe propagator p with propagation condition pc.

In case schedule is false, the propagator is just subscribed but not scheduled for execution (this must be used when creating subscriptions during propagation).

In case the variable is assigned (that is, assigned is true), the subscribing propagator is scheduled for execution. Otherwise, the propagator subscribes and is scheduled for execution with modification event me provided that pc is different from PC_GEN_ASSIGNED.

Definition at line 3181 of file core.hpp.

template<class VIC >
void Gecode::VarImp< VIC >::cancel ( Space home,
Propagator p,
PropCond  pc,
bool  assigned 
) [inline]

Cancel subscription of propagator p with propagation condition pc.

If the variable is assigned, assigned must be true.

Definition at line 3257 of file core.hpp.

template<class VIC >
void Gecode::VarImp< VIC >::subscribe ( Space home,
Advisor a,
bool  assigned 
) [inline]

Subscribe advisor a to variable.

The advisor a is only subscribed if assigned is false.

Reimplemented in Gecode::Int::IntVarImpBase, Gecode::Int::BoolVarImpBase, and Gecode::Set::SetVarImpBase.

Definition at line 3197 of file core.hpp.

template<class VIC >
void Gecode::VarImp< VIC >::cancel ( Space home,
Advisor a,
bool  assigned 
) [inline]

Cancel subscription of advisor a.

If the variable is assigned, assigned must be true.

Definition at line 3264 of file core.hpp.

template<class VIC >
unsigned int Gecode::VarImp< VIC >::degree ( void  ) const [inline]

Return degree (number of subscribed propagators and advisors)

Note that the degree of a variable implementation is not available during cloning.

Definition at line 2962 of file core.hpp.

template<class VIC >
double Gecode::VarImp< VIC >::afc ( void  ) const [inline]

Return accumulated failure count (plus degree)

Note that the accumulated failure count of a variable implementation is not available during cloning.

Definition at line 2969 of file core.hpp.

template<class VIC >
bool Gecode::VarImp< VIC >::copied ( void  ) const [inline]

Is variable already copied.

Definition at line 3026 of file core.hpp.

template<class VIC >
VarImp< VIC > * Gecode::VarImp< VIC >::forward ( void  ) const [inline]

Use forward pointer if variable already copied.

Definition at line 3032 of file core.hpp.

template<class VIC>
VarImp* Gecode::VarImp< VIC >::next ( void  ) const

Return next copied variable.

template<class VIC >
void Gecode::VarImp< VIC >::schedule ( Space home,
Propagator p,
ModEvent  me,
bool  force = false 
) [inline, static]

Schedule propagator p with modification event me.

If force is true, the propagator is re-scheduled (including cost computation) even though its modification event delta has not changed.

Definition at line 3088 of file core.hpp.

template<class VIC >
ModEvent Gecode::VarImp< VIC >::me ( const ModEventDelta med) [inline, static]

Project modification event for this variable type from med.

Definition at line 3070 of file core.hpp.

template<class VIC >
ModEventDelta Gecode::VarImp< VIC >::med ( ModEvent  me) [inline, static]

Translate modification event me into modification event delta.

Reimplemented in Gecode::Int::IntVarImp, and Gecode::Int::BoolVarImp.

Definition at line 3076 of file core.hpp.

template<class VIC >
ModEvent Gecode::VarImp< VIC >::me_combine ( ModEvent  me1,
ModEvent  me2 
) [inline, static]

Combine modifications events me1 and me2.

Definition at line 3082 of file core.hpp.

template<class VIC >
ModEvent Gecode::VarImp< VIC >::modevent ( const Delta d) [inline, static]

Return modification event.

Reimplemented in Gecode::Int::BoolVarImp.

Definition at line 2994 of file core.hpp.

template<class VIC >
unsigned int Gecode::VarImp< VIC >::bits ( void  ) const [inline]

Provide access to free bits.

Definition at line 3000 of file core.hpp.

template<class VIC >
unsigned int & Gecode::VarImp< VIC >::bits ( void  ) [inline]

Provide access to free bits.

Definition at line 3006 of file core.hpp.

template<class VIC >
void Gecode::VarImp< VIC >::schedule ( Space home,
PropCond  pc1,
PropCond  pc2,
ModEvent  me 
) [inline, protected]

Schedule subscribed propagators.

Definition at line 3096 of file core.hpp.

template<class VIC >
void * Gecode::VarImp< VIC >::operator new ( size_t  s,
Space home 
) [inline, static]

Allocate memory from space.

Definition at line 2209 of file core.hpp.

template<class VIC >
void Gecode::VarImp< VIC >::operator delete ( void *  ,
Space  
) [inline, static]

Return memory to space.

Definition at line 2206 of file core.hpp.

template<class VIC >
void Gecode::VarImp< VIC >::operator delete ( void *  ) [inline, static]

Needed for exceptions.

Definition at line 2203 of file core.hpp.


Member Data Documentation

template<class VIC>
unsigned int Gecode::VarImp< VIC >::idx [inline]

Indices of subscribed actors.

The entries from base[0] to base[idx[pc_max]] are propagators, where the entries between base[idx[pc-1]] and base[idx[pc]] are the propagators that have subscribed with propagation condition pc.

The entries between base[idx[pc_max]] and base[idx[pc_max+1]] are the advisors subscribed to the variable implementation.

Definition at line 327 of file core.hpp.

template<class VIC>
VarImp< VIC > * Gecode::VarImp< VIC >::next [inline]

During cloning, points to the next copied variable.

Definition at line 329 of file core.hpp.


The documentation for this class was generated from the following file: