module Gecode::BoolEnum::BoolEnumOperand

A BoolEnumOperand is a enumeration of BoolOperand on which the constraints defined in BoolEnumConstraintReceiver can be placed.

Enumerations of boolean operands can be created either by using Gecode::Mixin#bool_var_array and Gecode::Mixin#bool_var_matrix, or by wrapping an existing enumeration containing BoolOperand using Gecode::Mixin#wrap_enum. The enumerations, no matter how they were created, all respond to the properties defined by BoolEnumOperand.

Examples

Produces an array of five boolean operands inside a problem formulation using Gecode::Mixin#bool_var_array:

bool_enum = bool_var_array(5)

Uses Gecode::Mixin#wrap_enum inside a problem formulation to create a BoolEnumOperand from an existing enumeration containing the boolean operands bool_operand1 and bool_operand2:

bool_enum = wrap_enum([bool_operand1, bool_operand2])

Public Instance Methods

conjunction() click to toggle source

Produces a BoolOperand that represents the conjunction (AND) of all boolean operands in this enumeration.

Examples

# Conjunction of all elements in +bool_enum+.
bool_enum.conjunction
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/bool_enum/relation.rb, line 10
def conjunction
  Relation::BoolEnumConjunctionOperand.new(@model, self)
end
disjunction() click to toggle source

Produces a BoolOperand that represents the disjunction (OR) of all boolean operands in this enumeration.

Examples

# Disjunction of all elements in +bool_enum+.
bool_enum.disjunction
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/bool_enum/relation.rb, line 21
def disjunction
  Relation::BoolEnumDisjunctionOperand.new(@model, self)
end
method_missing(method, *args) click to toggle source
Calls superclass method
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/bool_enum_constraints.rb, line 32
def method_missing(method, *args) 
  if Gecode::BoolEnum::Dummy.instance_methods.include? method.to_s
    # Delegate to the bool enum.
    to_bool_enum.method(method).call(*args)
  else
    super
  end
end