From 25426b5dd7edc26be90abe4497669c766fe8586a Mon Sep 17 00:00:00 2001
From: Romain BERNARD <30secondstodraw@gmail.com>
Date: Tue, 19 Mar 2024 18:14:32 +0100
Subject: [PATCH] Add some access methods

---
 src/instance/graph/Graph.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/instance/graph/Graph.h b/src/instance/graph/Graph.h
index c1b329d..9ad45fe 100644
--- a/src/instance/graph/Graph.h
+++ b/src/instance/graph/Graph.h
@@ -42,10 +42,18 @@ public:
         return nodesVector.at(nodeIndex);
     }
 
+    [[nodiscard]] size_t getNbNodes() const {
+        return nodesVector.size();
+    }
+
     [[nodiscard]] std::vector<LineStop> getPTLinesSet(int nodeIndex) const {
         return nodesVector.at(nodeIndex).getPTLinesSet();
     }
 
+    [[nodiscard]] size_t getNbPTLines(int nodeIndex) const {
+        return nodesVector.at(nodeIndex).getPTLinesSet().size();
+    }
+
     /**
      * @return The graph's edge vector
      */
@@ -53,6 +61,19 @@ public:
         return edgesVector;
     }
 
+    [[nodiscard]] size_t getNbIncomingEdges(int nodeIndex) const {
+        return nodesVector.at(nodeIndex).getIncomingEdges().size();
+    }
+
+    [[nodiscard]] size_t getNbOutgoingEdges(int nodeIndex) const {
+        return nodesVector.at(nodeIndex).getOutgoingEdges().size();
+    }
+
+
+    [[nodiscard]] size_t getNbEdges(int nodeIndex) const {
+        return nodesVector.at(nodeIndex).getIncomingEdges().size() + nodesVector.at(nodeIndex).getOutgoingEdges().size();
+    }
+
     /**
      * @return A vector containing the list of transit lines defined in our graph (effectively G^TP)
      */
-- 
GitLab