Skip to content

Commit

Permalink
correct rescue lane usage for more than 2 lanes, refs #1967
Browse files Browse the repository at this point in the history
  • Loading branch information
lbieker committed Feb 21, 2018
1 parent 0ff14ba commit 9447476
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/microsim/devices/MSDevice_Bluelight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ MSDevice_Bluelight::~MSDevice_Bluelight() {

bool
MSDevice_Bluelight::notifyMove(SUMOVehicle& veh, double /* oldPos */,
double /* newPos */, double /* newSpeed */) {
//std::cout << "device '" << getID() << "' notifyMove: newSpeed=" << newSpeed << "\n";
double /* newPos */, double newSpeed ) {
std::cout << "device '" << getID() << "' notifyMove: newSpeed=" << newSpeed << "\n";
// check whether another device is present on the vehicle:
/*MSDevice_Tripinfo* otherDevice = static_cast<MSDevice_Tripinfo*>(veh.getDevice(typeid(MSDevice_Tripinfo)));
if (otherDevice != 0) {
Expand Down Expand Up @@ -145,13 +145,13 @@ MSDevice_Bluelight::notifyMove(SUMOVehicle& veh, double /* oldPos */,

//other vehicle should not use the rescue lane so they should not make any lane changes
lanechange.setLaneChangeMode(1605);

int numLanes= veh2->getEdge()->getLanes().size();
//Setting the lateral alignment to build a rescue lane
if (veh2->getLane()->getIndex() == 0) {
t.setPreferredLateralAlignment(LATALIGN_RIGHT);
if (veh2->getLane()->getIndex() == numLanes-1) {
t.setPreferredLateralAlignment(LATALIGN_LEFT);
//std::cout << "New alignment to right for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n";
} else {
t.setPreferredLateralAlignment(LATALIGN_LEFT);
t.setPreferredLateralAlignment(LATALIGN_RIGHT);
//std::cout << "New alignment to left for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n";
}
//influencedVehicles->push_back(static_cast<MSVehicle*>(veh2));
Expand Down
2 changes: 1 addition & 1 deletion src/microsim/devices/MSDevice_Bluelight.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class MSDevice_Bluelight : public MSDevice {

private:
// @brief collects all vehicle which had to react to the emergency vehicle
std::vector<MSVehicle*>* influencedVehicles;
//std::vector<MSVehicle*>* influencedVehicles;

/// @brief a value which is initialised based on a commandline/configuration option
double myCustomValue1;
Expand Down

0 comments on commit 9447476

Please sign in to comment.