Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::Demon Class Referenceabstract

#include <constraint_solver.h>

Inheritance diagram for operations_research::Demon:
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
 This type is neither copyable nor movable.
 
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
 ---------------— Demon class -------------—
 
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
 This type is neither copyable nor movable.
 
BaseObjectoperator= (const BaseObject &)=delete
 
virtual ~BaseObject ()
 

Friends

class Queue
 

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

Constructor & Destructor Documentation

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

◆ Demon() [2/2]

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

This type is neither copyable nor movable.

◆ ~Demon()

operations_research::Demon::~Demon ( )
inlineoverride

Definition at line 3570 of file constraint_solver.h.

Member Function Documentation

◆ DebugString()

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

Reimplemented from operations_research::BaseObject.

Definition at line 208 of file constraint_solver.cc.

◆ desinhibit()

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

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

Definition at line 216 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 210 of file constraint_solver.cc.

◆ operator=()

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

◆ priority()

Solver::DemonPriority operations_research::Demon::priority ( ) const
virtual

---------------— Demon class -------------—

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 operations_research::DelayedCallMethod0< T >, operations_research::DelayedCallMethod1< T, P >, and operations_research::DelayedCallMethod2< T, P, Q >.

Definition at line 204 of file constraint_solver.cc.

◆ Run()

Friends And Related Symbol Documentation

◆ Queue

friend class Queue
friend

Definition at line 3590 of file constraint_solver.h.


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