Definition in file MSLane.cpp.
#include <config.h>
#include <utils/common/UtilExceptions.h>
#include <utils/common/StdDefs.h>
#include "MSVehicle.h"
#include "MSVehicleType.h"
#include "MSEdge.h"
#include "MSJunction.h"
#include "MSLogicJunction.h"
#include "MSLink.h"
#include "MSLane.h"
#include "MSVehicleTransfer.h"
#include "MSGlobals.h"
#include "MSVehicleControl.h"
#include <cmath>
#include <bitset>
#include <iostream>
#include <cassert>
#include <functional>
#include <algorithm>
#include <iterator>
#include <exception>
#include <climits>
#include <set>
#include <utils/common/MsgHandler.h>
#include <utils/common/ToString.h>
#include <utils/options/OptionsCont.h>
#include <utils/common/HelpersHarmonoise.h>
Go to the source code of this file.
Data Structures | |
| class | by_second_sorter |
Functions | |
| SUMOReal | getMaxSpeedRegardingNextLanes (MSVehicle &veh, SUMOReal speed, SUMOReal pos) |
| SUMOReal getMaxSpeedRegardingNextLanes | ( | MSVehicle & | veh, | |
| SUMOReal | speed, | |||
| SUMOReal | pos | |||
| ) |
Definition at line 525 of file MSLane.cpp.
References MSRoute::begin(), MSCFModel::brakeGap(), MSRoute::end(), MSCFModel::ffeV(), MSVehicle::getCarFollowModel(), MSLane::getLength(), MSLane::getMaxSpeed(), MSVehicle::getRoute(), MIN2(), SPEED2DIST, and SUMOReal.
00525 { 00526 MSRouteIterator next = veh.getRoute().begin(); 00527 const MSCFModel &cfModel = veh.getCarFollowModel(); 00528 MSLane *currentLane = (*next)->getLanes()[0]; 00529 SUMOReal seen = currentLane->getLength() - pos; 00530 SUMOReal dist = SPEED2DIST(speed) + cfModel.brakeGap(speed); 00531 SUMOReal tspeed = speed; 00532 while (seen<dist&&next!=veh.getRoute().end()-1) { 00533 ++next; 00534 MSLane *nextLane = (*next)->getLanes()[0]; 00535 tspeed = MIN2(cfModel.ffeV(&veh, tspeed, seen, nextLane->getMaxSpeed()), nextLane->getMaxSpeed()); 00536 dist = SPEED2DIST(tspeed) + cfModel.brakeGap(tspeed); 00537 seen += nextLane->getMaxSpeed(); 00538 } 00539 return tspeed; 00540 }
1.5.6