Class: Gecode::Constraints::Bool::ExpressionNode

Inherits:
Object
  • Object
show all
Includes:
OperationMethods
Defined in:
lib/gecoder/interface/constraints/bool/boolean.rb

Overview

Describes a single node in a boolean expression.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LeftHandSideMethods

#must, #must_not

Constructor Details

#initialize(value, model = nil) ⇒ ExpressionNode

Returns a new instance of ExpressionNode.



244
245
246
247
248
249
250
251
# File 'lib/gecoder/interface/constraints/bool/boolean.rb', line 244

def initialize(value, model = nil)
  unless value.kind_of?(Gecode::FreeBoolVar)
    raise TypeError, 'Invalid type used in boolean equation: ' +
      "#{value.class}."
  end
  @value = value
  @model = model
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



242
243
244
# File 'lib/gecoder/interface/constraints/bool/boolean.rb', line 242

def model
  @model
end

Instance Method Details

#to_minimodel_bool_exprObject

Returns a MiniModel boolean expression representing the tree.



254
255
256
# File 'lib/gecoder/interface/constraints/bool/boolean.rb', line 254

def to_minimodel_bool_expr
  Gecode::Raw::MiniModel::BoolExpr.new(@value.bind)
end