 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
81 typedef std::vector<std::pair<SVCPermissions, std::shared_ptr<const std::vector<MSLane*> > > >
AllowedLanesCont;
100 const std::string& streetName,
const std::string& edgeType,
int priority,
113 void initialize(
const std::vector<MSLane*>* lanes);
167 inline const std::vector<MSLane*>&
getLanes()
const {
176 inline const std::set<MSTransportable*>&
getPersons()
const {
424 }
else if (veh != 0) {
621 std::set<MSTransportable*>::iterator i =
myPersons.find(p);
634 std::set<MSTransportable*>::iterator i =
myContainers.find(container);
719 static void insertIDs(std::vector<std::string>& into);
735 const std::string& rid);
745 const std::string& rid);
788 std::shared_ptr<const std::vector<MSLane*> >
myLanes;
910 mutable FXMutex myWaitingMutex;
914 mutable FXMutex mySuccessorMutex;
MSJunction * myFromJunction
the junctions for this edge
bool canChangeToOpposite()
whether this edge allows changing to the opposite direction edge
const std::string & getEdgeType() const
Returns the type of the edge.
Sorts edges by their ids.
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
bool isRoundabout() const
Representation of a vehicle or person.
virtual bool isSelected() const
whether this lane is selected in the GUI
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 hasMinorLink() const
whether any lane has a minor link
by_id_sorter()
constructor
static DictType myDict
Static dictionary to associate string-ids with objects.
int getNumPredecessors() const
Returns the number of edges this edge is connected to.
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
const std::set< MSTransportable * > & getPersons() const
Returns this edge's persons set.
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...
An upper class for objects with additional parameters.
const std::string & getStreetName() const
Returns the street name of the edge.
virtual void unlock() const
release exclusive access to the mesoscopic state
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.
Performs lane changing of vehicles.
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's persons sorted by pos.
The base class for an intersection.
Static storage of an output device and its base (abstract) implementation.
const MSEdge * getOppositeEdge() const
Returns the opposite direction edge if on exists else a nullptr.
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.
bool isFringe() const
return whether this edge is at the fringe of the network
SUMOTime myLastFailedInsertionTime
The time of last insertion failure.
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.
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.
double myLength
the length of the edge (cached value for speedup)
std::vector< double > mySublaneSides
the right side for each sublane on this edge
bool myAmFringe
whether this edge is at the network fringe
Representation of a vehicle.
std::vector< const MSEdge * > ConstMSEdgeVector
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
virtual SUMOVehicleClass getVClass() const =0
Returns the vehicle's access class.
std::string myEdgeType
the type of the edge (optionally used during network creation)
virtual ~MSEdge()
Destructor.
void recalcCache()
Recalculates the cached values.
virtual void addPerson(MSTransportable *p) const
int getPriority() const
Returns the priority of the edge.
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)
Structure representing possible vehicle parameter.
double getDistanceTo(const MSEdge *other, const bool doBoundaryEstimate=false) const
optimistic air distance heuristic for use in routing
bool hasLaneChanger() const
double getLength() const
return the length of the edge
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
bool myAmRoundabout
whether this edge belongs to a roundabout
bool isNormal() const
return whether this edge is an internal edge
static int dictSize()
Returns the number of edges.
std::map< const MSEdge *, AllowedLanesCont > AllowedLanesByTarget
Succeeding edges (keys) and allowed lanes to reach these edges (values).
const int myNumericalID
This edge's numerical id.
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,...
bool isInternal() const
return whether this edge is an internal edge
double getWidth() const
Returns the edges's width (sum over all lanes)
double getLengthGeometryFactor() const
return shape.length() / myLength
MSLane * leftLane(const MSLane *const lane) const
Returns the lane left to the one given, 0 if the given lane is leftmost.
const MSJunction * getFromJunction() const
bool restricts(const SUMOVehicle *const) const
Returns whether the vehicle (class) is not allowed on the edge.
bool isCrossing() const
return whether this edge is a pedestrian crossing
double getMeanSpeed() const
get the mean speed
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
void setLastFailedInsertionTime(SUMOTime time) const
Sets the last time a vehicle could not be inserted.
double getDistance() const
Returns the kilometrage/mileage at the start of the edge.
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....
std::vector< std::string > myCrossingEdges
The crossed edges id for a crossing edge. On not crossing edges it is empty.
static void clear()
Clears the dictionary.
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
A class that stores a 2D geometrical boundary.
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
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.
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
A road/street connecting two junctions.
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.
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
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 double myDistance
the kilometrage/mileage at the start of the edge
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
double getInternalFollowingLengthTo(const MSEdge *followerAfterInternal) const
returns the length of all internal edges on the junction until reaching the non-internal edge followe...
virtual void removePerson(MSTransportable *p) const
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
MSEdge & operator=(const MSEdge &)=delete
assignment operator.
bool isWalkingArea() const
return whether this edge is walking area
MSEdge(const std::string &id, int numericalID, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, double distance)
Constructor.
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
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
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.
transportable_by_position_sorter(SUMOTime timestep)
constructor
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
const SVCPermissions SVCAll
all VClasses are allowed
SUMOTime getLastFailedInsertionTime() const
Returns the last time a vehicle could not be inserted.
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
std::vector< MSEdge * > MSEdgeVector
const int myPriority
the priority of the edge (used during network creation)
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
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
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
void setCrossingEdges(const std::vector< std::string > &crossingEdges)
Sets the crossed edge ids for a crossing edge.
static double getTravelTimeStatic(const MSEdge *const edge, const SUMOVehicle *const veh, double time)
Returns the travel time for the given edge.
double myWidth
Edge width [m].
virtual void lock() const
grant exclusive access to the mesoscopic state
bool prohibits(const SUMOVehicle *const vehicle) const
Returns whether the vehicle (class) is not allowed on the edge.
void removeWaiting(const SUMOVehicle *vehicle) const
Removes a vehicle from the list of waiting vehicles.
SVCPermissions getPermissions() const
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.
AllowedLanesCont myAllowed
Associative container from vehicle class to allowed-lanes.
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
std::map< SUMOVehicleClass, MSConstEdgePairVector > myClassesViaSuccessorMap
The successors available for a given vClass.
int myVaporizationRequests
Vaporizer counter.
void buildLaneChanger()
Has to be called after all sucessors and predecessors have been set (after closeBuilding())
double myEmptyTraveltime
the traveltime on the empty edge (cached value for speedup)
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge's sublanes.
std::string myStreetName
the real-world name of this edge (need not be unique)
void rebuildAllowedLanes()
Definition of vehicle stop (position and duration)
const SumoXMLEdgeFunc myFunction
the purpose of the edge
const MSEdgeVector & getPredecessors() const
const std::vector< std::string > & getCrossingEdges() const
Gets the crossed edge ids.
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.