Skip to content

Commit

Permalink
Keep empty tasks without order in Hyper/Cyber compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
Maumagnaguagno committed Apr 27, 2024
1 parent 175bab3 commit 2802547
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compilers/Cyber_Compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def compile_domain(domain_name, problem_name, operators, methods, predicates, st
template.sub!('<TASKS>', define_tasks)
template.sub!('<TASK0>', 'subtask0')
template.sub!('<NTASKS>', tasks.size.to_s)
tasks.unshift(ordered)
tasks.unshift(ordered) unless tasks.empty?
end
template.gsub!(/\b-\b/,'_')
template
Expand Down
2 changes: 1 addition & 1 deletion compilers/Hyper_Compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2802547

Please sign in to comment.