From bd235a6c3deac3b64b8faf86e4385a2fa7b76541 Mon Sep 17 00:00:00 2001 From: Mau Magnaguagno Date: Thu, 19 Oct 2023 20:56:17 -0300 Subject: [PATCH] Output only IPC plan with IPC flag in Hypertension problem --- Hypertension.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Hypertension.rb b/Hypertension.rb index a32ec8a..9c932cf 100644 --- a/Hypertension.rb +++ b/Hypertension.rb @@ -254,9 +254,7 @@ def problem(state, tasks, debug = false, ordered = true) t = Time.now.to_f plan = ordered ? planning(tasks) : task_permutations(state, tasks, (tasks.pop if tasks.dig(-1,1,0) == :invisible_goal)) puts "Time: #{Time.now.to_f - t}s", 'Plan'.center(50,'-') - if plan - puts 'Empty plan' if plan.empty? - puts '==>', plan.map {|d| d.join(' ')}, root, @decomposition, '<==' + if plan then puts '==>', plan.map {|d| d.join(' ')}, root, @decomposition, '<==' else abort(@nostack ? 'Planning failed, try with more stack' : 'Planning failed') end plan