From aa1fb25a63888d5ab8f1901a998d5fa3de1717d3 Mon Sep 17 00:00:00 2001 From: Mau Magnaguagno Date: Wed, 23 Oct 2024 22:45:02 -0300 Subject: [PATCH] Refactor method connections in Dot_Compiler --- compilers/Dot_Compiler.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compilers/Dot_Compiler.rb b/compilers/Dot_Compiler.rb index 0c84611..98d3ed9 100644 --- a/compilers/Dot_Compiler.rb +++ b/compilers/Dot_Compiler.rb @@ -38,13 +38,13 @@ def compile_domain(domain_name, problem_name, operators, methods, predicates, st # Preconditions predicates_to_dot(method_str, dec[2], dec[3]) # Subtasks - connections = '' + connections = "}\"\n ]\n \"#{met[0]}\":#{i} -> \"#{met[0]}_#{dec[0]}\" [style=dotted]\n" dec[4].each_with_index {|subtask,j| method_str << "|<#{j}>#{subtask.join(' ')}" connections << " \"#{met[0]}_#{dec[0]}\":#{j} -> \"#{subtask[0]}\"\n" if all_connections or operators.assoc(subtask[0]) } # Connections - method_str << "}\"\n ]\n \"#{met[0]}\":#{i} -> \"#{met[0]}_#{dec[0]}\" [style=dotted]\n#{connections}" + method_str << connections } domain_str << " \"#{met[0]}\" [\n style=bold\n label=\"{{\\N|#{met[1].join(' ')}}|{#{decompositions.join('|')}}}\"\n ]\n#{method_str}" }