From 7213728a420b2572752a28d732f94da598c3ccd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu>
Date: Wed, 1 Apr 2020 19:43:11 +0200
Subject: [PATCH] print() uses the NodeOther lists

---
 src/problem/problem.cpp | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp
index fc59f0b78..815927331 100644
--- a/src/problem/problem.cpp
+++ b/src/problem/problem.cpp
@@ -1088,16 +1088,24 @@ void Problem::print(int depth, std::ostream& stream, bool constr_by, bool metric
                                 for (auto c : f->getFactorList())
                                 {
                                     stream << "        Fac" << c->id() << " " << c->getType() << " -->";
-                                    if (c->getFrameOther() == nullptr && c->getCaptureOther() == nullptr && c->getFeatureOther() == nullptr && c->getLandmarkOther() == nullptr)
+                                    if (       c->getFrameOtherList()   .empty()
+                                            && c->getCaptureOtherList() .empty()
+                                            && c->getFeatureOtherList() .empty()
+                                            && c->getLandmarkOtherList().empty())
                                         stream << " Abs";
-                                    if (c->getFrameOther() != nullptr)
-                                        stream << " Frm" << c->getFrameOther()->id();
-                                    if (c->getCaptureOther() != nullptr)
-                                        stream << " Cap" << c->getCaptureOther()->id();
-                                    if (c->getFeatureOther() != nullptr)
-                                        stream << " Fac" << c->getFeatureOther()->id();
-                                    if (c->getLandmarkOther() != nullptr)
-                                        stream << " Lmk" << c->getLandmarkOther()->id();
+
+                                    for (const auto& Fow : c->getFrameOtherList())
+                                        if (!Fow.expired())
+                                            stream << " Frm" << Fow.lock()->id();
+                                    for (const auto& Cow : c->getCaptureOtherList())
+                                        if (!Cow.expired())
+                                            stream << " Cap" << Cow.lock()->id();
+                                    for (const auto& fow : c->getFeatureOtherList())
+                                        if (!fow.expired())
+                                            stream << " Ftr" << fow.lock()->id();
+                                    for (const auto& Low : c->getLandmarkOtherList())
+                                        if (!Low.expired())
+                                            stream << " Lmk" << Low.lock()->id();
                                     stream << std::endl;
                                 } // for c
                             }
-- 
GitLab