Class: Longjing::PDDL::Predicate

Inherits:
Object
  • Object
show all
Defined in:
lib/longjing/pddl/predicate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, vars = nil) ⇒ Predicate

Returns a new instance of Predicate.



5
6
7
8
9
# File 'lib/longjing/pddl/predicate.rb', line 5

def initialize(name, vars=nil)
  @name = name
  @vars = vars || []
  @hash = name.hash
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



4
5
6
# File 'lib/longjing/pddl/predicate.rb', line 4

def hash
  @hash
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/longjing/pddl/predicate.rb', line 4

def name
  @name
end

Instance Method Details

#inspectObject



15
16
17
# File 'lib/longjing/pddl/predicate.rb', line 15

def inspect
  "(pred #{to_s})"
end

#to_sObject



11
12
13
# File 'lib/longjing/pddl/predicate.rb', line 11

def to_s
  "(#{[name, *@vars].join(' ')})"
end