80 typedef std::vector<std::pair<SVCPermissions, std::shared_ptr<const std::vector<MSLane*> > > >
AllowedLanesCont;
101 const std::string& streetName,
const std::string& edgeType,
int priority,
114 void initialize(
const std::vector<MSLane*>* lanes);
168 inline const std::vector<MSLane*>&
getLanes()
const {
186 std::vector<const SUMOVehicle*>
getVehicles()
const;
204 inline const std::set<MSTransportable*, ComparatorNumericalIdLess>&
getPersons()
const {
244 const std::vector<MSLane*>*
const lanes =
allowedLanes(destination, vclass);
245 return lanes !=
nullptr && !lanes->empty();
479 }
else if (veh != 0) {
628 if (vehicle ==
nullptr) {
702 void setMaxSpeed(
double val,
double jamThreshold = -1);
815 static void insertIDs(std::vector<std::string>& into);
836 const std::string& rid);
846 const std::string& rid);
903 std::shared_ptr<const std::vector<MSLane*> >
myLanes;
938 mutable std::set<MSTransportable*, ComparatorNumericalIdLess>
myPersons;
941 mutable std::set<MSTransportable*, ComparatorNumericalIdLess>
myContainers;
1042 mutable FXMutex myWaitingMutex;
1045 mutable FXMutex mySuccessorMutex;
std::vector< const MSEdge * > ConstMSEdgeVector
std::vector< std::pair< const MSEdge *, const MSEdge * > > MSConstEdgePairVector
std::vector< MSEdge * > MSEdgeVector
const SVCPermissions SVCAll
all VClasses are allowed
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
A class that stores a 2D geometrical boundary.
Sorts edges by their ids.
by_id_sorter()
constructor
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
Sorts transportables by their positions.
transportable_by_position_sorter(SUMOTime timestep)
constructor
int operator()(const MSTransportable *const c1, const MSTransportable *const c2) const
comparing operator
A road/street connecting two junctions.
void setCrossingEdges(const std::vector< std::string > &crossingEdges)
Sets the crossed edge ids for a crossing edge.
virtual void unlock() const
release exclusive access to the mesoscopic state
std::string myStreetName
the real-world name of this edge (need not be unique)
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
SUMOVehicle * getWaitingVehicle(MSTransportable *transportable, const double position) const
virtual bool isSelected() const
whether this lane is selected in the GUI
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.
const int myPriority
the priority of the edge (used during network creation)
double getBruttoOccupancy() const
bool isConnectedTo(const MSEdge &destination, SUMOVehicleClass vclass) const
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
double getFlow() const
return flow based on meanSpead
const MSEdge * myOtherTazConnector
the other taz-connector if this edge isTazConnector, otherwise nullptr
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.
bool isCrossing() const
return whether this edge is a pedestrian crossing
MSLane * getDepartLane(MSVehicle &veh) const
Finds a depart lane for the given vehicle parameters.
SUMOTime myLastFailedInsertionTime
The time of last insertion failure.
std::set< MSTransportable *, ComparatorNumericalIdLess > myContainers
Containers on the edge.
void setOtherTazConnector(const MSEdge *edge)
int getPriority() const
Returns the priority of the edge.
static void clear()
Clears the dictionary.
static void setMesoIgnoredVClasses(SVCPermissions ignored)
const int myNumericalID
This edge's numerical id.
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.
SVCPermissions getPermissions() const
Returns the combined permissions of all lanes of this edge.
AllowedLanesCont myAllowed
Associative container from vehicle class to allowed-lanes.
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
virtual ~MSEdge()
Destructor.
double getDepartPosBound(const MSVehicle &veh, bool upper=true) const
return upper bound for the depart position on this edge
const double myDistance
the kilometrage/mileage at the start of the edge
void setFrictionCoefficient(double val) const
Sets a new friction coefficient COF for all lanes [later to be (used by TraCI and MSCalibrator)].
void clearState()
Remove all transportables before quick-loading state.
MSLane * getDepartLaneMeso(SUMOVehicle &veh) const
consider given departLane parameter (only for validating speeds)
const std::string & getStreetName() const
Returns the street name of the edge.
bool hasTransientPermissions() const
const std::set< MSTransportable *, ComparatorNumericalIdLess > & getPersons() const
Returns this edge's persons set.
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.
static double getTravelTimeStatic(const MSEdge *const edge, const SUMOVehicle *const veh, double time)
Returns the travel time for the given edge.
std::string myEdgeType
the type of the edge (optionally used during network creation)
RailEdge< MSEdge, SUMOVehicle > * getRailwayRoutingEdge() const
bool isWalkingArea() const
return whether this edge is walking area
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
int getNumDrivingLanes() const
return the number of lanes that permit non-weak modes if the edge allows non weak modes and the numbe...
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...
bool isFringe() const
return whether this edge is at the fringe of the network
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
void rebuildAllowedLanes(const bool onInit=false)
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Get the allowed lanes to reach the destination-edge.
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
double getInternalFollowingLengthTo(const MSEdge *followerAfterInternal, SUMOVehicleClass vClass) const
returns the length of all internal edges on the junction until reaching the non-internal edge followe...
bool isNormal() const
return whether this edge is an internal edge
bool restricts(const SUMOVehicle *const) const
Returns whether this edge has restriction parameters forbidding the given vehicle to pass it The rest...
ReversedEdge< MSEdge, SUMOVehicle > * getReversedRoutingEdge() 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< std::string > & getCrossingEdges() const
Gets the crossed edge ids.
double getDistanceTo(const MSEdge *other, const bool doBoundaryEstimate=false) const
optimistic air distance heuristic for use in routing
void setMaxSpeed(double val, double jamThreshold=-1)
Sets a new maximum speed for all lanes (used by TraCI and MSCalibrator)
static MSEdge * dictionaryHint(const std::string &id, const int startIdx)
Returns the MSEdge associated to the key id giving a hint with a numerical id.
MSLaneChanger * myLaneChanger
This member will do the lane-change.
double getOccupancy() const
return mean occupancy on this edges lanes or segments
const MSConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Returns the following edges with internal vias, restricted by vClass.
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
MSLane * getProbableLane(const std::vector< MSLane * > *allowed, const SUMOVehicleClass vclass, double departPos, double maxSpeed) const
Finds the most probable lane allowing the vehicle class.
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...
SVCPermissions myOriginalCombinedPermissions
The original union of lane permissions for this edge (before temporary modifications)
MSEdge & operator=(const MSEdge &)=delete
assignment operator.
bool myAmDelayed
whether this edge had a vehicle with less than max speed on it
SVCPermissions myOriginalMinimumPermissions
The original intersection of lane permissions for this edge (before temporary modifications)
std::map< SUMOVehicleClass, MSEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
MSEdgeVector myPredecessors
The preceeding edges.
bool hasChangeProhibitions(SUMOVehicleClass svc, int index) const
return whether this edge prohibits changing for the given vClass when starting on the given lane inde...
void rebuildAllowedTargets(const bool updateVehicles=true)
bool hasLaneChanger() const
static SVCPermissions myMesoIgnoredVClasses
std::vector< std::pair< SVCPermissions, std::shared_ptr< const std::vector< MSLane * > > > > AllowedLanesCont
"Map" from vehicle class to allowed lanes
const MSJunction * getToJunction() const
double getLength() const
return the length of the edge
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
bool myHaveTransientPermissions
whether transient permission changes were applied to this edge or a predecessor
std::vector< std::string > myCrossingEdges
The crossed edges id for a crossing edge. On not crossing edges it is empty.
virtual void closeBuilding()
static SVCPermissions getMesoPermissions(SVCPermissions p, SVCPermissions ignoreIgnored=0)
bool canChangeToOpposite() const
whether this edge allows changing to the opposite direction edge
std::set< int > myFailedInsertionMemory
A cache for the rejected insertion attempts. Used to assure that no further insertion attempts are ma...
const MSJunction * getFromJunction() const
double getMeanSpeed() const
get the mean speed
static DictType myDict
Static dictionary to associate string-ids with objects.
std::set< MSTransportable *, ComparatorNumericalIdLess > myPersons
Persons on the edge for drawing and pushbutton.
bool isTazConnector() const
MSEdge(const MSEdge &)
Invalidated copy constructor.
double getDistanceAt(double pos) const
Returns the kilometrage/mileage at the given offset along the edge.
MSConstEdgePairVector myViaSuccessors
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
MSEdgeVector mySuccessors
The succeeding edges.
bool isRoundabout() const
bool isInternal() const
return whether this edge is an internal edge
bool prohibits(const SUMOVehicle *const vehicle) const
Returns whether the vehicle (class) is not allowed on the edge.
MSLane * rightLane(const MSLane *const lane) const
Returns the lane right to the one given, 0 if the given lane is rightmost.
double getWidth() const
Returns the edges's width (sum over all lanes)
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
std::map< SUMOVehicleClass, MSConstEdgePairVector > myOrigClassesViaSuccessorMap
AllowedLanesByTarget myOrigAllowedTargets
int getNumericalID() const
Returns the numerical id of the edge.
void resetTAZ(MSJunction *junction)
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.
ReversedEdge< MSEdge, SUMOVehicle > * myReversedRoutingEdge
a reversed version for backward routing
double getTimePenalty() const
const std::string & getEdgeType() const
Returns the type of the edge.
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
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge's sublanes.
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
const MSEdge * getOtherTazConnector() const
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
double getMeanFriction() const
get the mean friction over the lanes
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 MSEdgeVector & getPredecessors() const
virtual void removeTransportable(MSTransportable *t) const
SUMOTime getLastFailedInsertionTime() const
Returns the last time a vehicle could not be inserted.
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
bool allowsLaneChanging() const
bool isEmpty() const
whether this edge has no vehicles
const MSEdge * getInternalFollowingEdge(const MSEdge *followerAfterInternal, SUMOVehicleClass vClass) const
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.
MSLane * getFirstAllowed(SUMOVehicleClass vClass, bool defaultFirst=false) const
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,...
AllowedLanesCont myOrigAllowed
double getWaitingSeconds() const
return accumated waiting time for all vehicles on this edges lanes or segments
int myVaporizationRequests
Vaporizer counter.
int getNumPredecessors() const
Returns the number of edges this edge is connected to.
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.
std::map< const MSEdge *, AllowedLanesCont > AllowedLanesByTarget
Succeeding edges (keys) and allowed lanes to reach these edges (values).
bool myAmRoundabout
whether this edge belongs to a roundabout
virtual void addTransportable(MSTransportable *t) const
double getDistance() const
Returns the kilometrage/mileage encoding at the start of the edge (negative values encode descending ...
void setLastFailedInsertionTime(SUMOTime time) const
Sets the last time a vehicle could not be inserted.
RailEdge< MSEdge, SUMOVehicle > * myRailwayRoutingEdge
double myLength
the length of the edge (cached value for speedup)
The base class for an intersection.
Performs lane changing of vehicles.
Performs lane changing of vehicles.
Representation of a lane in the micro simulation.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
Representation of a vehicle in the micro simulation.
Base class for objects which have an id.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
the edge type representing backward edges
the edge type representing backward edges
Representation of a vehicle, person, or container.
virtual bool ignoreTransientPermissions() const
Returns whether this object is ignoring transient permission changes (during routing)
virtual SUMOVehicleClass getVClass() const =0
Returns the object's access class.
Representation of a vehicle.
Definition of vehicle stop (position and duration)
Structure representing possible vehicle parameter.