--— Boolean Variable --— More...
#include <constraint_solveri.h>


Public Member Functions | |
| BooleanVar (Solver *const s, const std::string &name="") | |
| ~BooleanVar () override | |
| int64 | Min () const override |
| void | SetMin (int64 m) override |
| int64 | Max () const override |
| void | SetMax (int64 m) override |
| void | SetRange (int64 mi, int64 ma) override |
| This method sets both the min and the max of the expression. More... | |
| bool | Bound () const override |
| Returns true if the min and the max of the expression are equal. More... | |
| int64 | Value () const override |
| This method returns the value of the variable. More... | |
| void | RemoveValue (int64 v) override |
| This method removes the value 'v' from the domain of the variable. More... | |
| void | RemoveInterval (int64 l, int64 u) override |
| This method removes the interval 'l' . More... | |
| void | WhenBound (Demon *d) override |
| This method attaches a demon that will be awakened when the variable is bound. More... | |
| void | WhenRange (Demon *d) override |
| Attach a demon that will watch the min or the max of the expression. More... | |
| void | WhenDomain (Demon *d) override |
| This method attaches a demon that will watch any domain modification of the domain of the variable. More... | |
| uint64 | Size () const override |
| This method returns the number of values in the domain of the variable. More... | |
| bool | Contains (int64 v) const override |
| This method returns whether the value 'v' is in the domain of the variable. More... | |
| IntVarIterator * | MakeHoleIterator (bool reversible) const override |
| Creates a hole iterator. More... | |
| IntVarIterator * | MakeDomainIterator (bool reversible) const override |
| Creates a domain iterator. More... | |
| std::string | DebugString () const override |
| int | VarType () const override |
| IntVar * | IsEqual (int64 constant) override |
| IsEqual. More... | |
| IntVar * | IsDifferent (int64 constant) override |
| IntVar * | IsGreaterOrEqual (int64 constant) override |
| IntVar * | IsLessOrEqual (int64 constant) override |
| virtual void | RestoreValue ()=0 |
| std::string | BaseName () const override |
| Returns a base name for automatic naming. More... | |
| int | RawValue () const |
| bool | IsVar () const override |
| Returns true if the expression is indeed a variable. More... | |
| IntVar * | Var () override |
| Creates a variable from the expression. More... | |
| virtual void | RemoveValues (const std::vector< int64 > &values) |
| This method remove the values from the domain of the variable. More... | |
| virtual void | SetValues (const std::vector< int64 > &values) |
| This method intersects the current domain with the values in the array. More... | |
| void | WhenBound (Solver::Closure closure) |
| This method attaches a closure that will be awakened when the variable is bound. More... | |
| void | WhenBound (Solver::Action action) |
| This method attaches an action that will be awakened when the variable is bound. More... | |
| void | WhenDomain (Solver::Closure closure) |
| This method attaches a closure that will watch any domain modification of the domain of the variable. More... | |
| void | WhenDomain (Solver::Action action) |
| This method attaches an action that will watch any domain modification of the domain of the variable. More... | |
| virtual int64 | OldMin () const =0 |
| Returns the previous min. More... | |
| virtual int64 | OldMax () const =0 |
| Returns the previous max. More... | |
| void | Accept (ModelVisitor *const visitor) const override |
| Accepts the given visitor. More... | |
| int | index () const |
| Returns the index of the variable. More... | |
| virtual void | Range (int64 *l, int64 *u) |
| By default calls Min() and Max(), but can be redefined when Min and Max code can be factorized. More... | |
| virtual void | SetValue (int64 v) |
| This method sets the value of the expression. More... | |
| IntVar * | VarWithName (const std::string &name) |
| Creates a variable from the expression and set the name of the resulting var. More... | |
| void | WhenRange (Solver::Closure closure) |
| Attach a demon that will watch the min or the max of the expression. More... | |
| void | WhenRange (Solver::Action action) |
| Attach a demon that will watch the min or the max of the expression. More... | |
| Solver * | solver () const |
| void | FreezeQueue () |
| This method freezes the propagation queue. More... | |
| void | UnfreezeQueue () |
| This method unfreezes the propagation queue. More... | |
| void | EnqueueDelayedDemon (Demon *const d) |
| This method pushes the demon onto the propagation queue. More... | |
| void | EnqueueVar (Demon *const d) |
| void | ExecuteAll (const SimpleRevFIFO< Demon * > &demons) |
| void | EnqueueAll (const SimpleRevFIFO< Demon * > &demons) |
| void | set_action_on_fail (Solver::Action a) |
| This method sets a callback that will be called if a failure happens during the propagation of the queue. More... | |
| void | reset_action_on_fail () |
| This method clears the failure callback. More... | |
| void | set_variable_to_clean_on_fail (IntVar *v) |
| Shortcut for variable cleaner. More... | |
| virtual std::string | name () const |
| Object naming. More... | |
| void | set_name (const std::string &name) |
| bool | HasName () const |
| Returns whether the object has been named or not. More... | |
Static Public Attributes | |
| static const int | kUnboundBooleanVarValue |
Protected Attributes | |
| int | value_ |
| SimpleRevFIFO< Demon * > | bound_demons_ |
| SimpleRevFIFO< Demon * > | delayed_bound_demons_ |
--— Boolean Variable --—
Definition at line 1732 of file constraint_solveri.h.
|
inlineexplicit |
Definition at line 1736 of file constraint_solveri.h.
|
inlineoverride |
Definition at line 1739 of file constraint_solveri.h.
|
overridevirtualinherited |
Accepts the given visitor.
Reimplemented from operations_research::IntExpr.
|
inlineoverridevirtual |
Returns a base name for automatic naming.
Reimplemented from operations_research::PropagationBaseObject.
Definition at line 1769 of file constraint_solveri.h.
|
inlineoverridevirtual |
Returns true if the min and the max of the expression are equal.
Reimplemented from operations_research::IntExpr.
Definition at line 1746 of file constraint_solveri.h.
|
overridevirtual |
This method returns whether the value 'v' is in the domain of the variable.
Implements operations_research::IntVar.
|
overridevirtual |
Reimplemented from operations_research::PropagationBaseObject.
|
inherited |
|
inlineinherited |
This method pushes the demon onto the propagation queue.
It will be processed directly if the queue is empty. It will be enqueued according to its priority otherwise.
Definition at line 3173 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3174 of file constraint_solver.h.
|
inherited |
|
inlineinherited |
This method freezes the propagation queue.
It is useful when you need to apply multiple modifications at once.
Definition at line 3164 of file constraint_solver.h.
|
inherited |
Returns whether the object has been named or not.
|
inlineinherited |
Returns the index of the variable.
Definition at line 4071 of file constraint_solver.h.
|
overridevirtual |
Implements operations_research::IntVar.
|
overridevirtual |
IsEqual.
Implements operations_research::IntVar.
|
overridevirtual |
Implements operations_research::IntVar.
|
overridevirtual |
Implements operations_research::IntVar.
|
inlineoverridevirtualinherited |
Returns true if the expression is indeed a variable.
Reimplemented from operations_research::IntExpr.
Definition at line 3984 of file constraint_solver.h.
|
overridevirtual |
Creates a domain iterator.
When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object.
Implements operations_research::IntVar.
|
overridevirtual |
Creates a hole iterator.
When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object.
Implements operations_research::IntVar.
|
inlineoverridevirtual |
Implements operations_research::IntExpr.
Definition at line 1743 of file constraint_solveri.h.
|
inlineoverridevirtual |
Implements operations_research::IntExpr.
Definition at line 1741 of file constraint_solveri.h.
|
virtualinherited |
Object naming.
|
pure virtualinherited |
Returns the previous max.
|
pure virtualinherited |
Returns the previous min.
|
inlinevirtualinherited |
By default calls Min() and Max(), but can be redefined when Min and Max code can be factorized.
Definition at line 3829 of file constraint_solver.h.
|
inline |
Definition at line 1771 of file constraint_solveri.h.
|
overridevirtual |
This method removes the interval 'l' .
. 'u' from the domain of the variable. It assumes that 'l' <= 'u'.
Implements operations_research::IntVar.
|
overridevirtual |
This method removes the value 'v' from the domain of the variable.
Implements operations_research::IntVar.
|
virtualinherited |
This method remove the values from the domain of the variable.
|
inlineinherited |
This method clears the failure callback.
Definition at line 3187 of file constraint_solver.h.
|
pure virtual |
|
inlineinherited |
This method sets a callback that will be called if a failure happens during the propagation of the queue.
Definition at line 3181 of file constraint_solver.h.
|
inherited |
|
inlineinherited |
Shortcut for variable cleaner.
Definition at line 3190 of file constraint_solver.h.
|
overridevirtual |
Implements operations_research::IntExpr.
|
overridevirtual |
Implements operations_research::IntExpr.
|
overridevirtual |
This method sets both the min and the max of the expression.
Reimplemented from operations_research::IntExpr.
|
inlinevirtualinherited |
This method sets the value of the expression.
Definition at line 3840 of file constraint_solver.h.
|
virtualinherited |
This method intersects the current domain with the values in the array.
|
overridevirtual |
This method returns the number of values in the domain of the variable.
Implements operations_research::IntVar.
|
inlineinherited |
Definition at line 3161 of file constraint_solver.h.
|
inlineinherited |
This method unfreezes the propagation queue.
All modifications that happened when the queue was frozen will be processed.
Definition at line 3168 of file constraint_solver.h.
|
inlineoverridevirtual |
This method returns the value of the variable.
This method checks before that the variable is bound.
Implements operations_research::IntVar.
Definition at line 1747 of file constraint_solveri.h.
|
inlineoverridevirtualinherited |
Creates a variable from the expression.
Implements operations_research::IntExpr.
Definition at line 3985 of file constraint_solver.h.
|
inlineoverridevirtual |
Reimplemented from operations_research::IntVar.
Definition at line 1761 of file constraint_solveri.h.
|
inherited |
Creates a variable from the expression and set the name of the resulting var.
If the expression is already a variable, then it will set the name of the expression, possibly overwriting it. This is just a shortcut to Var() followed by set_name().
|
overridevirtual |
This method attaches a demon that will be awakened when the variable is bound.
Implements operations_research::IntVar.
|
inlineinherited |
This method attaches a closure that will be awakened when the variable is bound.
Definition at line 4009 of file constraint_solver.h.
|
inlineinherited |
This method attaches an action that will be awakened when the variable is bound.
Definition at line 4016 of file constraint_solver.h.
|
inlineoverridevirtual |
This method attaches a demon that will watch any domain modification of the domain of the variable.
Implements operations_research::IntVar.
Definition at line 1755 of file constraint_solveri.h.
|
inlineinherited |
This method attaches a closure that will watch any domain modification of the domain of the variable.
Definition at line 4026 of file constraint_solver.h.
|
inlineinherited |
This method attaches an action that will watch any domain modification of the domain of the variable.
Definition at line 4032 of file constraint_solver.h.
|
inlineoverridevirtual |
Attach a demon that will watch the min or the max of the expression.
Implements operations_research::IntExpr.
Definition at line 1754 of file constraint_solveri.h.
|
inlineinherited |
Attach a demon that will watch the min or the max of the expression.
Definition at line 3860 of file constraint_solver.h.
|
inlineinherited |
Attach a demon that will watch the min or the max of the expression.
Definition at line 3866 of file constraint_solver.h.
|
protected |
Definition at line 1775 of file constraint_solveri.h.
|
protected |
Definition at line 1776 of file constraint_solveri.h.
|
static |
Definition at line 1734 of file constraint_solveri.h.
|
protected |
Definition at line 1774 of file constraint_solveri.h.