Class: Longjing::FF::Action
- Inherits:
-
Object
- Object
- Longjing::FF::Action
- Defined in:
- lib/longjing/ff/action.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#add ⇒ Object
readonly
Returns the value of attribute add.
-
#count_target ⇒ Object
readonly
Returns the value of attribute count_target.
-
#counter ⇒ Object
Returns the value of attribute counter.
-
#del ⇒ Object
readonly
Returns the value of attribute del.
-
#difficulty ⇒ Object
Returns the value of attribute difficulty.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#layer ⇒ Object
Returns the value of attribute layer.
-
#pre ⇒ Object
readonly
Returns the value of attribute pre.
Instance Method Summary collapse
-
#initialize(action) ⇒ Action
constructor
A new instance of Action.
- #signature ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(action) ⇒ Action
Returns a new instance of Action.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/longjing/ff/action.rb', line 8 def initialize(action) @action = action @pre = [] @add = [] @del = [] @action.precond.to_a.each do |lit| if lit.ff_neg_goal || !lit.is_a?(PDDL::Not) @pre << lit end end @action.effect.to_a.each do |lit| if lit.ff_neg_goal || !lit.is_a?(PDDL::Not) @add << lit else @del << lit.literal end end @count_target = @pre.size @hash = self.object_id end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
5 6 7 |
# File 'lib/longjing/ff/action.rb', line 5 def action @action end |
#add ⇒ Object (readonly)
Returns the value of attribute add.
6 7 8 |
# File 'lib/longjing/ff/action.rb', line 6 def add @add end |
#count_target ⇒ Object (readonly)
Returns the value of attribute count_target.
5 6 7 |
# File 'lib/longjing/ff/action.rb', line 5 def count_target @count_target end |
#counter ⇒ Object
Returns the value of attribute counter.
4 5 6 |
# File 'lib/longjing/ff/action.rb', line 4 def counter @counter end |
#del ⇒ Object (readonly)
Returns the value of attribute del.
6 7 8 |
# File 'lib/longjing/ff/action.rb', line 6 def del @del end |
#difficulty ⇒ Object
Returns the value of attribute difficulty.
4 5 6 |
# File 'lib/longjing/ff/action.rb', line 4 def difficulty @difficulty end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
5 6 7 |
# File 'lib/longjing/ff/action.rb', line 5 def hash @hash end |
#layer ⇒ Object
Returns the value of attribute layer.
4 5 6 |
# File 'lib/longjing/ff/action.rb', line 4 def layer @layer end |
#pre ⇒ Object (readonly)
Returns the value of attribute pre.
6 7 8 |
# File 'lib/longjing/ff/action.rb', line 6 def pre @pre end |
Instance Method Details
#signature ⇒ Object
30 31 32 |
# File 'lib/longjing/ff/action.rb', line 30 def signature @action.signature end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/longjing/ff/action.rb', line 34 def to_s "Action[#{signature}]" end |