Skip to content

Commit

Permalink
Fix empty tasks in Macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Maumagnaguagno committed Dec 18, 2023
1 parent 31bb4d4 commit 1a04400
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/Macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def apply(operators, methods, predicates, state, tasks, goal_pos, goal_not, debu
# Task counter
counter = Hash.new(0)
methods.each {|met| met.drop(2).each {|dec| dec[-1].each {|t,| counter[t] += 1}}}
ordered = tasks.shift
tasks.each {|t,| counter[t] += 1}
# Macro sequential operators
macro = []
Expand All @@ -21,10 +22,11 @@ def apply(operators, methods, predicates, state, tasks, goal_pos, goal_not, debu
}
}
# Macro sequential top ordered operators
if ordered = tasks.shift
case ordered
when true
macro_sequential_operators(operators, macro, tasks, new_subtasks = [ordered], counter, clear_ops, debug)
tasks.replace(new_subtasks)
else
when false
tasks.each {|t,|
if op = operators.assoc(t) and clear_ops.include?(op)
unless methods.assoc(name = "macro_#{t}")
Expand Down

0 comments on commit 1a04400

Please sign in to comment.