Google OR-Tools: operations_research::BooleanVar Class Reference

Definition at line 3318 of file constraint_solveri.h.

#include <constraint_solveri.h>

operations_research::IntVar operations_research::IntExpr operations_research::PropagationBaseObject operations_research::BaseObject

Public Member Functions

 BooleanVar (Solver *const s, const std::string &name="")
 ~BooleanVar () override
int64_t Min () const override
void SetMin (int64_t m) override
int64_t Max () const override
void SetMax (int64_t m) override
void SetRange (int64_t mi, int64_t ma) override
 This method sets both the min and the max of the expression.
bool Bound () const override
 Returns true if the min and the max of the expression are equal.
int64_t Value () const override
void RemoveValue (int64_t v) override
 This method removes the value 'v' from the domain of the variable.
void RemoveInterval (int64_t l, int64_t u) override
void WhenBound (Demon *d) override
void WhenRange (Demon *d) override
 Attach a demon that will watch the min or the max of the expression.
void WhenDomain (Demon *d) override
uint64_t Size () const override
 This method returns the number of values in the domain of the variable.
bool Contains (int64_t v) const override
IntVarIteratorMakeHoleIterator (bool reversible) const override
IntVarIteratorMakeDomainIterator (bool reversible) const override
std::string DebugString () const override
int VarType () const override
IntVarIsEqual (int64_t constant) override
 IsEqual.
IntVarIsDifferent (int64_t constant) override
IntVarIsGreaterOrEqual (int64_t constant) override
IntVarIsLessOrEqual (int64_t constant) override
virtual void RestoreValue ()=0
std::string BaseName () const override
 Returns a base name for automatic naming.
int RawValue () const
Public Member Functions inherited from operations_research::IntVar
 IntVar (Solver *s)
 IntVar (Solver *s, const std::string &name)
 IntVar (const IntVar &)=delete
IntVaroperator= (const IntVar &)=delete
 ~IntVar () override
bool IsVar () const override
 Returns true if the expression is indeed a variable.
IntVarVar () override
 Creates a variable from the expression.
virtual void RemoveValues (const std::vector< int64_t > &values)
 This method remove the values from the domain of the variable.
virtual void SetValues (const std::vector< int64_t > &values)
 This method intersects the current domain with the values in the array.
void WhenBound (Solver::Closure closure)
void WhenBound (Solver::Action action)
void WhenDomain (Solver::Closure closure)
void WhenDomain (Solver::Action action)
virtual int64_t OldMin () const =0
 Returns the previous min.
virtual int64_t OldMax () const =0
 Returns the previous max.
void Accept (ModelVisitor *visitor) const override
 Accepts the given visitor.
int index () const
 Returns the index of the variable.
Public Member Functions inherited from operations_research::IntExpr
 IntExpr (Solver *const s)
 IntExpr (const IntExpr &)=delete
IntExproperator= (const IntExpr &)=delete
 ~IntExpr () override
virtual void Range (int64_t *l, int64_t *u)
virtual void SetValue (int64_t v)
 This method sets the value of the expression.
IntVarVarWithName (const std::string &name)
void WhenRange (Solver::Closure closure)
 Attach a demon that will watch the min or the max of the expression.
void WhenRange (Solver::Action action)
 Attach a demon that will watch the min or the max of the expression.
Public Member Functions inherited from operations_research::PropagationBaseObject
 PropagationBaseObject (Solver *const s)
 PropagationBaseObject (const PropagationBaseObject &)=delete
PropagationBaseObjectoperator= (const PropagationBaseObject &)=delete
 ~PropagationBaseObject () override
std::string DebugString () const override
Solversolver () const
void FreezeQueue ()
void UnfreezeQueue ()
void EnqueueDelayedDemon (Demon *const d)
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)
void reset_action_on_fail ()
 This method clears the failure callback.
void set_variable_to_clean_on_fail (IntVar *v)
 Shortcut for variable cleaner.
