Skip to content

Commit ae0836d

Browse files
committed
Reorganizing tests
1 parent 1ed6a24 commit ae0836d

19 files changed

+437
-181
lines changed

src/dsf/mobility/Intersection.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace dsf::mobility {
1919
}
2020
auto iAngle{static_cast<int16_t>(angle * 100)};
2121
m_agents.emplace(iAngle, std::move(pAgent));
22-
++m_agentCounter;
2322
}
2423

2524
void Intersection::addAgent(std::unique_ptr<Agent> pAgent) {
@@ -29,10 +28,4 @@ namespace dsf::mobility {
2928
}
3029
addAgent(static_cast<double>(lastKey), std::move(pAgent));
3130
}
32-
33-
Size Intersection::agentCounter() {
34-
Size copy{m_agentCounter};
35-
m_agentCounter = 0;
36-
return copy;
37-
}
3831
} // namespace dsf::mobility

src/dsf/mobility/Intersection.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ namespace dsf::mobility {
2424
std::multimap<int16_t, std::unique_ptr<Agent>> m_agents;
2525
std::set<Id>
2626
m_streetPriorities; // A set containing the street ids that have priority - like main roads
27-
Size m_agentCounter;
2827

2928
public:
3029
/// @brief Construct a new Intersection object
@@ -98,11 +97,6 @@ namespace dsf::mobility {
9897
/// @brief Get the node's agent ids
9998
/// @return std::set<Id> A std::set containing the node's agent ids
10099
std::multimap<int16_t, std::unique_ptr<Agent>>& agents() { return m_agents; };
101-
/// @brief Returns the number of agents that have passed through the node
102-
/// @return Size The number of agents that have passed through the node
103-
/// @details This function returns the number of agents that have passed through the node
104-
/// since the last time this function was called. It also resets the counter.
105-
Size agentCounter();
106100
/// @brief Returns the number of agents currently in the node
107101
/// @return Size The number of agents currently in the node
108102
Size nAgents() const { return m_agents.size(); }

src/dsf/mobility/Street.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ namespace dsf::mobility {
181181
m_flowRate = flowRate;
182182
}
183183
double StochasticStreet::flowRate() const { return m_flowRate; }
184-
bool StochasticStreet::isStochastic() const { return true; }
185184

186185
void SpireStreet::addAgent(std::unique_ptr<Agent> pAgent) {
187186
Street::addAgent(std::move(pAgent));

src/dsf/mobility/Street.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ namespace dsf::mobility {
164164
void setFlowRate(double const flowRate);
165165
double flowRate() const;
166166

167-
bool isStochastic() const final;
167+
constexpr bool isStochastic() const final { return true; };
168168
};
169169

170170
/// @brief The SpireStreet class represents a street which is able to count agent flows in both input and output.
@@ -193,7 +193,7 @@ namespace dsf::mobility {
193193
std::unique_ptr<Agent> dequeue(size_t index) final;
194194
/// @brief Check if the street is a spire
195195
/// @return bool True if the street is a spire, false otherwise
196-
bool isSpire() const final { return true; };
196+
constexpr bool isSpire() const final { return true; };
197197
};
198198

199199
class StochasticSpireStreet : public StochasticStreet, public Counter {
@@ -214,7 +214,7 @@ namespace dsf::mobility {
214214
std::unique_ptr<Agent> dequeue(size_t index) final;
215215
/// @brief Check if the street is a spire
216216
/// @return bool True if the street is a spire, false otherwise
217-
bool isSpire() const final { return true; };
217+
constexpr bool isSpire() const final { return true; };
218218
};
219219

220220
}; // namespace dsf::mobility

test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ if(NOT rapidcsv_POPULATED)
4444
FetchContent_MakeAvailable(rapidcsv)
4545
endif()
4646

47-
# add as executable all cpp files into '.' folder
48-
file(GLOB TEST_SOURCES "*.cpp")
47+
# add as executable all cpp files into '.' folder and subdirectories
48+
file(GLOB TEST_SOURCES "*.cpp" "*/*.cpp")
4949
file(GLOB SRC_SOURCES "../src/dsf/base/*.cpp" "../src/dsf/mobility/*.cpp" "../src/dsf/utility/*.cpp" "../src/dsf/geometry/*.cpp")
5050
list(APPEND SOURCES ${TEST_SOURCES} ${SRC_SOURCES})
5151

test/Test_agent.cpp

Lines changed: 0 additions & 116 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "../src/dsf/base/AdjacencyMatrix.hpp"
2-
#include "../src/dsf/mobility/RoadNetwork.hpp"
1+
#include "../../src/dsf/base/AdjacencyMatrix.hpp"
2+
#include "../../src/dsf/mobility/RoadNetwork.hpp"
33

44
#include "doctest.h"
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "../src/dsf/base/SparseMatrix.hpp"
1+
#include "../../src/dsf/base/SparseMatrix.hpp"
22

33
#include "doctest.h"
44

0 commit comments

Comments
 (0)