Generated on for Gecode by doxygen 1.18.0

Propagate a relation over an open chain in one actor. More...

#include <gecode/int/rel/open.hpp>

Classes

class  Position
 Identify the position whose domain changed. More...

Public Member Functions

virtual Actor * copy (Space &home)
 Create copy.
virtual PropCost cost (const Space &, const ModEventDelta &) const
 Cost function.
virtual ExecStatus advise (Space &home, Advisor &advisor, const Delta &delta)
 Advise function.
virtual ExecStatus propagate (Space &home, const ModEventDelta &)
 Propagation function.
virtual void reschedule (Space &home)
 Schedule function.
virtual size_t dispose (Space &home)
 Delete actor and return its size.
ModEventDelta modeventdelta (void) const
 Return the modification event delta.
virtual void advise (Space &home, Advisor &a)
 Run advisor a to be run on failure in failed space.
double afc (void) const
 Return the accumulated failure count.
unsigned int id (void) const
 Return propagator id.
PropagatorGroup group (void) const
 Return group propagator belongs to.
void group (PropagatorGroup g)
 Add propagator to group g.
bool disabled (void) const
 Whether propagator is currently disabled.
virtual ~Actor (void)
 To avoid warnings.

Static Public Member Functions

static void post (Home home, OpenViewList< View > list, IntPropLevel ipl)
static void * operator new (size_t s, Space &home)
 Allocate memory from space.
static void operator delete (void *p, Space &home)
 No-op for exceptions.
static void * operator new (size_t s)
 Not used.
static void operator delete (void *p)
 Not used.

Protected Member Functions

 Open (Home home, OpenViewList< View > list, IntPropLevel ipl)
 Open (Space &home, Open &p)
void changed (int index)
View ordered (int index, int size) const
 Read decreasing relations in increasing order.
ExecStatus propagate_equal (Space &home, int begin, int end, int size)
 Accumulate the domain intersection in the first position.
ExecStatus propagate_different (Space &home, int begin, int end, int size)
 Propagate assignments to their immediate neighbors.
ExecStatus propagate_order (Space &home, int begin, int end, int size)
 Sweep lower bounds forward and upper bounds backward from changed positions.
Protected Member Functions inherited from Gecode::Int::OpenListPropagator< View >
 OpenListPropagator (Home home, OpenViewList< View > list0)
 OpenListPropagator (Space &home, OpenListPropagator &p)
bool closed (void) const
void dispose_base (Space &home)
Protected Member Functions inherited from Gecode::Propagator
 Propagator (Home home)
 Constructor for posting.
 Propagator (Space &home, Propagator &p)
 Constructor for cloning p.
Propagator * fwd (void) const
 Return forwarding pointer during copying.
Kernel::GPI::Info & gpi (void)
 Provide access to propagator information.

Protected Attributes

Council< Position > council
int first
 Inclusive range of positions needing propagation.
int last
bool domain
 Whether equality propagates holes as well as bounds.
Protected Attributes inherited from Gecode::Int::OpenListPropagator< View >
OpenViewList< View > list
IntView length
int processed

Detailed Description

template<class View, IntRelType irt>
class Gecode::Int::Rel::Open< View, irt >

Propagate a relation over an open chain in one actor.

Definition at line 44 of file open.hpp.

Constructor & Destructor Documentation

◆ Open() [1/2]

template<class View, IntRelType irt>
Gecode::Int::Rel::Open< View, irt >::Open ( Home home,
OpenViewList< View > list,
IntPropLevel ipl )
inlineprotected

Definition at line 75 of file open.hpp.

◆ Open() [2/2]

template<class View, IntRelType irt>
Gecode::Int::Rel::Open< View, irt >::Open ( Space & home,
Open< View, irt > & p )
inlineprotected

Definition at line 80 of file open.hpp.

Member Function Documentation

◆ changed()

template<class View, IntRelType irt>
void Gecode::Int::Rel::Open< View, irt >::changed ( int index)
inlineprotected

Definition at line 87 of file open.hpp.

◆ ordered()

template<class View, IntRelType irt>
View Gecode::Int::Rel::Open< View, irt >::ordered ( int index,
int size ) const
inlineprotected

Read decreasing relations in increasing order.

Definition at line 94 of file open.hpp.

◆ propagate_equal()

template<class View, IntRelType irt>
ExecStatus Gecode::Int::Rel::Open< View, irt >::propagate_equal ( Space & home,
int begin,
int end,
int size )
inlineprotected

Accumulate the domain intersection in the first position.

Definition at line 101 of file open.hpp.

◆ propagate_different()

template<class View, IntRelType irt>
ExecStatus Gecode::Int::Rel::Open< View, irt >::propagate_different ( Space & home,
int begin,
int end,
int size )
inlineprotected

Propagate assignments to their immediate neighbors.

Definition at line 138 of file open.hpp.

◆ propagate_order()

