Google OR-Tools: operations_research::Demon Class Reference

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 3636 of file constraint_solver.h.

#include <constraint_solver.h>

operations_research::BaseObject operations_research::CallMethod0< T > operations_research::CallMethod1< T, P > operations_research::CallMethod2< T, P, Q > operations_research::CallMethod3< T, P, Q, R > operations_research::DelayedCallMethod0< T > operations_research::DelayedCallMethod1< T, P > operations_research::DelayedCallMethod2< T, P, Q >

Public Member Functions

 Demon ()
 Demon (const Demon &)=delete
Demonoperator= (const Demon &)=delete
 ~Demon () override
virtual void Run (Solver *s)=0
 This is the main callback of the demon.
virtual Solver::DemonPriority priority () const
std::string DebugString () const override
void inhibit (Solver *s)
void desinhibit (Solver *s)
 This method un-inhibits the demon that was previously inhibited.
Public Member Functions inherited from operations_research::BaseObject
 BaseObject ()
 BaseObject (const BaseObject &)=delete
BaseObjectoperator= (const BaseObject &)=delete
virtual ~BaseObject ()=default

◆ Demon() [1/2]

operations_research::Demon::Demon ( )
inline

This indicates the priority of a demon. Immediate demons are treated separately and corresponds to variables.

Definition at line 3640 of file constraint_solver.h.

◆ Demon() [2/2]

operations_research::Demon::Demon ( const Demon & )
delete
operations_research::Demon::~Demon ( )
inlineoverride

◆ DebugString()

std::string operations_research::Demon::DebugString ( ) const
overridevirtual

◆ desinhibit()

void operations_research::Demon::desinhibit ( Solver * s)

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

Definition at line 214 of file constraint_solver.cc.

◆ inhibit()

void operations_research::Demon::inhibit ( Solver * s)

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

Definition at line 208 of file constraint_solver.cc.

◆ operator=()

Demon & operations_research::Demon::operator= ( const Demon & )
delete

◆ priority()

◆ Run()

virtual void operations_research::Demon::Run ( Solver * s)
pure virtual

This is the main callback of the demon.

Implemented in operations_research::CallMethod0< T >, operations_research::CallMethod1< T, P >, operations_research::CallMethod2< T, P, Q >, operations_research::CallMethod3< T, P, Q, R >, operations_research::DelayedCallMethod0< T >, operations_research::DelayedCallMethod1< T, P >, and operations_research::DelayedCallMethod2< T, P, Q >.

◆ Queue


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