class Gecode::BoolVar

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.



Public Instance Methods

to_bool_var() click to toggle source

Returns the receiver.

# File lib/gecoder/interface/variables.rb, line 167
def to_bool_var
value() click to toggle source

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.

# File lib/gecoder/interface/variables.rb, line 161
def value
  raise 'No value is assigned.' unless assigned?
  send_bound(:val) == 1