From 2802547fa72ebe470cb2f5bcbaf842702d170381 Mon Sep 17 00:00:00 2001 From: Mau Magnaguagno Date: Sat, 27 Apr 2024 00:54:00 -0300 Subject: [PATCH] Keep empty tasks without order in Hyper/Cyber compilers --- compilers/Cyber_Compiler.rb | 2 +- compilers/Hyper_Compiler.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compilers/Cyber_Compiler.rb b/compilers/Cyber_Compiler.rb index 1524c0a..428edc2 100644 --- a/compilers/Cyber_Compiler.rb +++ b/compilers/Cyber_Compiler.rb @@ -341,7 +341,7 @@ def compile_domain(domain_name, problem_name, operators, methods, predicates, st template.sub!('', define_tasks) template.sub!('', 'subtask0') template.sub!('', tasks.size.to_s) - tasks.unshift(ordered) + tasks.unshift(ordered) unless tasks.empty? end template.gsub!(/\b-\b/,'_') template diff --git a/compilers/Hyper_Compiler.rb b/compilers/Hyper_Compiler.rb index 6da76c2..2e66378 100644 --- a/compilers/Hyper_Compiler.rb +++ b/compilers/Hyper_Compiler.rb @@ -289,8 +289,8 @@ def compile_problem(domain_name, problem_name, operators, methods, predicates, s ordered = tasks.shift problem_str << start_str << " ],\n # Tasks\n [" << tasks.map {|g| "\n [:#{g.join(', :')}]"}.join(',') << "\n ],\n # Debug\n ARGV[0] == 'debug'#{",\n # Ordered\n false" if ordered == false}\n)" unless tasks.empty? - tasks.unshift(ordered) tasks.pop if tasks[-1][0] == 'invisible_goal' + tasks.unshift(ordered) unless tasks.empty? end problem_str.gsub!(/\b-\b/,'_') domain_filename ? "# Generated by Hype\nrequire_relative '#{domain_filename}'\n\n#{problem_str}" : problem_str