48#define DEFAULT_VEH_LENGTH_WITH_GAP (SUMOVTypeParameter::getDefault().length + SUMOVTypeParameter::getDefault().minGap)
50#define MESO_MIN_SPEED (0.05)
56#define DEBUG_COND (myEdge.isSelected())
57#define DEBUG_COND2(obj) ((obj != 0 && (obj)->isSelected()))
92 myDetectorData.push_back(data);
110 const double length,
const double speed,
112 const bool multiQueue,
122 const std::vector<MSLane*>& lanes = parent.
getLanes();
126 for (
MSLane*
const l : lanes) {
137 if (usableLanes == 0) {
143 const double distToEnd = parent.
getLength() - (idx + 1) * length;
144 if (next ==
nullptr || distToEnd < edgeType.
lookahead) {
147 if (edge->isTazConnector()) {
150 const std::vector<MSLane*>*
const allowed = parent.
allowedLanes(*edge);
151 assert(allowed !=
nullptr);
152 assert(allowed->size() > 0);
153 for (
MSLane*
const l : *allowed) {
154 std::vector<MSLane*>::const_iterator it = std::find(lanes.begin(), lanes.end(), l);
159 std::vector<int> reach(lanes.size(), 0);
160 for (
int i = 0; i < (int)lanes.size(); i++) {
161 for (
const MSLink*
const link : lanes[i]->getLinkCont()) {
162 if (&link->getLane()->getEdge() == edge) {
163 reach[i] |= 1 << link->getLane()->getIndex();
174 maxAllow &= ~minAllow;
176 WRITE_WARNINGF(
"Mismodelled capacity on edge '%'. Not all lanes are usable by vClass '%'. Use option --meso-lane-queue or add unused class to option --meso-ignore-lanes-by-vclass.",
182 initSegment(edgeType, parent, length * usableLanes);
187 if (dist + edge.
getLength() >= lookahead) {
191 std::vector<std::pair<double, int> >& previous = searched[std::make_pair(&edge, reach)];
192 for (
const std::pair<double, int>& p : previous) {
193 if (p.first <= dist && p.second >= depth) {
197 previous.push_back(std::make_pair(dist, depth));
198 const std::vector<MSLane*>& lanes = edge.
getLanes();
200 for (
int i = 0; i < (int)reach.size(); i++) {
206 if (succ->isTazConnector()) {
211 std::vector<int> succReach(reach.size(), 0);
212 for (
int i = 0; i < (int)reach.size(); i++) {
213 for (
int j = 0; j < (int)lanes.size(); j++) {
214 if ((reach[i] & (1 << j)) != 0) {
215 for (
const MSLink*
const link : lanes[j]->getLinkCont()) {
216 if (&link->getLane()->getEdge() == succ) {
218 succReach[i] |= 1 << link->getLane()->getIndex();
225 if (queues != usable) {
240 const double laneScale = capacity /
myLength;
282 myEdge(myDummyParent),
283 myNextSegment(nullptr), myLength(0), myIndex(0),
284 myTau_ff(0), myTau_fj(0), myTau_jf(0), myTau_jj(0),
286 myCheckMinorPenalty(false),
288 myJunctionControl(false),
298 myQueues[lane->getIndex()].setPermissions(lane->getPermissions());
328 return std::numeric_limits<double>::max();
330#ifdef DEBUG_JAMTHRESHOLD
342 if (queueIndex == -1) {
347 assert(queueIndex < (
int)
myQueues.size());
348 myQueues[queueIndex].addDetector(data);
372 if (queueIndex == -1) {
374 SUMOTime earliestExitTime = currentTime;
375 for (std::vector<MEVehicle*>::const_reverse_iterator i = q.getVehicles().rbegin(); i != q.getVehicles().rend(); ++i) {
376 const SUMOTime exitTime =
MAX2(earliestExitTime, (*i)->getEventTime());
377 (*i)->updateDetectorForWriting(&data, currentTime, exitTime);
378 earliestExitTime = exitTime +
tauWithVehLength(
myTau_ff, (*i)->getVehicleType().getLengthWithGap(), (*i)->getVehicleType().getCarFollowModel().getHeadwayTime());
382 SUMOTime earliestExitTime = currentTime;
383 for (std::vector<MEVehicle*>::const_reverse_iterator i =
myQueues[queueIndex].
getVehicles().rbegin(); i !=
myQueues[queueIndex].getVehicles().rend(); ++i) {
384 const SUMOTime exitTime =
MAX2(earliestExitTime, (*i)->getEventTime());
385 (*i)->updateDetectorForWriting(&data, currentTime, exitTime);
386 earliestExitTime = exitTime +
tauWithVehLength(
myTau_ff, (*i)->getVehicleType().getLengthWithGap(), (*i)->getVehicleType().getCarFollowModel().getHeadwayTime());
401 return earliestEntry;
405 int minSize = std::numeric_limits<int>::max();
413 for (
int i = 0; i < (int)
myQueues.size(); i++) {
422 if (succ ==
nullptr) {
426 if (it !=
myFollowerMap.end() && (k == 0 || (usable & it->second & permitted) != 0)) {
427 usable &= it->second;
431 for (
int i = 0; i < (int)
myQueues.size(); i++) {
435 if ((usable & (1 << i)) != 0) {
453 if (minSize == std::numeric_limits<int>::max()) {
454 return earliestEntry;
477 const bool isRail = veh->
isRail();
490 receive(veh, qIdx, time,
true);
516 SUMOTime earliestExitTime = currentTime;
518 for (std::vector<MEVehicle*>::const_reverse_iterator veh = q.getVehicles().rbegin(); veh != q.getVehicles().rend(); ++veh) {
519 v += (*veh)->getConservativeSpeed(earliestExitTime);
520 earliestExitTime +=
tauWithVehLength(tau, (*veh)->getVehicleType().getLengthWithGap(), (*veh)->getVehicleType().getCarFollowModel().getHeadwayTime());
546 const double lanesCovered =
numQueues() == 1
549 for (
int qIdx = 0; qIdx <
numQueues(); ++qIdx) {
550 const std::vector<MEVehicle*> queue =
getQueue(qIdx);
551 const int queueSize = (int)queue.size();
554 double prevPos = std::numeric_limits<double>::max();
555 for (
int i = 0; i < queueSize; ++i) {
556 MEVehicle*
const veh = queue[queueSize - i - 1];
559 double maxPos = segmentOffset + segLength;
563 maxPos =
MIN2(maxPos, prevPos - vehLength / lanesCovered);
567 const double pos =
MAX2(
MIN2(segmentOffset + segLength * (now - entry) / (
STEPS2TIME(earliestExitTime) - entry), maxPos), oldPos);
568 if (overlap == 0 && prevPos - pos < vehLength) {
569 overlap = lanesCovered > 1. ? -3 : -1;
584 for (
const MEVehicle*
const veh : q.getVehicles()) {
612 SUMOTime earliestLeave = earliestEntry;
615 earliestLeave =
MAX2(earliestLeave, q.getBlockTime());
616 latestEntry =
MAX2(latestEntry, q.getEntryBlockTime());
619 return MAX2(earliestEntry, latestEntry);
636 if (&link->getLane()->getEdge() == nextEdge) {
642 if (lane != bestLane) {
643 for (
MSLink*
const link : lane->getLinkCont()) {
644 if (&link->getLane()->getEdge() == nextEdge) {
664 std::cout <<
" link=0";
671 0,
nullptr,
false, veh)
687 const bool open = (link ==
nullptr
693 0,
nullptr,
false, veh));
708 assert(link !=
nullptr);
743 if (link !=
nullptr) {
782 const double n_jam_threshold = headwayCapacity * nextJamThreshold / nextQueueCapacity;
814 const MSLane*
const lane = queueIndex < (int)routeLanes.size()
864 if (!isDepart && leaderOut > tleave &&
overtake(veh)) {
865 if (cars.size() == 1) {
868 if (link !=
nullptr) {
874 cars.insert(cars.begin() + 1, veh);
876 tleave =
MAX2(leaderOut +
tauWithVehLength(
myTau_ff, cars[0]->getVehicleType().getLengthWithGap(), cars[0]->getVehicleType().getCarFollowModel().getHeadwayTime()), tleave);
877 cars.insert(cars.begin(), veh);
883 if (!isDepart && !isTeleport) {
897 }
else if (newEdge) {
905 if (newLeader !=
nullptr) {
916 for (
MEVehicle*
const veh : q.getVehicles()) {
932 SUMOTime oldEarliestExitTime = currentTime;
942 for (std::vector<MEVehicle*>::const_reverse_iterator i = vehs.rbegin() + 1; i != vehs.rend(); ++i) {
943 const SUMOTime oldExitTime =
MAX2(oldEarliestExitTime, (*i)->getEventTime());
944 (*i)->updateDetectors(currentTime, oldExitTime,
false);
946 oldEarliestExitTime = oldExitTime + minTau;
947 newEvent =
MAX2(
newArrival(*i, newSpeed, currentTime), newEvent + minTau);
948 (*i)->setEventTime(newEvent);
970 if (qIdx == -1 || qIdx == i) {
983 if (q.size() != 0 && q.getVehicles().back()->getEventTime() < result) {
984 result = q.getVehicles().back()->getEventTime();
997 for (
int i = 0; i < (int)
myQueues.size(); i++) {
1005 for (
int i = 0; i < (int)
myQueues.size(); i++) {
1026 for (
MEVehicle* veh : q.getModifiableVehicles()) {
1027 veh->invalidateMesoPosition();
1029 q.getModifiableVehicles().clear();
1048 if (q.
size() != 0) {
1060std::vector<const MEVehicle*>
1062 std::vector<const MEVehicle*> result;
1064 result.insert(result.end(), q.getVehicles().begin(), q.getVehicles().end());
1073 if (q.size() > 0 && q.getVehicles().back()->getWaitingTime() > 0) {
1090 if (link !=
nullptr) {
1115 for (
const MEVehicle* veh : q.getVehicles()) {
1116 result += veh->getWaitingSeconds();
#define DEFAULT_VEH_LENGTH_WITH_GAP
std::vector< MSEdge * > MSEdgeVector
#define WRITE_WARNINGF(...)
constexpr SUMOTime TIME2STEPS(double x)
const SVCPermissions SVCAll
all VClasses are allowed
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
bool isRailwayOrShared(SVCPermissions permissions)
Returns whether an edge with the given permissions is a railway edge or a shared road/rail edge.
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.
@ SPLIT
The departure is triggered by a train split.
@ SUMO_TAG_VIEWSETTINGS_VEHICLES
@ SUMO_TAG_SEGMENT
segment of a lane
@ TRAFFIC_LIGHT_RIGHT_ON_RED
@ TRAFFIC_LIGHT_NOJUNCTION
@ SUMO_ATTR_STATE
The state of a link.
@ SUMO_ATTR_TIME
trigger: the time of the step
bool gDebugFlag1
global utility flags for debugging
static bool isEnteringRoundabout(const MSEdge &e)
whether the given edge is entering a roundabout
void addLeaderCar(MEVehicle *veh, MSLink *link, const bool fromState=false)
Adds the given car to the leading vehicles.
SUMOTime changeSegment(MEVehicle *veh, SUMOTime leaveTime, MESegment *const toSegment, MSMoveReminder::Notification reason, const bool ignoreLink=false) const
change to the next segment this handles combinations of the following cases: (ending / continuing rou...
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
void removeLeaderCar(MEVehicle *v)
Removes the given car from the leading vehicles.
void setOccupancy(const double occ)
MEVehicle * remove(MEVehicle *v)
void setBlockTime(SUMOTime t)
SUMOTime getBlockTime() const
double myOccupancy
The occupied space (in m) in the queue.
bool allows(SUMOVehicleClass vclass) const
std::vector< MEVehicle * > & getModifiableVehicles()
void addReminders(MEVehicle *veh) const
void addDetector(MSMoveReminder *data)
void setEntryBlockTime(SUMOTime entryBlockTime)
set the next time at which a vehicle may enter this queue
double getOccupancy() const
std::vector< MEVehicle * > myVehicles
const std::vector< MEVehicle * > & getVehicles() const
SUMOTime getEntryBlockTime() const
return the next time at which a vehicle may enter this queue
A single mesoscopic segment (cell)
void addReminders(MEVehicle *veh) const
add this lanes MoveReminders to the given vehicle
double myQueueCapacity
The number of lanes represented by the queue * the length of the lane.
double getVehicleMaxSpeed(const MEVehicle &veh, int queueIndex) const
Maximum vehicle speed for the given queue, accounting for internal junction segments.
SUMOTime tauWithVehLength(SUMOTime tau, double lengthWithGap, double vehicleTau) const
convert net time gap (leader back to follower front) to gross time gap (leader front to follower fron...
SUMOTime myTau_ff
The time headway parameters, see the Eissfeldt thesis.
int isOpen(const MEVehicle *veh) const
Returns whether the vehicle may use the next link.
bool initialise(MEVehicle *veh, SUMOTime time)
Inserts (emits) vehicle into the segment.
std::vector< Queue > myQueues
The car queues. Vehicles are inserted in the front and removed in the back.
double getBruttoOccupancy() const
Returns the occupany of the segment (the sum of the vehicle lengths + minGaps)
SUMOTime myLastHeadway
the last headway
static const int PARKING_QUEUE
bool limitedControlOverride(const MSLink *link) const
whether the given link may be passed because the option meso-junction-control.limited is set
void addDetector(MSMoveReminder *data, int queueIndex=-1)
Adds a data collector for a detector to this segment.
void clearState()
Remove all vehicles before quick-loading state.
void receive(MEVehicle *veh, const int qIdx, SUMOTime time, const bool isDepart=false, const bool isTeleport=false, const bool newEdge=false)
Adds the vehicle to the segment, adapting its parameters.
static SVCPermissions myMultiModalWarnings
SUMOTime getLinkPenalty(const MEVehicle *veh) const
Returns the penalty time for passing a link (if using gMesoTLSPenalty > 0 or gMesoMinorPenalty > 0)
void writeVehicles(OutputDevice &of) const
std::map< const MSEdge *, int > myFollowerMap
The follower edge to allowed que index mapping for multi queue segments.
MSLink * getLink(const MEVehicle *veh, bool tlsPenalty=false) const
Returns the link the given car will use when passing the next junction.
SUMOTime myMesoPositionUpdateTime
The time step of the last interpolated position update.
int myNumVehicles
The cached value for the number of vehicles.
void setSpeedForQueue(double newSpeed, SUMOTime currentTime, SUMOTime blockTime, const std::vector< MEVehicle * > &vehs)
double getLength() const
Returns the length of the segment in meters.
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.
const std::vector< MEVehicle * > & getQueue(int index) const
Returns the cars in the queue with the given index for visualization.
void updatePermissions()
called when permissions change due to Rerouter or TraCI
void invalidateMesoPositions() const
Invalidate the cached interpolated positions.
long long int myOvertakeKey
this segment's part of the overtaking draws (hash of edge id and segment index in the upper 32 bits)
void saveState(OutputDevice &out) const
Saves the state of this segment into the given stream.
void initSegment(const MesoEdgeType &edgeType, const MSEdge &parent, const double capacity)
set model parameters (may be updated from additional file after network loading is complete)
void resetCachedSpeeds()
reset myLastMeanSpeedUpdate
virtual bool hasTravelingGaps(int, SUMOTime) const
whether space vacated by vehicles that left the given queue has not yet reached the upstream end
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
static MESegment myVaporizationTarget
int numQueues() const
return the number of queues
void updateMesoPositions() const
Update interpolated positions for all vehicles on this segment.
int myLookahead
The number of route edges after myEdge to look up in myFollowerMap.
double myStartOffset
Distance from the start of the edge for position interpolation.
void addDownstreamFollowers(const MSEdge &edge, const std::vector< int > &reach, const double dist, const double lookahead, const int depth, SearchedMap &searched)
add the queues leading to the successors of the given downstream edge to myFollowerMap
virtual std::string getQueueExtraState(int) const
model specific queue state (e.g. the gap times of meso-ltm) for saving / loading
double myJamThreshold
The space (in m) which needs to be occupied before the segment is considered jammed.
const int myIndex
Running number of the segment in the edge.
virtual void send(MEVehicle *veh, MESegment *const next, const int nextQIdx, SUMOTime time, const MSMoveReminder::Notification reason)
Removes the vehicle from the segment, adapting its parameters.
double myMeanSpeed
the mean speed on this segment. Updated at event time or on demand
bool myCheckMinorPenalty
penalty for minor links
virtual SUMOTime computeHeadway(Queue &q, const Queue &qNext, const MESegment *const next, const MEVehicle *veh) const
compute current headway depending on traffic state
double jamThresholdForSpeed(double speed, double jamThresh) const
compute jam threshold for the given speed and jam-threshold option
SUMOTime myLastMeanSpeedUpdate
the time at which myMeanSpeed was last updated
void setSpeed(double newSpeed, SUMOTime currentTime, double jamThresh=DO_NOT_PATCH_JAM_THRESHOLD, int qIdx=-1)
reset mySpeed and patch the speed of all vehicles in it. Also set/recompute myJamThreshold
MESegment * myNextSegment
The next segment of this edge, 0 if this is the last segment of this edge.
bool hasBlockedLeader() const
whether a leader in any queue is blocked
double getWaitingSeconds() const
Get the waiting time for vehicles in all queues.
const double myLength
The segment's length.
SUMOTime getEventTime() const
Returns the (planned) time at which the next vehicle leaves this segment.
const MSEdge & myEdge
The microsim edge this segment belongs to.
static const std::string OVERRIDE_TLS_PENALTIES
special param value
MESegment(const std::string &id, const MSEdge &parent, MESegment *next, const double length, const double speed, const int idx, const bool multiQueue, const MesoEdgeType &edgeType)
constructor
MEVehicle * removeCar(MEVehicle *v, SUMOTime leaveTime, const MSMoveReminder::Notification reason)
Removes the given car from the edge's que.
std::vector< const MEVehicle * > getVehicles() const
returns all vehicles (for debugging)
double getCapacity() const
Returns the sum of the lengths of all usable lanes of the segment in meters.
static MSEdge myDummyParent
@ PROCEED_NO
the vehicle must stay on the current segment
@ PROCEED_NO_TLS
vehicle want's to change to right lane
@ PROCEED_YES
the vehicle may proceed to the next segment
void recomputeJamThreshold(double jamThresh)
compute a value for myJamThreshold if jamThresh is negative, compute a value which allows free flow a...
double getMeanSpeed() const
wrapper to satisfy the FunctionBinding signature
SUMOTime getQueueBlockTime(int index) const
int getCarNumber() const
Returns the total number of cars on the segment.
bool overtake(const MEVehicle *veh) const
whether veh overtakes the queue's last vehicle, drawn from a number specific to vehicle and segment
void loadState(const std::vector< SUMOVehicle * > &vehs, const SUMOTime blockTime, const SUMOTime entryBlockTime, const int queIdx)
Loads the state of this segment with the given parameters.
double myTau_length
Headway parameter for computing gross time headyway from net time headway, length and edge speed.
SUMOTime newArrival(const MEVehicle *const v, double newSpeed, SUMOTime currentTime)
compute the new arrival time when switching speed
bool myJunctionControl
Whether junction control is enabled.
virtual bool hasSpaceForInsertion(const Queue &q, int qIdx, double newOccupancy, SUMOTime entryTime) const
check jam-avoidance constraints during insertion
bool myTLSPenalty
Whether tls penalty is enabled.
static const double DO_NOT_PATCH_JAM_THRESHOLD
SUMOTime getMinTauWithVehLength(double lengthWithGap, double vehicleTau) const
convert net time gap (leader back to follower front) to gross time gap (leader front to follower fron...
double getFlow() const
returns flow based on headway
static bool isInvalid(const MESegment *segment)
whether the given segment is 0 or encodes vaporization
SUMOTime getNextInsertionTime(SUMOTime earliestEntry) const
return a time after earliestEntry at which a vehicle may be inserted at full speed
double myCapacity
The number of lanes represented by the queue * the length of the lane.
bool myOvertaking
Whether overtaking is permitted on this segment.
void prepareDetectorForWriting(MSMoveReminder &data, int queueIndex=-1)
Removes a data collector for a detector from this segment.
std::map< std::pair< const MSEdge *, std::vector< int > >, std::vector< std::pair< double, int > > > SearchedMap
the (distance, depth) pairs at which a downstream edge was searched with a given lane reach
bool vaporizeAnyCar(SUMOTime currentTime, const MSDetectorFileOutput *filter)
tries to remove any car from this segment
SUMOTime getTauJJ(double nextQueueSize, double nextQueueCapacity, double nextJamThreshold) const
A vehicle from the mesoscopic point of view.
double getLastEntryTimeSeconds() const
Returns the entry time for the current segment.
void markJammed(bool jammed)
double estimateLeaveSpeed(const MSLink *link) const
Returns the vehicle's estimated speed after driving across the link.
void processStop()
ends the current stop and performs loading/unloading
SUMOTime getWaitingTime(const bool accumulated=false) const
Returns the duration for which the vehicle was blocked.
bool hasArrived() const
Returns whether this vehicle has already arrived (reached the arrivalPosition on its final edge)
bool moveRoutePointer()
Update when the vehicle enters a new edge in the move step.
double getMesoPosition() const
Returns the cached interpolated mesoscopic position.
void updateDetectors(const SUMOTime currentTime, const SUMOTime exitTime, const bool isLeave, const MSMoveReminder::Notification reason=MSMoveReminder::NOTIFICATION_JUNCTION)
Updates all vehicle detectors.
SUMOTime checkStop(SUMOTime time)
Returns until when to stop at the current segment and sets the information that the stop has been rea...
void setUnqueuedEventTime(SUMOTime t)
Sets the minimum time at which the vehicle leaves its current segment (this includes planned stops)
SUMOTime getLastEntryTime() const
Returns the time the vehicle entered the current segment.
void setEventTime(SUMOTime t, bool hasDelay=true)
Sets the (planned) time at which the vehicle leaves its current segment.
void setMesoPosition(double pos, int overlap)
Sets the interpolated position and lateral overlap offset.
MESegment * getSegment() const
Returns the current segment the vehicle is on.
void setLastEntryTime(SUMOTime t)
Sets the entry time for the current segment.
int getQueIndex() const
Returns the index of the que the vehicle is in.
virtual void setSegment(MESegment *s, int idx=0)
Sets the current segment the vehicle is at together with its que.
SUMOTime getEventTime() const
Returns the (planned) time at which the vehicle leaves its current segment.
void invalidateMesoPosition()
Invalidates the cached interpolated position.
void setBlockTime(const SUMOTime t)
Sets the time at which the vehicle was blocked.
double getSpeed() const
Returns the vehicle's estimated speed assuming no delays.
double getImpatience() const
Returns this vehicles impatience.
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs'th successor of edge the vehicle is currently at.
int getInsertionChecks() const
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
bool isParking() const
Returns whether the vehicle is parking.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
void addReminder(MSMoveReminder *rem, double pos=0)
Adds a MoveReminder dynamically.
virtual void activateReminders(const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
"Activates" all current move reminder
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
void onDepart()
Called when the vehicle is inserted into the network.
long long int getRandomSeed() const
return vehicle-specific random number
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool isStopped() const
Returns whether the vehicle is at a stop.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
Base of value-generating classes (detectors)
bool vehicleApplies(const SUMOTrafficObject &veh) const
Checks whether the detector measures vehicles of the given type.
bool sidingDeadlock(const SUMOVehicle *veh) const
whether insertion on this driveway would cause deadlock in an approached siding
static const MSDriveWay * getDepartureDriveway(const SUMOVehicle *veh, bool init=false)
bool foeDriveWayOccupied(bool store, const SUMOVehicle *ego, MSEdgeVector &occupied) const
whether any of myFoes is occupied (vehicles that are the target of a join must be ignored)
A road/street connecting two junctions.
virtual void unlock() const
release exclusive access to the mesoscopic state
SVCPermissions getPermissions() const
Returns the combined permissions of all lanes of this edge.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
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.
bool isNormal() const
return whether this edge is an internal edge
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is returned; should pr...
const MSJunction * getToJunction() const
double getLength() const
return the length of the edge
static SVCPermissions getMesoPermissions(SVCPermissions p, SVCPermissions ignoreIgnored=0)
bool isRoundabout() const
bool isInternal() const
return whether this edge is an internal 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.
bool hasMinorLink() const
whether any lane has a minor link
virtual void lock() const
grant exclusive access to the mesoscopic state
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
static bool gMesoLimitedJunctionControl
SumoXMLNodeType getType() const
return the type of this Junction
Representation of a lane in the micro simulation.
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
MSEdge & getEdge() const
Returns the lane's edge.
const std::vector< MSLink * > & getLinkCont() const
returns the container with all links !!!
bool isTLSControlled() const
MSLane * getLane() const
Returns the connected lane.
bool opened(SUMOTime arrivalTime, double arrivalSpeed, double leaveSpeed, double vehicleLength, double impatience, double decel, SUMOTime waitingTime, double posLat=0, BlockingFoes *collectFoes=nullptr, bool ignoreRed=false, const SUMOTrafficObject *ego=nullptr, double dist=-1) const
Returns the information whether the link may be passed.
bool havePriority() const
Returns whether this link is a major link.
SUMOTime getMesoTLSPenalty() const
Returns the time penalty for passing a tls-controlled link (meso)
void removeApproaching(const SUMOVehicle *veh)
removes the vehicle from myApproachingVehicles
double getGreenFraction() const
Returns the average proportion of green time to cycle time.
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
@ NOTIFICATION_ARRIVED
The vehicle arrived at its destination (is deleted)
@ NOTIFICATION_VAPORIZED_CALIBRATOR
The vehicle got removed by a calibrator.
@ NOTIFICATION_DEPARTED
The vehicle has departed (was inserted into the network)
@ NOTIFICATION_SEGMENT
The vehicle changes the segment (meso only)
@ NOTIFICATION_VAPORIZED_VAPORIZER
The vehicle got vaporized with a vaporizer.
@ NOTIFICATION_JUNCTION
The vehicle arrived at a junction.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
static bool isSignalized(SUMOVehicleClass svc)
void scheduleVehicleRemoval(SUMOVehicle *veh, bool checkDuplicate=false)
Removes a vehicle after it has ended.
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
static void writeVehicle(OutputDevice &of, const MSBaseVehicle &veh)
Writes the dump of the given vehicle into the given device.
Base class for objects which have an id.
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
const std::string & getID() const
Returns the id.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false, const bool escape=false)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static double randHash(long long int x)
return a value scrambled value from [0, 1]
static uint32_t murmur3_32(const std::string &key2, int seed)
string hashing adapted from https://en.wikipedia.org/wiki/MurmurHash
Representation of a vehicle.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
edge type specific meso parameters