Class: Tensai::Pddl::AtomicFormula
- Inherits:
-
Object
- Object
- Tensai::Pddl::AtomicFormula
- Defined in:
- lib/tensai/pddl/atomic_formula.rb
Overview
Atomic formula in a planning domain
Instance Method Summary collapse
- #bind(values) ⇒ Object
-
#initialize(predicate, terms) ⇒ AtomicFormula
constructor
A new instance of AtomicFormula.
Constructor Details
#initialize(predicate, terms) ⇒ AtomicFormula
Returns a new instance of AtomicFormula.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tensai/pddl/atomic_formula.rb', line 18 def initialize(predicate, terms) super predicate, terms raise ArgumentError, 'Unknown Terms' if terms.keys.any? { |k| !predicate.variables.key?(k) } predicate.variables.each do |var| self.terms[var.name] = var unless terms.key? var.name end self.terms.freeze end |
Instance Method Details
#bind(values) ⇒ Object
29 30 31 |
# File 'lib/tensai/pddl/atomic_formula.rb', line 29 def bind(values) AtomicFormula.new(predicate, terms.merge(values)) end |