![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
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:
Definition at line 3636 of file constraint_solver.h.
#include <constraint_solver.h>
Public Member Functions | |
| Demon () | |
| Demon (const Demon &)=delete | |
| Demon & | operator= (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 | |
| BaseObject & | operator= (const BaseObject &)=delete |
| virtual | ~BaseObject ()=default |
Friends | |
| class | Queue |
|
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.
|
delete |
|
inlineoverride |
Definition at line 3647 of file constraint_solver.h.
|
overridevirtual |
Reimplemented from operations_research::BaseObject.
Definition at line 206 of file constraint_solver.cc.
| 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.
| 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.
|
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 operations_research::DelayedCallMethod0< T >, operations_research::DelayedCallMethod1< T, P >, and operations_research::DelayedCallMethod2< T, P, Q >.
Definition at line 202 of file constraint_solver.cc.
|
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 >.
|
friend |
Definition at line 3667 of file constraint_solver.h.