diff --git a/extensions/Dejavu.rb b/extensions/Dejavu.rb index 2569b8d..2ec15fc 100644 --- a/extensions/Dejavu.rb +++ b/extensions/Dejavu.rb @@ -35,7 +35,7 @@ def apply(operators, methods, predicates, state, tasks, goal_pos, goal_not, debu end method.drop(2).each {|dec| break if dec.equal?(decomposition) - dec[-1].each {|subtask,*sterms| subtask.sub!('visit','mark') if subtask.start_with?('invisible_visit_','invisible_unvisit_') and sterms == terms} + dec[4].each {|subtask,*sterms| subtask.sub!('visit','mark') if subtask.start_with?('invisible_visit_','invisible_unvisit_') and sterms == terms} } end } diff --git a/extensions/Macro.rb b/extensions/Macro.rb index d5767f5..29bbbd3 100644 --- a/extensions/Macro.rb +++ b/extensions/Macro.rb @@ -9,7 +9,7 @@ def apply(operators, methods, predicates, state, tasks, goal_pos, goal_not, debu puts 'Macro'.center(50,'-') if debug # Task counter counter = Hash.new(0) - methods.each {|met| met.drop(2).each {|dec| dec[-1].each {|t,| counter[t] += 1}}} + methods.each {|met| met.drop(2).each {|dec| dec[4].each {|t,| counter[t] += 1}}} ordered = tasks.shift tasks.each {|t,| counter[t] += 1} # Macro sequential operators @@ -17,8 +17,7 @@ def apply(operators, methods, predicates, state, tasks, goal_pos, goal_not, debu clear_ops = {} methods.each {|met| met.drop(2).each {|dec| - macro_sequential_operators(operators, macro, dec[-1], new_subtasks = [], counter, clear_ops, debug) - dec[4] = new_subtasks + macro_sequential_operators(operators, macro, dec[4], dec[4] = [], counter, clear_ops, debug) } } # Macro sequential top ordered operators diff --git a/extensions/Pullup.rb b/extensions/Pullup.rb index c0f92c8..000a453 100644 --- a/extensions/Pullup.rb +++ b/extensions/Pullup.rb @@ -203,7 +203,7 @@ def apply(operators, methods, predicates, state, tasks, goal_pos, goal_not, debu def mark_effects(operators, methods, decompositions, effects, visited = {}) decompositions.each {|dec| - dec[-1].each {|s,| + dec[4].each {|s,| unless visited.include?(s) visited[s] = nil if op = operators.assoc(s)