Skip to content

Commit e0c90be

Browse files
committed
Formatting
1 parent 94ae4d7 commit e0c90be

File tree

3 files changed

+9
-27
lines changed

3 files changed

+9
-27
lines changed

src/dsm/headers/Graph.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,7 @@ namespace dsm {
207207
}
208208
/// @brief Get the graph's street map
209209
/// @return A std::unordered_map containing the graph's streets
210-
std::unordered_map<Id, std::unique_ptr<Street>>& streetSet() {
211-
return m_streets;
212-
}
210+
std::unordered_map<Id, std::unique_ptr<Street>>& streetSet() { return m_streets; }
213211
/// @brief Get a street from the graph
214212
/// @param source The source node
215213
/// @param destination The destination node

src/dsm/headers/Node.hpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,19 @@ namespace dsm {
5252
void setId(Id id) { m_id = id; }
5353
/// @brief Set the node's coordinates
5454
/// @param coords A std::pair containing the node's coordinates (lat, lon)
55-
void setCoords(std::pair<double, double> coords) {
56-
m_coords = std::move(coords);
57-
}
55+
void setCoords(std::pair<double, double> coords) { m_coords = std::move(coords); }
5856
/// @brief Set the node's capacity
5957
/// @param capacity The node's capacity
6058
virtual void setCapacity(Size capacity) { m_capacity = capacity; }
6159
/// @brief Set the node's transport capacity
6260
/// @param capacity The node's transport capacity
63-
virtual void setTransportCapacity(Size capacity) {
64-
m_transportCapacity = capacity;
65-
}
61+
virtual void setTransportCapacity(Size capacity) { m_transportCapacity = capacity; }
6662
/// @brief Get the node's id
6763
/// @return Id The node's id
6864
Id id() const { return m_id; }
6965
/// @brief Get the node's coordinates
7066
/// @return std::optional<std::pair<double, double>> A std::pair containing the node's coordinates
71-
const std::optional<std::pair<double, double>>& coords() const {
72-
return m_coords;
73-
}
67+
const std::optional<std::pair<double, double>>& coords() const { return m_coords; }
7468
/// @brief Get the node's capacity
7569
/// @return Size The node's capacity
7670
Size capacity() const { return m_capacity; }
@@ -146,9 +140,7 @@ namespace dsm {
146140
/// If a street has priority, it means that the agents that are on that street
147141
/// have priority over the agents that are on the other streets.
148142
/// @return std::set<Id> A std::set containing the node's street priorities
149-
virtual const std::set<Id>& streetPriorities() const {
150-
return m_streetPriorities;
151-
};
143+
virtual const std::set<Id>& streetPriorities() const { return m_streetPriorities; };
152144
/// @brief Get the node's agent ids
153145
/// @return std::set<Id> A std::set containing the node's agent ids
154146
const std::multimap<int16_t, Id>& agents() { return m_agents; };

src/dsm/headers/Street.hpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ namespace dsm {
110110
/// @brief Set the street's node pair
111111
/// @param node1 The source node of the street
112112
/// @param node2 The destination node of the street
113-
void setNodePair(Id node1, Id node2) {
114-
m_nodePair = std::make_pair(node1, node2);
115-
}
113+
void setNodePair(Id node1, Id node2) { m_nodePair = std::make_pair(node1, node2); }
116114
/// @brief Set the street's node pair
117115
/// @param node1 The source node of the street
118116
/// @param node2 The destination node of the street
@@ -158,14 +156,10 @@ namespace dsm {
158156
const std::set<Id>& waitingAgents() const { return m_waitingAgents; }
159157
/// @brief Get the street's queue
160158
/// @return dsm::queue<Size>, The street's queue
161-
const dsm::queue<Size>& queue(size_t index) const {
162-
return m_exitQueues[index];
163-
}
159+
const dsm::queue<Size>& queue(size_t index) const { return m_exitQueues[index]; }
164160
/// @brief Get the street's queues
165161
/// @return std::vector<dsm::queue<Size>> The street's queues
166-
const std::vector<dsm::queue<Size>>& exitQueues() const {
167-
return m_exitQueues;
168-
}
162+
const std::vector<dsm::queue<Size>>& exitQueues() const { return m_exitQueues; }
169163
/// @brief Get the street's node pair
170164
/// @return std::pair<Id, Id>, The street's node pair
171165
const std::pair<Id, Id>& nodePair() const { return m_nodePair; }
@@ -177,9 +171,7 @@ namespace dsm {
177171
double density() const { return nAgents() / (m_len * m_nLanes); }
178172
/// @brief Get the street's normalized density
179173
/// @return double, The street's normalized density
180-
double normDensity() const {
181-
return nAgents() / static_cast<double>(m_capacity);
182-
}
174+
double normDensity() const { return nAgents() / static_cast<double>(m_capacity); }
183175
/// @brief Check if the street is full
184176
/// @return bool, True if the street is full, false otherwise
185177
bool isFull() const { return nAgents() == m_capacity; }

0 commit comments

Comments
 (0)