From 26f9f95c55fcadcae3fcaf59a2f141d798a4520a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Vallv=C3=A9=20Navarro?= <jvallve@iri.upc.edu>
Date: Tue, 6 Sep 2022 12:09:09 +0200
Subject: [PATCH] optional load map from file

---
 src/problem/problem.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp
index 9097c1ef9..14337d60b 100644
--- a/src/problem/problem.cpp
+++ b/src/problem/problem.cpp
@@ -225,7 +225,11 @@ ProblemPtr Problem::autoSetup(YAML::Node _param_node)
     auto map = FactoryMap::create(map_type, map_node);
     map->setProblem(problem);
     problem->setMap(map);
-
+    // load map from file (optional)
+    if (map_node["filename"])
+    {
+        problem->loadMap(map_node["filename"].as<std::string>());
+    }
 
     // Done
     return problem;
-- 
GitLab