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

fix cases where isEntry wasn't used to differentiate transit entry/exit

parent f288e90f
No related branches found
No related tags found
1 merge request!1Multimodal Insertion Heuristic prototype
......@@ -109,7 +109,7 @@ MultimodalModularHeuristic::insertBestTransitAccessInRoute(const std::vector<Req
for(const auto& subreq : accessSubRequestsList) {
updateSubRequest(baseRequestId, subreq, isEntry);
SAEVRouteChangelist changeList = BestInsertionHeuristic::tryBestRequestInsertionInActiveVehicle(
_route->getEntrySubRequestOrigin(baseRequestId), *_route);
_route->getSubRequestOrigin(baseRequestId, isEntry), *_route);
//If we've found an insertion that doesn't create a vehicle, stop there
if(changeList.success()) {
DEBUG_MMH_MSG("ENTRY CANDIDATE SUCCESS : " + subreq.to_string());
......@@ -162,8 +162,13 @@ void MultimodalModularHeuristic::updateSubRequest(size_t requestId, const Reques
else
_exitSubRequests[requestId] = request;
_route->getEntrySubRequestOrigin(requestId).setRequest(&getSubrequest(requestId, isEntry));
_route->getEntrySubRequestDestination(requestId).setRequest(&getSubrequest(requestId, isEntry));
if(isEntry) {
_route->getEntrySubRequestOrigin(requestId).setRequest(&getSubrequest(requestId, isEntry));
_route->getEntrySubRequestDestination(requestId).setRequest(&getSubrequest(requestId, isEntry));
} else {
_route->getExitSubRequestOrigin(requestId).setRequest(&getSubrequest(requestId, isEntry));
_route->getExitSubRequestDestination(requestId).setRequest(&getSubrequest(requestId, isEntry));
}
}
const Request& MultimodalModularHeuristic::getSubrequest(size_t requestId, bool isEntry) {
......
......@@ -565,3 +565,10 @@ SAEVRouteChangelist SAEVRoute::removeRequestWithPropagation(size_t requestId) {
return removeRequestWithPropagation(getRequestOrigin(requestId));
}
SAEVKeyPoint &SAEVRoute::getSubRequestOrigin(size_t baseRequestId, bool isEntry) {
if(isEntry)
return getEntrySubRequestOrigin(baseRequestId);
else
return getExitSubRequestOrigin(baseRequestId);
}
......@@ -231,6 +231,8 @@ public:
*/
std::string to_string(size_t vehicleId);
void exportToFile();
SAEVKeyPoint &getSubRequestOrigin(size_t baseRequestId, bool isEntry);
};
#include "propagation/SAEVRouteChangelist.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