Class: Gecode::BoolVar
- Inherits:
-
Object
- Object
- Gecode::BoolVar
- Includes:
- Gecode::Bool::BoolOperand
- Defined in:
- lib/gecoder/interface/variables.rb
Overview
Describes a boolean variable.
A boolean variable can be either true or false.
Boolean variables are boolean operands and hence respond to everything that Gecode::Bool::BoolOperand responds to. Any constraint found in Gecode::Bool::BoolConstraintReceiver can thereby be placed on boolean variables.
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#to_bool_var ⇒ Object
Returns the receiver.
-
#value ⇒ Object
Gets the values in the assigned boolean variable (true or false).
Methods included from Gecode::Bool::BoolOperand
#&, #*, #+, #-, #^, #implies, #method_missing, #|
Methods included from Operand
Methods included from Gecode::Bool::BoolLinearOperations
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Gecode::Bool::BoolOperand
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
154 155 156 |
# File 'lib/gecoder/interface/variables.rb', line 154 def model @model end |
Instance Method Details
#to_bool_var ⇒ Object
Returns the receiver.
167 168 169 |
# File 'lib/gecoder/interface/variables.rb', line 167 def to_bool_var self end |
#value ⇒ Object
Gets the values in the assigned boolean variable (true or false). The variable must be assigned, if it isn’t then a RuntimeError is raised.
161 162 163 164 |
# File 'lib/gecoder/interface/variables.rb', line 161 def value raise 'No value is assigned.' unless assigned? send_bound(:val) == 1 end |