template<class View, IntRelType irt>
ExecStatus Gecode::Int::Rel::Open< View, irt >::propagate_order ( Space & home,
int begin,
int end,
int size )
inlineprotected

Sweep lower bounds forward and upper bounds backward from changed positions.

Definition at line 153 of file open.hpp.

◆ copy()

template<class View, IntRelType irt>
virtual Actor * Gecode::Int::Rel::Open< View, irt >::copy ( Space & home)
inlinevirtual

Create copy.

Implements Gecode::Actor.

Definition at line 179 of file open.hpp.

◆ cost()

template<class View, IntRelType irt>
virtual PropCost Gecode::Int::Rel::Open< View, irt >::cost ( const Space & home,
const ModEventDelta & med ) const
inlinevirtual

Cost function.

Reimplemented from Gecode::Int::OpenListPropagator< View >.

Definition at line 184 of file open.hpp.

◆ advise()

template<class View, IntRelType irt>
virtual ExecStatus Gecode::Int::Rel::Open< View, irt >::advise ( Space & home,
Advisor & a,
const Delta & d )
inlinevirtual

Advise function.

The advisor is passed as argument a.

A propagator must specialize this advise function, if it uses advisors. The advise function must return an execution status as follows:

  • ES_FAILED: the advisor has detected failure.
  • ES_FIX: the advisor's propagator (that is, this propagator) does not need to be run.
  • ES_NOFIX: the advisor's propagator (that is, this propagator) must be run.
  • ES_NOFIX_FORCE: the advisor's propagator (that is, this propagator) must be run and it must forcefully be rescheduled (including recomputation of cost).

Apart from the above values, an advisor can return the result from calling the function defined by a space:

  • ES_FIX_DISPOSE: the advisor's propagator does not need to be run and the advisor will be disposed.
  • ES_NOFIX_DISPOSE: the advisor's propagator must be run and the advisor will be disposed.
  • ES_NOFIX_FORCE_DISPOSE: the advisor's propagator must be run , it must forcefully be rescheduled (including recomputation of cost), and the adviser will be disposed. For more details, see the function documentation.

The delta d describes how the variable has been changed by an operation on the advisor's variable. Typically, the delta information can only be utilized by either static or member functions of views as the actual delta information is both domain and view dependent.

Reimplemented from Gecode::Propagator.

Definition at line 189 of file open.hpp.

◆ propagate()

template<class View, IntRelType irt>
virtual ExecStatus Gecode::Int::Rel::Open< View, irt >::propagate ( Space & home,
const ModEventDelta & med )
inlinevirtual

Propagation function.

The propagation function must return an execution status as follows:

  • ES_FAILED: the propagator has detected failure
  • ES_NOFIX: the propagator has done propagation
  • ES_FIX: the propagator has done propagation and has computed a fixpoint. That is, running the propagator immediately again will do nothing.

Apart from the above values, a propagator can return the result from calling one of the functions defined by a space:

  • ES_SUBSUMED: the propagator is subsumed and has been already deleted.
  • ES_NOFIX_PARTIAL: the propagator has consumed some of its propagation events.
  • ES_FIX_PARTIAL: the propagator has consumed some of its propagation events and with respect to these events is at fixpoint For more details, see the individual functions.

Implements Gecode::Propagator.

Definition at line 206 of file open.hpp.

◆ reschedule()

template<class View, IntRelType irt>
virtual void Gecode::Int::Rel::Open< View, irt >::reschedule ( Space & home)
inlinevirtual

Schedule function.

The function is executed when a propagator is enabled again. Note that a propagator should be scheduled with the right modification event delta and should only be scheduled if it is legal to execute the propagator.

Reimplemented from Gecode::Int::OpenListPropagator< View >.

Definition at line 241 of file open.hpp.

◆ dispose()

template<class View, IntRelType irt>
virtual size_t Gecode::Int::Rel::Open< View, irt >::dispose ( Space & home)
inlinevirtual

Delete actor and return its size.

Reimplemented from Gecode::Actor.

Definition at line 249 of file open.hpp.

◆ post()

template<class View, IntRelType irt>
void Gecode::Int::Rel::Open< View, irt >::post ( Home home,
OpenViewList< View > list,
IntPropLevel ipl )
inlinestatic

Definition at line 259 of file open.hpp.

Member Data Documentation

◆ council

template<class View, IntRelType irt>
Council<Position> Gecode::Int::Rel::Open< View, irt >::council
protected

Definition at line 68 of file open.hpp.

◆ first

template<class View, IntRelType irt>
int Gecode::Int::Rel::Open< View, irt >::first
protected

Inclusive range of positions needing propagation.

Definition at line 70 of file open.hpp.

◆ last

template<class View, IntRelType irt>
int Gecode::Int::Rel::Open< View, irt >::last
protected

Definition at line 71 of file open.hpp.

◆ domain

template<class View, IntRelType irt>
bool Gecode::Int::Rel::Open< View, irt >::domain
protected

Whether equality propagates holes as well as bounds.

Definition at line 73 of file open.hpp.


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