151 const double length,
const double speed,
153 const bool multiQueue,
217 inline const std::vector<MEVehicle*>&
getQueue(
int index)
const {
218 assert(index < (
int)
myQueues.size());
219 return myQueues[index].getVehicles();
261 occ += q.getOccupancy();
346 void receive(
MEVehicle* veh,
const int qIdx,
SUMOTime time,
const bool isDepart =
false,
const bool isTeleport =
false,
const bool newEdge =
false);
389 t =
MIN2(t, q.getEntryBlockTime());
485 SUMOTime blockTime,
const std::vector<MEVehicle*>& vehs);
511 SUMOTime getTauJJ(
double nextQueueSize,
double nextQueueCapacity,
double nextJamThreshold)
const;
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.
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
SUMOTime myBlockTime
The block time.
void addDetector(MSMoveReminder *data)
void setEntryBlockTime(SUMOTime entryBlockTime)
set the next time at which a vehicle may enter this queue
SUMOTime myEntryBlockTime
The block time for vehicles who wish to enter this queue.
double getOccupancy() const
std::vector< MSMoveReminder * > myDetectorData
The data collection for all kinds of detectors.
std::vector< MEVehicle * > myVehicles
const std::vector< MEVehicle * > & getVehicles() const
Queue(const SVCPermissions permissions)
SUMOTime getEntryBlockTime() const
return the next time at which a vehicle may enter this queue
void setPermissions(SVCPermissions p)
SVCPermissions myPermissions
The vClass permissions for 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.
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.
double getEntryBlockTimeSeconds() const
get the earliest entry time in seconds
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
bool isOpen(const MEVehicle *veh) const
Returns whether the vehicle may use the next link.
void addDetector(MSMoveReminder *data, int queueIndex=-1)
Adds a data collector for a detector to this segment.
double getLastHeadwaySeconds() const
get the last headway time in seconds
double getRelativeOccupancy() const
Returns the relative occupany of the segment (percentage of road used))
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.
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.
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.
MESegment(const MESegment &)
Invalidated copy constructor.
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
MESegment & operator=(const MESegment &)
Invalidated assignment operator.
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)
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
static MESegment myVaporizationTarget
int numQueues() const
return the number of queues
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.
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
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.
double getRelativeJamThreshold() const
Returns the relative occupany of the segment (percentage of road used)) at which the segment is consi...
bool hasBlockedLeader() const
whether a leader in any queue is blocked
int remainingVehicleCapacity(const double vehLength) const
return the remaining physical space on this segment
double getWaitingSeconds() const
Get the waiting time for vehicles in all queues.
const double myLength
The segment's length.
SUMOTime getMinimumHeadwayTime() const
return the minimum headway-time with which vehicles may enter or leave this segment
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.
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.
double getEventTimeSeconds() const
Like getEventTime but returns seconds (for visualization)
static MSEdge myDummyParent
void recomputeJamThreshold(double jamThresh)
compute a value for myJamThreshold if jamThresh is negative, compute a value which allows free flow a...
int getIndex() const
Returns the running index of the segment in the edge (0 is the most upstream).
double getMeanSpeed() const
wrapper to satisfy the FunctionBinding signature
int getCarNumber() const
Returns the total number of cars on the segment.
void loadState(const std::vector< std::string > &vehIDs, MSVehicleControl &vc, const SUMOTime blockTime, 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.
bool myTLSPenalty
Whether tls penalty is enabled.
static const double DO_NOT_PATCH_JAM_THRESHOLD
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.
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
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.
Base of value-generating classes (detectors)
A road/street connecting two junctions.
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
The class responsible for building and deletion of vehicles.
Base class for objects which have an id.
Static storage of an output device and its base (abstract) implementation.
edge type specific meso parameters