virtual std::string name () const
 Object naming.
void set_name (absl::string_view name)
bool HasName () const
 Returns whether the object has been named or not.
Public Member Functions inherited from operations_research::BaseObject
 BaseObject ()
 BaseObject (const BaseObject &)=delete
BaseObjectoperator= (const BaseObject &)=delete
virtual ~BaseObject ()=default

Static Public Attributes

static const int kUnboundBooleanVarValue = 2
operations_research::BooleanVar::BooleanVar ( Solver *const s,
const std::string & name = "" )
inlineexplicit

◆ ~BooleanVar()

operations_research::BooleanVar::~BooleanVar ( )
inlineoverride

◆ BaseName()

std::string operations_research::BooleanVar::BaseName ( ) const
inlineoverridevirtual

◆ Bound()

bool operations_research::BooleanVar::Bound ( ) const
inlineoverridevirtual

◆ Contains()

bool operations_research::BooleanVar::Contains ( int64_t v) const
overridevirtual

◆ DebugString()

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

◆ IsDifferent()

IntVar * operations_research::BooleanVar::IsDifferent ( int64_t constant)
overridevirtual

◆ IsEqual()

IntVar * operations_research::BooleanVar::IsEqual ( int64_t constant)
overridevirtual

◆ IsGreaterOrEqual()

IntVar * operations_research::BooleanVar::IsGreaterOrEqual ( int64_t constant)
overridevirtual

◆ IsLessOrEqual()

IntVar * operations_research::BooleanVar::IsLessOrEqual ( int64_t constant)
overridevirtual

◆ MakeDomainIterator()

IntVarIterator * operations_research::BooleanVar::MakeDomainIterator ( bool reversible) const
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.

Definition at line 6379 of file expressions.cc.

◆ MakeHoleIterator()

IntVarIterator * operations_research::BooleanVar::MakeHoleIterator ( bool reversible) const
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.

Definition at line 6376 of file expressions.cc.

◆ Max()

int64_t operations_research::BooleanVar::Max ( ) const
inlineoverridevirtual

◆ Min()

int64_t operations_research::BooleanVar::Min ( ) const
inlineoverridevirtual

◆ RawValue()

int operations_research::BooleanVar::RawValue ( ) const
inline

◆ RemoveInterval()

void operations_research::BooleanVar::RemoveInterval ( int64_t l,
int64_t u )
overridevirtual

◆ RemoveValue()

void operations_research::BooleanVar::RemoveValue ( int64_t v)
overridevirtual

◆ RestoreValue()

virtual void operations_research::BooleanVar::RestoreValue ( )
pure virtual

◆ SetMax()

void operations_research::BooleanVar::SetMax ( int64_t m)
overridevirtual

◆ SetMin()

void operations_research::BooleanVar::SetMin ( int64_t m)
overridevirtual

◆ SetRange()

void operations_research::BooleanVar::SetRange ( int64_t l,
int64_t u )
overridevirtual

◆ Size()

uint64_t operations_research::BooleanVar::Size ( ) const
overridevirtual

◆ Value()

int64_t operations_research::BooleanVar::Value ( ) const
inlineoverridevirtual

◆ VarType()

int operations_research::BooleanVar::VarType ( ) const
inlineoverridevirtual

◆ WhenBound()

void operations_research::BooleanVar::WhenBound ( Demon * d)
overridevirtual

◆ WhenDomain()

void operations_research::BooleanVar::WhenDomain ( Demon * d)
inlineoverridevirtual

◆ WhenRange()

void operations_research::BooleanVar::WhenRange ( Demon * d)
inlineoverridevirtual

◆ bound_demons_

◆ delayed_bound_demons_

◆ kUnboundBooleanVarValue

const int operations_research::BooleanVar::kUnboundBooleanVarValue = 2

static

◆ value_

int operations_research::BooleanVar::value_

protected

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