Skip to content

Commit 1ed6a24

Browse files
committed
Copilot suggestions
1 parent 57c2935 commit 1ed6a24

File tree

10 files changed

+8
-13
lines changed

10 files changed

+8
-13
lines changed

profiling/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ if(NOT rapidcsv_POPULATED)
2929
endif()
3030

3131
file(GLOB SOURCES "../src/dsf/base/*.cpp" "../src/dsf/mobility/*.cpp" "../src/dsf/utility/*.cpp" "../src/dsf/geometry/*.cpp")
32-
list(FILTER SOURCES EXCLUDE REGEX ".*binding.*\\.cpp$")
3332

3433
# Define the executable
3534
add_executable(prof.out main.cpp ${SOURCES})

src/dsf/geometry/Point.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace dsf {
77
namespace geometry {
8-
Point::Point(double x, double y) : m_x(x), m_y(y) {}
98
Point::Point(const std::string& strPoint, const std::string& format) {
109
if (format == "WKT") {
1110
auto start = strPoint.find('(');

src/dsf/geometry/Point.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace dsf {
1919
/// @brief Construct a Point with given x and y coordinates.
2020
/// @param x The x coordinate
2121
/// @param y The y coordinate
22-
Point(double x, double y);
22+
Point(double x, double y) : m_x(x), m_y(y) {}
2323
/// @brief Construct a Point from a string representation.
2424
/// @param strPoint The string representation of the point.
2525
/// @param format The format of the string representation. Default is "WKT".

src/dsf/mobility/Intersection.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include "Intersection.hpp"
22

3-
#include <algorithm>
4-
#include <cmath>
53
#include <stdexcept>
64

75
namespace dsf::mobility {

src/dsf/mobility/Intersection.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ namespace dsf::mobility {
103103
/// @details This function returns the number of agents that have passed through the node
104104
/// since the last time this function was called. It also resets the counter.
105105
Size agentCounter();
106-
106+
/// @brief Returns the number of agents currently in the node
107+
/// @return Size The number of agents currently in the node
107108
Size nAgents() const { return m_agents.size(); }
108109

109-
bool isIntersection() const noexcept final { return true; }
110+
constexpr bool isIntersection() const noexcept final { return true; }
110111
};
111112
} // namespace dsf::mobility
112113

src/dsf/mobility/Roundabout.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ namespace dsf::mobility {
5555
bool isFull() const override { return m_agents.size() == this->capacity(); }
5656
/// @brief Returns true if the node is a roundabout
5757
/// @return bool True if the node is a roundabout
58-
bool isRoundabout() const noexcept override { return true; }
58+
constexpr bool isRoundabout() const noexcept final { return true; }
5959
};
6060
} // namespace dsf::mobility

src/dsf/mobility/Station.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,4 @@ namespace dsf::mobility {
3333
}
3434

3535
bool Station::isFull() const { return m_trains.size() >= this->capacity(); }
36-
37-
bool Station::isStation() const noexcept { return true; }
3836
} // namespace dsf::mobility

src/dsf/mobility/Station.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ namespace dsf::mobility {
5151
bool isFull() const;
5252
/// @brief Check if the node is a station
5353
/// @return True
54-
bool isStation() const noexcept;
54+
constexpr bool isStation() const noexcept final { return true; }
5555
};
5656
} // namespace dsf::mobility

src/dsf/mobility/TrafficLight.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ namespace dsf::mobility {
138138
/// @brief Resets all traffic light cycles
139139
/// @details For more info, see @ref TrafficLightCycle::reset()
140140
void resetCycles();
141-
inline bool isTrafficLight() const noexcept { return true; }
141+
constexpr bool isTrafficLight() const noexcept { return true; }
142142
};
143143
} // namespace dsf::mobility
144144

test/Test_node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "../src/dsf/base/Node.hpp"
44
#include "../src/dsf/mobility/Intersection.hpp"
55
#include "../src/dsf/mobility/TrafficLight.hpp"
6-
#include "../src/dsf/mobility/Roundabout.hpp"
6+
// #include "../src/dsf/mobility/Roundabout.hpp"
77
#include "../src/dsf/mobility/Station.hpp"
88
#include "../src/dsf/utility/Typedef.hpp"
99

0 commit comments

Comments
 (0)