OR-Tools  8.2
Demonabstract

Detailed Description

A Demon is the base element of a propagation queue.

It is the main object responsible for implementing the actual propagation of the constraint and pruning the inconsistent values in the domains of the variables. The main concept is that demons are listeners that are attached to the variables and listen to their modifications. There are two methods:

  • Run() is the actual method called when the demon is processed.
  • priority() returns its priority. Standard priorities are slow, normal or fast. "immediate" is reserved for variables and is treated separately.

Definition at line 3301 of file constraint_solver.h.

Public Member Functions

 Demon ()
 This indicates the priority of a demon. More...
 
 ~Demon () override
 
virtual void Run (Solver *const s)=0
 This is the main callback of the demon. More...
 
virtual Solver::DemonPriority priority () const
 This method returns the priority of the demon. More...
 
std::string DebugString () const override
 
void inhibit (Solver *const s)
 This method inhibits the demon in the search tree below the current position. More...
 
void desinhibit (Solver *const s)
 This method un-inhibits the demon that was previously inhibited. More...
 

Constructor & Destructor Documentation

◆ Demon()

Demon ( )
inline

This indicates the priority of a demon.

Immediate demons are treated separately and corresponds to variables.

Definition at line 3305 of file constraint_solver.h.

◆ ~Demon()

~Demon ( )
inlineoverride

Definition at line 3306 of file constraint_solver.h.

Member Function Documentation

◆ DebugString()

std::string DebugString ( ) const
overridevirtual

◆ desinhibit()

void desinhibit ( Solver *const  s)

This method un-inhibits the demon that was previously inhibited.

Definition at line 205 of file constraint_solver.cc.

◆ inhibit()

void inhibit ( Solver *const  s)

This method inhibits the demon in the search tree below the current position.

Definition at line 199 of file constraint_solver.cc.

◆ priority()

Solver::DemonPriority priority ( ) const
virtual

This method returns the priority of the demon.

Usually a demon is fast, slow or normal. Immediate demons are reserved for internal use to maintain variables.

Reimplemented in DelayedCallMethod2< T, P, Q >, DelayedCallMethod1< T, P >, and DelayedCallMethod0< T >.

Definition at line 193 of file constraint_solver.cc.

◆ Run()

virtual void Run ( Solver *const  s)
pure virtual

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