50 #define BEST_LANE_LOOKAHEAD 3000.0
64 const std::string& streetName,
65 const std::string& edgeType,
68 Named(id), myNumericalID(numericalID), myLanes(nullptr),
69 myLaneChanger(nullptr), myFunction(function), myVaporizationRequests(0),
70 myLastFailedInsertionTime(-1),
71 myFromJunction(nullptr), myToJunction(nullptr),
72 myOtherTazConnector(nullptr),
73 myStreetName(streetName),
79 myEmptyTraveltime(0.),
82 myAmRoundabout(false),
96 myLanes = std::shared_ptr<const std::vector<MSLane*> >(lanes);
100 for (
MSLane*
const lane : *lanes) {
123 for (
const MSLink*
const link : l->getLinkCont()) {
124 SUMOTime linkPenalty = link->getMesoTLSPenalty() + (link->havePriority() ? 0 : edgeType.
minorPenalty);
125 if (minPenalty == -1) {
126 minPenalty = linkPenalty;
128 minPenalty =
MIN2(minPenalty, linkPenalty);
132 if (minPenalty > 0) {
137 const MSLink* link =
myLanes->front()->getIncomingLanes()[0].viaLink;
149 for (
MSLink*
const link : lane->getLinkCont()) {
150 link->initParallelLinks();
151 MSLane*
const toL = link->getLane();
152 MSLane*
const viaL = link->getViaLane();
153 if (toL !=
nullptr) {
166 if (viaL !=
nullptr) {
173 lane->checkBufferType();
218 const MSLink*
const link = lane->getLogicalPredecessorLane()->getLinkTo(lane);
219 assert(link !=
nullptr);
238 for (
auto& allowed : laneCont) {
240 allowed.first |= permissions;
244 laneCont.push_back(std::make_pair(permissions,
allowedLanes));
264 std::shared_ptr<std::vector<MSLane*> >
allowedLanes = std::make_shared<std::vector<MSLane*> >();
282 bool universalMap =
true;
283 std::shared_ptr<std::vector<MSLane*> > allLanes = std::make_shared<std::vector<MSLane*> >();
287 for (
const MSLink*
const link : lane->getLinkCont()) {
288 if (&link->getLane()->getEdge() == target) {
289 allLanes->push_back(lane);
290 combinedTargetPermissions |= link->getLane()->getPermissions();
293 if (combinedTargetPermissions == 0 || (lane->getPermissions() & combinedTargetPermissions) != lane->getPermissions()) {
294 universalMap =
false;
311 std::shared_ptr<std::vector<MSLane*> >
allowedLanes = std::make_shared<std::vector<MSLane*> >();
314 for (
const MSLink*
const link : lane->getLinkCont()) {
315 if (link->getLane()->allowsVehicleClass((
SUMOVehicleClass)vclass) && &link->getLane()->getEdge() == target && (link->getViaLane() ==
nullptr || link->getViaLane()->allowsVehicleClass((
SUMOVehicleClass)vclass))) {
326 if (updateVehicles) {
330 veh->updateBestLanes(
true);
332 lane->releaseVehicles();
354 const int resultIndex = lane->
getIndex() + offset;
355 if (resultIndex == (
int)
myLanes->size() && includeOpposite) {
357 }
else if (resultIndex >= (
int)
myLanes->size() || resultIndex < 0) {
360 return (*
myLanes)[resultIndex];
365 const std::vector<MSLane*>*
367 AllowedLanesByTarget::const_iterator i =
myAllowedTargets.find(&destination);
369 for (
const auto& allowed : i->second) {
370 if ((allowed.first & vclass) == vclass) {
371 return allowed.second.get();
379 const std::vector<MSLane*>*
386 if ((allowed.first & vclass) == vclass) {
387 return allowed.second.get();
413 if (allowed ==
nullptr) {
417 if (allowed !=
nullptr) {
418 double largestGap = 0;
419 MSLane* resByGap =
nullptr;
420 double leastOccupancy = std::numeric_limits<double>::max();
421 for (std::vector<MSLane*>::const_iterator i = allowed->begin(); i != allowed->end(); ++i) {
422 const double occupancy = (*i)->getBruttoOccupancy();
423 if (occupancy < leastOccupancy) {
425 leastOccupancy = occupancy;
427 const MSVehicle* last = (*i)->getLastFullVehicle();
429 if (lastGap > largestGap) {
430 largestGap = lastGap;
434 if (resByGap !=
nullptr) {
467 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
468 MSVehicle* last = (*i)->getLastFullVehicle();
469 if (last !=
nullptr) {
507 const std::vector<MSVehicle::LaneQ>& bl = veh.
getBestLanes();
508 double bestLength = -1;
509 for (std::vector<MSVehicle::LaneQ>::const_iterator i = bl.begin(); i != bl.end(); ++i) {
510 if ((*i).length > bestLength) {
511 bestLength = (*i).length;
517 double departPos = 0;
522 std::vector<MSLane*>* bestLanes =
new std::vector<MSLane*>();
523 for (std::vector<MSVehicle::LaneQ>::const_iterator i = bl.begin(); i != bl.end(); ++i) {
524 if (((*i).length - departPos) >= bestLength) {
525 bestLanes->push_back((*i).lane);
534 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
555 if (speedFactorParams[1] > 0.) {
578 const std::string errorMsg =
"Departure speed for vehicle '" + pars.
id +
"' is too high for the departure edge '" +
getID() +
"'.";
599 v.
getID() +
"'. Inserting at lane end instead.");
615 while (segment !=
nullptr && !result) {
617 result = segment->
hasSpaceFor(veh, time, qIdx,
true) == time;
625 result = segment->
hasSpaceFor(veh, time, qIdx,
true) == time;
638 if (insertionLane ==
nullptr) {
646 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
647 const double occupancy = (*i)->getBruttoOccupancy();
656 if (insertionLane ==
nullptr) {
693 for (
const MSLink*
const link : l->getLinkCont()) {
694 if (&link->getLane()->getEdge() == followerAfterInternal) {
695 if (link->getViaLane() !=
nullptr) {
696 return &link->getViaLane()->getEdge();
709 assert(followerAfterInternal != 0);
714 while (edge !=
nullptr && edge->
isInternal()) {
724 const MSEdge* result =
this;
734 const MSEdge* result =
this;
748 const int vehNo = segment->getCarNumber();
750 v += vehNo * segment->getMeanSpeed();
758 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
759 const double vehNo = (double)(*i)->getVehicleNumber();
760 v += vehNo * (*i)->getMeanSpeed();
765 if (lane->getVehicleNumber() > 0) {
786 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
787 const double vehNo = (double)(*i)->getVehicleNumber();
788 v += vehNo * (*i)->getMeanSpeedBike();
799 assert(minSpeed > 0);
815 DictType::iterator it =
myDict.find(
id);
831 DictType::iterator it =
myDict.find(
id);
842 return (
int)
myDict.size();
854 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); ++i) {
864 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); ++i) {
865 into.push_back((*i).first);
872 const std::string& rid) {
880 const std::string& rid) {
881 for (std::vector<std::string>::const_iterator i = desc.begin(); i != desc.end(); ++i) {
884 if (edge ==
nullptr) {
885 throw ProcessError(
"The edge '" + *i +
"' within the route " + rid +
" is not known."
886 +
"\n The route can not be build.");
888 into.push_back(edge);
895 assert(
this != other);
896 if (doBoundaryEstimate) {
908 return getLanes()[0]->getShape()[-1].distanceTo2D(other->
getLanes()[0]->getShape()[0]);
927 return myLanes->empty() ? 1 :
getLanes()[0]->getLengthGeometryFactor();
940 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
941 (*i)->setMaxSpeed(val);
954 std::set<MSTransportable*>::iterator i =
myPersons.find(p);
960 std::vector<MSTransportable*>
964 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
966 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
967 const std::vector<MSTransportable*>& persons = (*j)->getPersons();
968 result.insert(result.end(), persons.begin(), persons.end());
970 (*i)->releaseVehicles();
978 std::vector<MSTransportable*>
1027 if ((*it)->isTazConnector()) {
1028 i->second.push_back(*it);
1030 const std::vector<MSLane*>* allowed =
allowedLanes(**it, vClass);
1031 if (allowed !=
nullptr && allowed->size() > 0) {
1032 i->second.push_back(*it);
1059 if (viaPair.first->isTazConnector()) {
1060 result.push_back(viaPair);
1062 const std::vector<MSLane*>* allowed =
allowedLanes(*viaPair.first, vClass);
1063 if (allowed !=
nullptr && allowed->size() > 0) {
1064 result.push_back(viaPair);
1085 return (!
myLanes->empty() &&
myLanes->back()->getOpposite() !=
nullptr &&
1093 if (!
myLanes->empty() &&
myLanes->back()->getOpposite() !=
nullptr) {
1094 return &(
myLanes->back()->getOpposite()->getEdge());
1104 for (
const MSLink*
const link : l->getLinkCont()) {
1105 if (!link->havePriority()) {
1119 WRITE_ERROR(
"Bidi-edge '" + bidiID +
"' does not exist");
1127 for (ConstMSEdgeVector::const_iterator it = candidates.begin(); it != candidates.end(); it++) {
1141 if (other ==
nullptr || other->
getLanes().size() !=
myLanes->size()) {
1144 std::vector<MSLane*>::const_iterator it1 =
myLanes->begin();
1145 std::vector<MSLane*>::const_reverse_iterator it2 = other->
getLanes().rbegin();
1147 if ((*it1)->getShape().reverse() != (*it2)->getShape()) {
1152 }
while (it1 !=
myLanes->end());
1172 std::vector<SUMOVehicle*>::iterator it = std::find(
myWaiting.begin(),
myWaiting.end(), vehicle);
1187 (!vehicle->hasDeparted() &&
1192 if (!vehicle->isLineStop(position) && vehicle->allowsBoarding(transportable)) {
1194 + transportable->
getID() +
"' at edge '" +
getID() +
"' position " +
toString(position) +
" cannot use waiting vehicle '"
1195 + vehicle->getID() +
"' at position " +
toString(vehicle->getPositionOnLane()) +
" because it is too far away.");
1202 std::vector<const SUMOVehicle*>
1204 std::vector<const SUMOVehicle*> result;
1207 std::vector<const MEVehicle*> segmentVehs = segment->getVehicles();
1208 result.insert(result.end(), segmentVehs.begin(), segmentVehs.end());
1212 for (
auto veh : lane->getVehiclesSecure()) {
1213 result.push_back(veh);
1215 lane->releaseVehicles();
1233 wtime += segment->getWaitingSeconds();
1237 wtime += lane->getWaitingSeconds();
1256 sum += lane->getNettoOccupancy();
1267 flow += (double) segment->getCarNumber() * segment->getMeanSpeed();
1269 return 3600 * flow / (*myLanes)[0]->getLength();
1277 occ += segment->getBruttoOccupancy();
1279 return occ / (*myLanes)[0]->getLength() / (double)(
myLanes->size());
#define BEST_LANE_LOOKAHEAD
std::vector< const MSEdge * > ConstMSEdgeVector
std::vector< std::pair< const MSEdge *, const MSEdge * > > MSConstEdgePairVector
std::vector< MSEdge * > MSEdgeVector
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
const SVCPermissions SVCAll
all VClasses are allowed
const SUMOVehicleClass SUMOVehicleClass_MAX
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PRIVATE
private vehicles
@ SVC_IGNORING
vehicles ignoring classes
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ RANDOM
The lane is chosen randomly.
@ BEST_FREE
The least occupied lane from best lanes.
@ GIVEN
The lane is given.
@ ALLOWED_FREE
The least occupied lane from lanes which allow the continuation.
@ DEFAULT
No information given; use default.
@ FIRST_ALLOWED
The rightmost lane the vehicle may use.
@ FREE
The least occupied lane is used.
@ RANDOM
The position is chosen randomly.
@ GIVEN
The position is given.
@ DEFAULT
No information given; use default.
@ FREE
A free position is chosen.
@ BASE
Back-at-zero position.
@ LAST
Insert behind the last vehicle as close as possible to still allow the specified departSpeed....
@ RANDOM_FREE
If a fixed number of random choices fails, a free position is chosen.
@ GIVEN
The speed is given.
@ DEPART_CONTAINER_TRIGGERED
The departure is container triggered.
@ DEPART_TRIGGERED
The departure is person triggered.
@ TURN
The link is a 180 degree turn.
@ STRAIGHT
The link is a straight direction.
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_ALLWAY_STOP
This is an uncontrolled, all-way stop link.
@ LINKSTATE_STOP
This is an uncontrolled, minor link, has to stop.
@ LINKSTATE_EQUAL
This is an uncontrolled, right-before-left link.
@ LINKSTATE_DEADEND
This is a dead end link.
@ LINKSTATE_MINOR
This is an uncontrolled, minor link, has to brake.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double distanceTo2D(const Position &p) const
returns the euclidean distance in the x-y-plane
std::vector< double > & getParameter()
Returns the parameters of this distribution.
A scoped lock which only triggers on condition.
void updateSegementsForEdge(const MSEdge &e)
Update segments after loading meso edge type parameters from additional file.
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
void buildSegmentsFor(const MSEdge &e, const OptionsCont &oc)
Build the segments for a given edge.
A single mesoscopic segment (cell)
bool initialise(MEVehicle *veh, SUMOTime time)
Inserts (emits) vehicle into the segment.
SUMOTime hasSpaceFor(const MEVehicle *const veh, const SUMOTime entryTime, int &qIdx, const bool init=false) const
Returns whether the given vehicle would still fit into the segment.
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
A vehicle from the mesoscopic point of view.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
double getLength() const
Returns the vehicle's length.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
const MSRoute & getRoute() const
Returns the current route.
Sorts edges by their ids.
Sorts transportables by their positions.
int operator()(const MSTransportable *const c1, const MSTransportable *const c2) const
comparing operator
A road/street connecting two junctions.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
SUMOVehicle * getWaitingVehicle(MSTransportable *transportable, const double position) const
void addToAllowed(const SVCPermissions permissions, std::shared_ptr< const std::vector< MSLane * > > allowedLanes, AllowedLanesCont &laneCont) const
void changeLanes(SUMOTime t) const
Performs lane changing on this edge.
double getBruttoOccupancy() const
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
double getFlow() const
return flow based on meanSpead
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
double myWidth
Edge width [m].
AllowedLanesByTarget myAllowedTargets
From target edge to lanes allowed to be used to reach it.
MSLane * getDepartLane(MSVehicle &veh) const
Finds a depart lane for the given vehicle parameters.
SUMOTime myLastFailedInsertionTime
The time of last insertion failure.
static void clear()
Clears the dictionary.
bool canChangeToOpposite()
whether this edge allows changing to the opposite direction edge
void setJunctions(MSJunction *from, MSJunction *to)
double getMeanSpeedBike() const
get the mean speed of all bicycles on this edge
static MSEdgeVector myEdges
Static list of edges.
AllowedLanesCont myAllowed
Associative container from vehicle class to allowed-lanes.
const MSEdgeVector & getPredecessors() const
double myEmptyTraveltime
the traveltime on the empty edge (cached value for speedup)
void updateMesoType()
update meso segment parameters
bool myAmFringe
whether this edge is at the network fringe
static double getTravelTimeAggregated(const MSEdge *const edge, const SUMOVehicle *const veh, double time)
MSJunction * myToJunction
void checkAndRegisterBiDirEdge(const std::string &bidiID="")
check and register the opposite superposable edge if any
static int dictSize()
Returns the number of edges.
virtual ~MSEdge()
Destructor.
double getDepartPosBound(const MSVehicle &veh, bool upper=true) const
return upper bound for the depart position on this edge
const MSEdge * myBidiEdge
the oppositing superposable edge
MSLane * leftLane(const MSLane *const lane) const
Returns the lane left to the one given, 0 if the given lane is leftmost.
const MSEdge * getInternalFollowingEdge(const MSEdge *followerAfterInternal) const
const MSEdge * getOppositeEdge() const
Returns the opposite direction edge if on exists else a nullptr.
static void parseEdgesList(const std::string &desc, ConstMSEdgeVector &into, const std::string &rid)
Parses the given string assuming it contains a list of edge ids divided by spaces.
double getLengthGeometryFactor() const
return shape.length() / myLength
void addSuccessor(MSEdge *edge, const MSEdge *via=nullptr)
Adds an edge to the list of edges which may be reached from this edge and to the incoming of the othe...
std::vector< SUMOVehicle * > myWaiting
List of waiting vehicles.
const MSEdge * getNormalSuccessor() const
if this edge is an internal edge, return its first normal successor, otherwise the edge itself
virtual void addPerson(MSTransportable *p) const
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's persons sorted by pos.
bool isSuperposable(const MSEdge *other)
bool validateDepartSpeed(SUMOVehicle &v) const
check whether the given departSpeed is valid for this edge
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING) const
Get the allowed lanes to reach the destination-edge.
double getDistanceTo(const MSEdge *other, const bool doBoundaryEstimate=false) const
optimistic air distance heuristic for use in routing
const MSConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges with internal vias, restricted by vClass.
MSLaneChanger * myLaneChanger
This member will do the lane-change.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getOccupancy() const
return mean occupancy on this edges lanes or segments
std::vector< MSTransportable * > getSortedContainers(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's containers sorted by pos.
const SumoXMLEdgeFunc myFunction
the purpose of the edge
std::set< MSTransportable * > myContainers
Containers on the edge.
void recalcCache()
Recalculates the cached values.
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is retured; should pro...
const MSJunction * getFromJunction() const
bool myAmDelayed
whether this edge had a vehicle with less than max speed on it
std::map< SUMOVehicleClass, MSEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
MSEdgeVector myPredecessors
The preceeding edges.
void rebuildAllowedTargets(const bool updateVehicles=true)
std::vector< std::pair< SVCPermissions, std::shared_ptr< const std::vector< MSLane * > > > > AllowedLanesCont
"Map" from vehicle class to allowed lanes
void rebuildAllowedLanes()
double getLength() const
return the length of the edge
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
virtual void closeBuilding()
std::set< int > myFailedInsertionMemory
A cache for the rejected insertion attempts. Used to assure that no further insertion attempts are ma...
double getMeanSpeed() const
get the mean speed
static DictType myDict
Static dictionary to associate string-ids with objects.
bool isTazConnector() const
MSConstEdgePairVector myViaSuccessors
MSEdgeVector mySuccessors
The succeeding edges.
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
bool isInternal() const
return whether this edge is an internal edge
MSLane * rightLane(const MSLane *const lane) const
Returns the lane right to the one given, 0 if the given lane is rightmost.
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
int getNumericalID() const
Returns the numerical id of the edge.
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
bool insertVehicle(SUMOVehicle &v, SUMOTime time, const bool checkOnly=false, const bool forceCheck=false) const
Tries to insert the given vehicle into the network.
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
void addWaiting(SUMOVehicle *vehicle) const
Adds a vehicle to the list of waiting vehicles.
MSLane * parallelLane(const MSLane *const lane, int offset, bool includeOpposite=true) const
Returns the lane with the given offset parallel to the given lane one or 0 if it does not exist.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
std::vector< const SUMOVehicle * > getVehicles() const
return vehicles on this edges lanes or segments
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
MSJunction * myFromJunction
the junctions for this edge
std::map< std::string, MSEdge * > DictType
definition of the static dictionary type
bool hasMinorLink() const
whether any lane has a minor link
std::map< SUMOVehicleClass, MSConstEdgePairVector > myClassesViaSuccessorMap
The successors available for a given vClass.
const MSEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
int getVehicleNumber() const
return total number of vehicles on this edges lanes or segments
const std::string & getEdgeType() const
Returns the type of the edge.
double getInternalFollowingLengthTo(const MSEdge *followerAfterInternal) const
returns the length of all internal edges on the junction until reaching the non-internal edge followe...
const MSJunction * getToJunction() const
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
bool allowsLaneChanging() const
void setMaxSpeed(double val) const
Sets a new maximum speed for all lanes (used by TraCI and MSCalibrator)
MSEdge(const std::string &id, int numericalID, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, double distance)
Constructor.
void buildLaneChanger()
Has to be called after all sucessors and predecessors have been set (after closeBuilding())
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
virtual void lock() const
grant exclusive access to the mesoscopic state
void removeWaiting(const SUMOVehicle *vehicle) const
Removes a vehicle from the list of waiting vehicles.
std::vector< double > mySublaneSides
the right side for each sublane on this edge
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
std::shared_ptr< const std::vector< MSLane * > > myLanes
Container for the edge's lane; should be sorted: (right-hand-traffic) the more left the lane,...
double getWaitingSeconds() const
return accumated waiting time for all vehicles on this edges lanes or segments
int myVaporizationRequests
Vaporizer counter.
double myTimePenalty
flat penalty when computing traveltime
SVCPermissions myMinimumPermissions
The intersection of lane permissions for this edge.
MSLane * getFreeLane(const std::vector< MSLane * > *allowed, const SUMOVehicleClass vclass, double departPos) const
Finds the emptiest lane allowing the vehicle class.
virtual void removePerson(MSTransportable *p) const
double myLength
the length of the edge (cached value for speedup)
static double gStopTolerance
The tolerance to apply when matching waiting persons and vehicles.
static double gMinorPenalty
time penalty for passing a minor link when routing
static MELoop * gMesoNet
mesoscopic simulation infrastructure
static double gLateralResolution
static int gNumSimThreads
how many threads to use for simulation
static SUMOTime gLaneChangeDuration
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
static int gNumThreads
how many threads to use
The base class for an intersection.
const ConstMSEdgeVector & getOutgoing() const
const Position & getPosition() const
Performs lane changing of vehicles.
void laneChange(SUMOTime t)
Start lane-change-process for all vehicles on the edge'e lanes.
Performs lane changing of vehicles.
Representation of a lane in the micro simulation.
bool insertVehicle(MSVehicle &v)
Tries to insert the given vehicle.
std::vector< MSVehicle * > VehCont
Container for vehicles.
int getIndex() const
Returns the lane's index.
double getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
MSEdge & getEdge() const
Returns the lane's edge.
MSLane * getOpposite() const
return the opposite direction lane for lane changing or 0
LinkState getState() const
Returns the current state of the link.
bool isTLSControlled() const
bool havePriority() const
Returns whether this link is a major link.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const MesoEdgeType & getMesoType(const std::string &typeID)
Returns edge type specific meso parameters if no type specific parameters have been loaded,...
int size() const
Returns the number of edges to pass.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
static double getAssumedSpeed(const MSEdge *edge, const SUMOVehicle *veh)
return current travel speed assumption
virtual double getEdgePos(SUMOTime now) const
bool isPerson() const
Whether it is a person.
MSStage * getCurrentStage() const
Return the current stage.
bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle in the current step.
Representation of a vehicle in the micro simulation.
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
double getPositionOnLane() const
Get the vehicle's position along the lane.
The car-following model and parameter.
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
double computeChosenSpeedDeviation(std::mt19937 *rng, const double minDev=-1.) const
Computes and returns the speed deviation.
double getLength() const
Get vehicle's length [m].
Base class for objects which have an id.
const std::string & getID() const
Returns the id.
static OptionsCont & getOptions()
Retrieves the options.
A point in 2D or 3D with translation and scaling methods.
static double rand(std::mt19937 *rng=nullptr)
Returns a random real number in [0, 1)
static const T & getRandomFrom(const std::vector< T > &v, std::mt19937 *rng=0)
Returns a random element from the given vector.
Representation of a vehicle, person, or container.
virtual double getChosenSpeedFactor() const =0
virtual double getMaxSpeed() const =0
Returns the object's maximum speed.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
Representation of a vehicle.
virtual void setChosenSpeedFactor(const double factor)=0
virtual int getRouteValidity(bool update=true, bool silent=false)=0
computes validity attributes for the current route
Definition of vehicle stop (position and duration)
std::string lane
The lane to stop at.
double startPos
The stopping position start.
double endPos
The stopping position end.
Structure representing possible vehicle parameter.
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
double departSpeed
(optional) The initial speed of the vehicle
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
double departPos
(optional) The position the vehicle shall depart from
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
std::string id
The vehicle's id.
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
std::vector< std::string > getVector()
return vector of strings
edge type specific meso parameters