Class: Longjing::PDDL::Equal
- Defined in:
- lib/longjing/pddl/literal.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Attributes inherited from Literal
#ff_goal, #ff_layer, #ff_neg_goal
Instance Method Summary collapse
-
#initialize(left, right) ⇒ Equal
constructor
A new instance of Equal.
- #inspect ⇒ Object
- #substitute(variables) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Literal
Constructor Details
#initialize(left, right) ⇒ Equal
Returns a new instance of Equal.
146 147 148 |
# File 'lib/longjing/pddl/literal.rb', line 146 def initialize(left, right) @left, @right = left, right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
145 146 147 |
# File 'lib/longjing/pddl/literal.rb', line 145 def left @left end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
145 146 147 |
# File 'lib/longjing/pddl/literal.rb', line 145 def right @right end |
Instance Method Details
#inspect ⇒ Object
158 159 160 |
# File 'lib/longjing/pddl/literal.rb', line 158 def inspect "(= #{@left.inspect} #{@right.inspect})" end |
#substitute(variables) ⇒ Object
150 151 152 |
# File 'lib/longjing/pddl/literal.rb', line 150 def substitute(variables) variables[@left] == variables[@right] ? EMPTY : nil end |
#to_s ⇒ Object
154 155 156 |
# File 'lib/longjing/pddl/literal.rb', line 154 def to_s "(= #{@left} #{@right})" end |