Skip to content
Snippets Groups Projects
Commit e1c5fbab authored by Romain BERNARD's avatar Romain BERNARD
Browse files

remove useless debug code

parent 636a16ae
No related branches found
No related tags found
1 merge request!1Transit algorithm implementation
......@@ -16,6 +16,7 @@ private:
int _instant;
int _passageIndex;
std::vector<LineStop> _connections;
int _precedingNodeIndex;
public:
TransitAlgorithmState(int currentNode, int currentInstant, int currentPassageIndex) {
......@@ -29,9 +30,11 @@ public:
_nodeIndex = baseState.getNodeIndex();
_instant = baseState.getInstant();
_passageIndex = baseState.getPassageIndex();
_connections.reserve(2);
_precedingNodeIndex = baseState.getPrecedingNodeIndex();
//Copy old connections
_connections.clear();
_connections.reserve(2);
for(auto& lineStop : baseState.getConnections()) {
_connections.emplace_back(lineStop);
}
......@@ -43,9 +46,11 @@ public:
_nodeIndex = baseState.getNodeIndex();
_instant = baseState.getInstant();
_passageIndex = baseState.getPassageIndex();
_connections.reserve(2);
_precedingNodeIndex = baseState.getPrecedingNodeIndex();
//Copy old connections
_connections.clear();
_connections.reserve(2);
for(auto& lineStop : baseState.getConnections()) {
_connections.emplace_back(lineStop);
}
......@@ -182,18 +187,6 @@ public:
}
TransitAlgorithmState& operator=(const TransitAlgorithmState& baseState) = default;
// TransitAlgorithmState& operator=(const TransitAlgorithmState& baseState) {
// _nodeIndex = baseState.getNodeIndex();
// _instant = baseState.getInstant();
// _passageIndex = baseState.getPassageIndex();
// //Copy old connections
// _connections.clear();
// for(auto& lineStop : baseState.getConnections()) {
// _connections.emplace_back(lineStop);
// }
//
// return *this;
// }
[[nodiscard]] std::string toString() const {
std::string res = "Node: " + std::to_string(_nodeIndex) + ", Instant: " + std::to_string(_instant);
......
......@@ -30,8 +30,7 @@ TransitStateContainer TransitShortestPathPrecompute::executeAlgorithm(const Grap
currentState = statePriorityQueue.top();
statePriorityQueue.pop();
if(!solutionsContainer.strictlyDominates(currentState)) {
DEBUG_MSG("\n\nComparing state " + currentState.toString() + " and \n" + solutionsContainer.getBestSolution(currentState.getNodeIndex(), currentState.getNbConnections()).toString());
DEBUG_MSG("State isn't dominated, trying to extend it");
DEBUG_MSG("\n\nComparing state " + currentState.toString() + " and " + solutionsContainer.getBestSolution(currentState.getNodeIndex(), currentState.getNbConnections()).toString());
for (auto& lineStop : graph.getPTLinesSet(currentState.getNodeIndex()))
{
int nextNode = lineStop.getNextNodeIndex();
......
......@@ -17,9 +17,7 @@ private:
std::vector<int> _nodes; //index according to Graph::_nodes, sorted according to line order (start -> terminus)
std::vector<std::vector<int>> _timetables; //list of list of timestamps for each node start order (size of _timetables must remain constant throughout the whole vector
public:
Line(){
_lineID = "";
}
Line() = default;
[[nodiscard]] const std::string &getLineId() const;
void setLineId(const std::string &lineId);
......@@ -63,14 +61,6 @@ public:
bool operator!=(const Line &rhs) const {
return _lineID != rhs.getLineId();
}
// Line& operator=(const Line &rhs) {
// _lineID = rhs.getLineId();
// _nodes = rhs.getNodes();
// _timetables = rhs.getTimetables();
// return *this;
// }
};
#include "Node.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment