 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
51 #define BEST_LANE_LOOKAHEAD 3000.0
65 const std::string& streetName,
66 const std::string& edgeType,
69 Named(id), myNumericalID(numericalID), myLanes(nullptr),
70 myLaneChanger(nullptr), myFunction(function), myVaporizationRequests(0),
71 myLastFailedInsertionTime(-1),
72 myFromJunction(nullptr), myToJunction(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) {
121 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
124 for (MSLinkCont::const_iterator j = lc.begin(); j != lc.end(); ++j) {
127 if (minPenalty == -1) {
128 minPenalty = linkPenalty;
130 minPenalty =
MIN2(minPenalty, linkPenalty);
134 if (minPenalty > 0) {
138 const MSLink* link =
myLanes->front()->getIncomingLanes()[0].viaLink;
150 for (
MSLink*
const link : lane->getLinkCont()) {
151 link->initParallelLinks();
152 MSLane*
const toL = link->getLane();
153 MSLane*
const viaL = link->getViaLane();
154 if (toL !=
nullptr) {
167 if (viaL !=
nullptr) {
174 lane->checkBufferType();
209 for (std::vector<MSLane*>::const_iterator it =
myLanes->begin(); it !=
myLanes->end(); ++it) {
231 for (
auto& allowed : laneCont) {
233 allowed.first |= permissions;
237 laneCont.push_back(std::make_pair(permissions,
allowedLanes));
257 std::shared_ptr<std::vector<MSLane*> >
allowedLanes = std::make_shared<std::vector<MSLane*> >();
275 bool universalMap =
true;
276 std::shared_ptr<std::vector<MSLane*> > allLanes = std::make_shared<std::vector<MSLane*> >();
280 for (
const MSLink*
const link : lane->getLinkCont()) {
281 if (&link->getLane()->getEdge() == target) {
282 allLanes->push_back(lane);
283 combinedTargetPermissions |= link->getLane()->getPermissions();
286 if (combinedTargetPermissions == 0 || (lane->getPermissions() & combinedTargetPermissions) != lane->getPermissions()) {
287 universalMap =
false;
304 std::shared_ptr<std::vector<MSLane*> >
allowedLanes = std::make_shared<std::vector<MSLane*> >();
307 for (
const MSLink*
const link : lane->getLinkCont()) {
308 if (link->getLane()->allowsVehicleClass((
SUMOVehicleClass)vclass) && &link->getLane()->getEdge() == target && (link->getViaLane() ==
nullptr || link->getViaLane()->allowsVehicleClass((
SUMOVehicleClass)vclass))) {
319 if (updateVehicles) {
323 veh->updateBestLanes(
true);
325 lane->releaseVehicles();
347 const int resultIndex = lane->
getIndex() + offset;
348 if (resultIndex == (
int)
myLanes->size() && includeOpposite) {
350 }
else if (resultIndex >= (
int)
myLanes->size() || resultIndex < 0) {
353 return (*
myLanes)[resultIndex];
358 const std::vector<MSLane*>*
360 AllowedLanesByTarget::const_iterator i =
myAllowedTargets.find(&destination);
362 for (
const auto& allowed : i->second) {
363 if ((allowed.first & vclass) == vclass) {
364 return allowed.second.get();
372 const std::vector<MSLane*>*
379 if ((allowed.first & vclass) == vclass) {
380 return allowed.second.get();
406 if (allowed ==
nullptr) {
410 if (allowed !=
nullptr) {
411 double largestGap = 0;
412 MSLane* resByGap =
nullptr;
413 double leastOccupancy = std::numeric_limits<double>::max();
414 for (std::vector<MSLane*>::const_iterator i = allowed->begin(); i != allowed->end(); ++i) {
415 const double occupancy = (*i)->getBruttoOccupancy();
416 if (occupancy < leastOccupancy) {
418 leastOccupancy = occupancy;
420 const MSVehicle* last = (*i)->getLastFullVehicle();
422 if (lastGap > largestGap) {
423 largestGap = lastGap;
427 if (resByGap !=
nullptr) {
460 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
461 MSVehicle* last = (*i)->getLastFullVehicle();
462 if (last !=
nullptr) {
500 const std::vector<MSVehicle::LaneQ>& bl = veh.
getBestLanes();
501 double bestLength = -1;
502 for (std::vector<MSVehicle::LaneQ>::const_iterator i = bl.begin(); i != bl.end(); ++i) {
503 if ((*i).length > bestLength) {
504 bestLength = (*i).length;
510 double departPos = 0;
515 std::vector<MSLane*>* bestLanes =
new std::vector<MSLane*>();
516 for (std::vector<MSVehicle::LaneQ>::const_iterator i = bl.begin(); i != bl.end(); ++i) {
517 if (((*i).length - departPos) >= bestLength) {
518 bestLanes->push_back((*i).lane);
527 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
553 if (speedFactorParams[1] > 0.) {
561 "' is too high for the departure edge '" +
getID() +
"'.");
578 v.
getID() +
"'. Inserting at lane end instead.");
593 while (segment !=
nullptr && !result) {
616 if (insertionLane ==
nullptr) {
624 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
625 const double occupancy = (*i)->getBruttoOccupancy();
634 if (insertionLane ==
nullptr) {
672 for (
const MSLink*
const link : l->getLinkCont()) {
673 if (&link->getLane()->getEdge() == followerAfterInternal) {
674 if (link->getViaLane() !=
nullptr) {
675 return &link->getViaLane()->getEdge();
688 assert(followerAfterInternal != 0);
693 while (edge !=
nullptr && edge->
isInternal()) {
703 const MSEdge* result =
this;
717 const int vehNo = segment->getCarNumber();
719 v += vehNo * segment->getMeanSpeed();
727 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
728 const double vehNo = (double)(*i)->getVehicleNumber();
729 v += vehNo * (*i)->getMeanSpeed();
734 if (lane->getVehicleNumber() > 0) {
750 assert(minSpeed > 0);
766 DictType::iterator it =
myDict.find(
id);
782 DictType::iterator it =
myDict.find(
id);
793 return (
int)
myDict.size();
805 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); ++i) {
815 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); ++i) {
816 into.push_back((*i).first);
823 const std::string& rid) {
825 std::istringstream in(desc, std::ios::binary);
838 const std::string& rid) {
839 for (std::vector<std::string>::const_iterator i = desc.begin(); i != desc.end(); ++i) {
842 if (edge ==
nullptr) {
843 throw ProcessError(
"The edge '" + *i +
"' within the route " + rid +
" is not known."
844 +
"\n The route can not be build.");
846 into.push_back(edge);
853 assert(
this != other);
854 if (doBoundaryEstimate) {
866 return getLanes()[0]->getShape()[-1].distanceTo2D(other->
getLanes()[0]->getShape()[0]);
885 return myLanes->empty() ? 1 :
getLanes()[0]->getLengthGeometryFactor();
898 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
899 (*i)->setMaxSpeed(val);
906 std::vector<MSTransportable*>
910 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
912 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
913 const std::vector<MSTransportable*>& persons = (*j)->getPersons();
914 result.insert(result.end(), persons.begin(), persons.end());
916 (*i)->releaseVehicles();
924 std::vector<MSTransportable*>
973 if ((*it)->isTazConnector()) {
974 i->second.push_back(*it);
976 const std::vector<MSLane*>* allowed =
allowedLanes(**it, vClass);
977 if (allowed !=
nullptr && allowed->size() > 0) {
978 i->second.push_back(*it);
1005 if (viaPair.first->isTazConnector()) {
1006 result.push_back(viaPair);
1008 const std::vector<MSLane*>* allowed =
allowedLanes(*viaPair.first, vClass);
1009 if (allowed !=
nullptr && allowed->size() > 0) {
1010 result.push_back(viaPair);
1031 return (!
myLanes->empty() &&
myLanes->back()->getOpposite() !=
nullptr &&
1039 if (!
myLanes->empty() &&
myLanes->back()->getOpposite() !=
nullptr) {
1040 return &(
myLanes->back()->getOpposite()->getEdge());
1049 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
1051 for (MSLinkCont::const_iterator j = lc.begin(); j != lc.end(); ++j) {
1052 if (!(*j)->havePriority()) {
1066 WRITE_ERROR(
"Bidi-edge '" + bidiID +
"' does not exist");
1074 for (ConstMSEdgeVector::const_iterator it = candidates.begin(); it != candidates.end(); it++) {
1088 if (other ==
nullptr || other->
getLanes().size() !=
myLanes->size()) {
1091 std::vector<MSLane*>::const_iterator it1 =
myLanes->begin();
1092 std::vector<MSLane*>::const_reverse_iterator it2 = other->
getLanes().rbegin();
1094 if ((*it1)->getShape().reverse() != (*it2)->getShape()) {
1099 }
while (it1 !=
myLanes->end());
1119 std::vector<SUMOVehicle*>::iterator it = std::find(
myWaiting.begin(),
myWaiting.end(), vehicle);
1134 (!vehicle->hasDeparted() &&
1141 + vehicle->getID() +
"' at position " +
toString(vehicle->getPositionOnLane()) +
" because it is too far away.");
MSJunction * myFromJunction
the junctions for this edge
bool canChangeToOpposite()
whether this edge allows changing to the opposite direction edge
The car-following model and parameter.
Sorts edges by their ids.
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
A vehicle from the mesoscopic point of view.
Representation of a vehicle or person.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const MSConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges with internal vias, restricted by vClass.
bool havePriority() const
Returns whether this link is a major link.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
bool hasMinorLink() const
whether any lane has a minor link
static DictType myDict
Static dictionary to associate string-ids with objects.
@ LINKSTATE_EQUAL
This is an uncontrolled, right-before-left link.
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
LinkState getState() const
Returns the current state of the link.
std::vector< std::pair< const MSEdge *, const MSEdge * > > MSConstEdgePairVector
int getNumericalID() const
Returns the numerical id of the edge.
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is retured; should pro...
#define WRITE_WARNING(msg)
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
virtual void setChosenSpeedFactor(const double factor)=0
Representation of a lane in the micro simulation.
Base class for objects which have an id.
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
void addWaiting(SUMOVehicle *vehicle) const
Adds a vehicle to the list of waiting vehicles.
std::string lane
The lane to stop at.
Performs lane changing of vehicles.
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's persons sorted by pos.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
A single mesoscopic segment (cell)
The base class for an intersection.
const MSEdge * getOppositeEdge() const
Returns the opposite direction edge if on exists else a nullptr.
double distanceTo2D(const Position &p) const
returns the euclidean distance in the x-y-plane
void checkAndRegisterBiDirEdge(const std::string &bidiID="")
check and register the opposite superposable edge if any
SVCPermissions myMinimumPermissions
The intersection of lane permissions for this edge.
MSEdgeVector myPredecessors
The preceeding edges.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
double departSpeed
(optional) The initial speed of the vehicle
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
static double gMinorPenalty
time penalty for passing a minor link when routing
SUMOTime myLastFailedInsertionTime
The time of last insertion failure.
virtual const std::string & getID() const =0
Get the vehicle's ID.
std::map< SUMOVehicleClass, MSEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
std::map< std::string, MSEdge * > DictType
definition of the static dictionary type
MSJunction * myToJunction
MSLaneChanger * myLaneChanger
This member will do the lane-change.
static MSLink * getConnectingLink(const MSLane &from, const MSLane &to)
Returns the link connecting both lanes Both lanes have to be non-internal; 0 may be returned if no co...
double getDepartPosBound(const MSVehicle &veh, bool upper=true) const
return upper bound for the depart position on this edge
static MSEdgeVector myEdges
Static list of edges.
bool initialise(MEVehicle *veh, SUMOTime time)
Inserts (emits) vehicle into the segment.
@ DEPART_POS_DEFAULT
No information given; use default.
double myLength
the length of the edge (cached value for speedup)
static int gNumSimThreads
how many threads to use for simulation
bool hasSpaceFor(const MEVehicle *veh, SUMOTime entryTime, bool init=false) const
Returns whether the given vehicle would still fit into the segment.
@ DEPART_LANE_BEST_FREE
The least occupied lane from best lanes.
std::vector< double > mySublaneSides
the right side for each sublane on this edge
bool myAmFringe
whether this edge is at the network fringe
@ DEPART_POS_LAST
Insert behind the last vehicle as close as possible to still allow the specified departSpeed....
Representation of a vehicle.
std::vector< MSVehicle * > VehCont
Container for vehicles.
static double getAssumedSpeed(const MSEdge *edge)
return current travel speed assumption
const MSRoute & getRoute() const
Returns the current route.
std::vector< const MSEdge * > ConstMSEdgeVector
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
virtual ~MSEdge()
Destructor.
static OptionsCont & getOptions()
Retrieves the options.
void recalcCache()
Recalculates the cached values.
std::vector< std::pair< SVCPermissions, std::shared_ptr< const std::vector< MSLane * > > > > AllowedLanesCont
"Map" from vehicle class to allowed lanes
void rebuildAllowedTargets(const bool updateVehicles=true)
void setJunctions(MSJunction *from, MSJunction *to)
virtual double getEdgePos(SUMOTime now) const
Structure representing possible vehicle parameter.
double getDistanceTo(const MSEdge *other, const bool doBoundaryEstimate=false) const
optimistic air distance heuristic for use in routing
Performs lane changing of vehicles.
double getLength() const
return the length of the edge
bool isTLSControlled() const
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
double getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
static int dictSize()
Returns the number of edges.
static double gLateralResolution
const ConstMSEdgeVector & getOutgoing() const
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,...
@ SVC_PRIVATE
private vehicles
@ DEPART_LANE_ALLOWED_FREE
The least occupied lane from lanes which allow the continuation.
bool isInternal() const
return whether this edge is an internal edge
virtual double getChosenSpeedFactor() const =0
double getLengthGeometryFactor() const
return shape.length() / myLength
static int gNumThreads
how many threads to use
MSLane * leftLane(const MSLane *const lane) const
Returns the lane left to the one given, 0 if the given lane is leftmost.
@ LINKDIR_TURN
The link is a 180 degree turn.
int size() const
Returns the number of edges to pass.
const MSJunction * getFromJunction() const
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
@ LINKDIR_STRAIGHT
The link is a straight direction.
@ DEPART_LANE_RANDOM
The lane is chosen randomly.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
double computeChosenSpeedDeviation(std::mt19937 *rng, const double minDev=-1.) const
Computes and returns the speed deviation.
static double gMesoTLSPenalty
double getPositionOnLane() const
Get the vehicle's position along the lane.
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
double getMeanSpeed() const
get the mean speed
@ DEPART_POS_FREE
A free position is chosen.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
static SUMOTime gMesoMinorPenalty
@ DEPART_SPEED_GIVEN
The speed is given.
bool isTazConnector() const
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....
@ DEPART_LANE_GIVEN
The lane is given.
static void clear()
Clears the dictionary.
A scoped lock which only triggers on condition.
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
bool insertVehicle(MSVehicle &v)
Tries to insert the given vehicle.
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
std::string id
The vehicle's id.
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
MSConstEdgePairVector myViaSuccessors
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
std::vector< SUMOVehicle * > myWaiting
List of waiting vehicles.
AllowedLanesByTarget myAllowedTargets
From target edge to lanes allowed to be used to reach it.
A point in 2D or 3D with translation and scaling methods.
static void readEdgeVector(std::istream &in, std::vector< const E * > &edges, const std::string &rid)
Reads an edge vector binary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
std::string time2string(SUMOTime t)
static const T & getRandomFrom(const std::vector< T > &v, std::mt19937 *rng=0)
Returns a random element from the given vector.
@ LINKSTATE_DEADEND
This is a dead end link.
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
A road/street connecting two junctions.
@ DEPART_TRIGGERED
The departure is person triggered.
double endPos
The stopping position end.
SUMOVehicle * getWaitingVehicle(MSTransportable *transportable, const double position) const
const MSJunction * getToJunction() const
MSLane * rightLane(const MSLane *const lane) const
Returns the lane right to the one given, 0 if the given lane is rightmost.
@ DEPART_POS_RANDOM
The position is chosen randomly.
@ LINKSTATE_MINOR
This is an uncontrolled, minor link, has to brake.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
const MSEdge * getInternalFollowingEdge(const MSEdge *followerAfterInternal) const
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING) const
Get the allowed lanes to reach the destination-edge.
MSLane * getDepartLane(MSVehicle &veh) const
Finds a depart lane for the given vehicle parameters.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
#define BEST_LANE_LOOKAHEAD
SUMOTime getMesoTLSPenalty() const
Returns the time penalty for passing a tls-controlled link (meso)
const Position & getPosition() const
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
double getInternalFollowingLengthTo(const MSEdge *followerAfterInternal) const
returns the length of all internal edges on the junction until reaching the non-internal edge followe...
bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle in the current step.
MSLane * getOpposite() const
return the opposite direction lane for lane changing or 0
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
double startPos
The stopping position start.
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
MSEdge & getEdge() const
Returns the lane's edge.
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
MSEdge(const std::string &id, int numericalID, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, double distance)
Constructor.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool insertVehicle(SUMOVehicle &v, SUMOTime time, const bool checkOnly=false, const bool forceCheck=false) const
Tries to insert the given vehicle into the network.
const MSEdge * myBidiEdge
the oppositing superposable edge
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static MELoop * gMesoNet
mesoscopic simulation infrastructure
MSEdgeVector mySuccessors
The succeeding edges.
MSLane * getFreeLane(const std::vector< MSLane * > *allowed, const SUMOVehicleClass vclass, double departPos) const
Finds the emptiest lane allowing the vehicle class.
double getLength() const
Get vehicle's length [m].
bool allowsLaneChanging() const
double myTimePenalty
flat penalty when computing traveltime
Sorts transportables by their positions.
void setMaxSpeed(double val) const
Sets a new maximum speed for all lanes (used by TraCI and MSCalibrator)
void addToAllowed(const SVCPermissions permissions, std::shared_ptr< const std::vector< MSLane * > > allowedLanes, AllowedLanesCont &laneCont) const
@ DEPART_POS_RANDOM_FREE
If a fixed number of random choices fails, a free position is chosen.
const SVCPermissions SVCAll
all VClasses are allowed
std::vector< MSEdge * > MSEdgeVector
void buildSegmentsFor(const MSEdge &e, const OptionsCont &oc)
Build the segments for a given edge.
static double gStopTolerance
The tolerance to apply when matching waiting persons and vehicles.
const std::string & getID() const
returns the id of the transportable
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.
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.
std::set< MSTransportable * > myContainers
Containers on the edge.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
bool myAmDelayed
whether this edge had a vehicle with less than max speed on it
@ DEPART_LANE_DEFAULT
No information given; use default.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
virtual void changeLanes(SUMOTime t)
Performs lane changing on this edge.
const MSEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
std::vector< std::string > getVector()
return vector of strings
@ LINKSTATE_ALLWAY_STOP
This is an uncontrolled, all-way stop link.
@ DEPART_POS_BASE
Back-at-zero position.
double myWidth
Edge width [m].
const SUMOVehicleClass SUMOVehicleClass_MAX
static SUMOTime gLaneChangeDuration
@ DEPART_POS_GIVEN
The position is given.
virtual void lock() const
grant exclusive access to the mesoscopic state
@ DEPART_CONTAINER_TRIGGERED
The departure is container triggered.
void removeWaiting(const SUMOVehicle *vehicle) const
Removes a vehicle from the list of waiting vehicles.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
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...
int operator()(const MSTransportable *const c1, const MSTransportable *const c2) const
comparing operator
@ SVC_IGNORING
vehicles ignoring classes
std::set< int > myFailedInsertionMemory
A cache for the rejected insertion attempts. Used to assure that no further insertion attempts are ma...
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
const std::string & getID() const
Returns the id.
AllowedLanesCont myAllowed
Associative container from vehicle class to allowed-lanes.
std::map< SUMOVehicleClass, MSConstEdgePairVector > myClassesViaSuccessorMap
The successors available for a given vClass.
@ DEPART_LANE_FREE
The least occupied lane is used.
int myVaporizationRequests
Vaporizer counter.
void buildLaneChanger()
Has to be called after all sucessors and predecessors have been set (after closeBuilding())
int getIndex() const
Returns the lane's index.
@ DEPART_LANE_FIRST_ALLOWED
The rightmost lane the vehicle may use.
double myEmptyTraveltime
the traveltime on the empty edge (cached value for speedup)
void laneChange(SUMOTime t)
Start lane-change-process for all vehicles on the edge'e lanes.
double departPos
(optional) The position the vehicle shall depart from
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
void rebuildAllowedLanes()
Definition of vehicle stop (position and duration)
const SumoXMLEdgeFunc myFunction
the purpose of the edge
@ LINKSTATE_STOP
This is an uncontrolled, minor link, has to stop.
const MSEdgeVector & getPredecessors() const
Representation of a vehicle in the micro simulation.
bool isSuperposable(const MSEdge *other)
std::vector< MSTransportable * > getSortedContainers(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's containers sorted by pos.