Skip to content

Commit

Permalink
Fix subtasks index from 07d9257
Browse files Browse the repository at this point in the history
  • Loading branch information
Maumagnaguagno committed Dec 9, 2023
1 parent 07d9257 commit 8befd43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Hypertension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def planning(tasks, level = 0)
puts "#{' ' * level.pred}#{method}(#{current_task.join(' ')})" if @debug
# Every unification is tested
__send__(method, *current_task) {|subtasks|
subtasks.each {|t| [(@index += 1 if @domain[t[0]]), t]}
subtasks.map! {|t| [(@index += 1 if @domain[t[0]]), t]}
new_index = @index
if plan = planning(subtasks.concat(tasks), level)
@decomposition.unshift("#{index} #{task_name} #{current_task.join(' ')} -> #{method[task_name.size+1..-1]} #{(old_index+1..new_index).to_a.join(' ')}")
Expand Down

0 comments on commit 8befd43

Please sign in to comment.