83 bool multiQueue,
bool junctionControl,
87 typedef std::vector<MEVehicle*>
Queue;
405 SUMOTime blockTime,
const std::vector<MEVehicle*>& vehs);
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
static MESegment myVaporizationTarget
SUMOTime getTLSPenalty(const MEVehicle *veh) const
Returns the penalty time for passing a tls-controlled link (if using gMesoTLSPenalty > 0) ...
bool isOpen(const MEVehicle *veh) const
Returns whether the vehicle may use the next link.
std::vector< MEVehicle * > Queue
const SUMOReal myCapacity
The number of lanes * the length.
SUMOReal getRelativeOccupancy() const
Returns the relative occupany of the segment (percentage of road used))
A vehicle from the mesoscopic point of view.
int getCarNumber() const
Returns the total number of cars on the segment.
MEVehicle * removeCar(MEVehicle *v, SUMOTime leaveTime, MESegment *next)
Removes the given car from the edge's que.
SUMOReal getRelativeJamThreshold() const
Returns the relative occupany of the segment (percentage of road used)) at which the segment is consi...
bool initialise(MEVehicle *veh, SUMOTime time)
Inserts (emits) vehicle into the segment.
MESegment(const std::string &id, const MSEdge &parent, MESegment *next, SUMOReal length, SUMOReal speed, int idx, SUMOTime tauff, SUMOTime taufj, SUMOTime taujf, SUMOTime taujj, SUMOReal jamThresh, bool multiQueue, bool junctionControl, SUMOReal lengthGeometryFactor)
constructor
void setSpeedForQueue(SUMOReal newSpeed, SUMOTime currentTime, SUMOTime blockTime, const std::vector< MEVehicle *> &vehs)
SUMOTime getEntryBlockTime() const
return the next time at which a vehicle my enter this segment
SUMOTime myEntryBlockTime
int getIndex() const
Returns the running index of the segment in the edge (0 is the most upstream).
static const SUMOReal DO_NOT_PATCH_JAM_THRESHOLD
SUMOReal getMeanSpeed() const
wrapper to satisfy the FunctionBinding signature
std::vector< MSMoveReminder * > myDetectorData
The data collection for all kinds of detectors.
SUMOReal myOccupancy
The occupied space (in m) on the segment.
SUMOTime newArrival(const MEVehicle *const v, SUMOReal newSpeed, SUMOTime currentTime)
compute the new arrival time when switching speed
SUMOTime getEventTime() const
Returns the (planned) time at which the next vehicle leaves this segment.
SUMOTime getMinimumHeadwayTime() const
return the minimum headway-time with which vehicles may enter or leave this segment ...
Queues myCarQues
The car queues. Vehicles are inserted in the front and removed in the back.
bool hasSpaceFor(const MEVehicle *veh, SUMOTime entryTime, bool init=false) const
Returns whether the given vehicle would still fit into the segment.
void loadState(std::vector< std::string > &vehIDs, MSVehicleControl &vc, const SUMOTime blockTime, const int queIdx)
Loads the state of this segment with the given parameters.
void setEntryBlockTime(SUMOTime entryBlockTime)
set the next time at which a vehicle my enter this segment
void writeVehicles(OutputDevice &of) const
A road/street connecting two junctions.
const SUMOReal myHeadwayCapacity
The capacity of the segment in number of cars, used only in time headway calculation This parameter h...
void receive(MEVehicle *veh, SUMOTime time, bool isDepart=false, bool afterTeleport=false)
Adds the vehicle to the segment, adapting its parameters.
SUMOReal jamThresholdForSpeed(SUMOReal speed, SUMOReal jamThresh) const
compute jam threshold for the given speed and jam-threshold option
bool free() const
return whether this segment is considered free as opposed to jammed
MESegment & operator=(const MESegment &)
Invalidated assignment operator.
SUMOTime myLastMeanSpeedUpdate
the time at which myMeanSpeed was last updated
std::map< const MSEdge *, std::vector< int > > myFollowerMap
The follower edge to que index mapping for multi queue segments.
SUMOReal getEventTimeSeconds() const
Like getEventTime but returns seconds (for visualization)
static bool isInvalid(const MESegment *segment)
whether the given segment is 0 or encodes vaporization
static MSEdge myDummyParent
void updateDetectorsOnLeave(MEVehicle *v, SUMOTime currentTime, MESegment *next)
Updates data of all detectors for a leaving vehicle.
int remainingVehicleCapacity(const SUMOReal vehLength) const
return the remaining physical space on this segment
SUMOReal myTau_length
Headway paramter for computing gross time headyway from net time heawdway, length and edge speed...
const SUMOReal myLength
The segment's length.
void addDetector(MSMoveReminder *data)
Adds a data collector for a detector to this segment.
Something on a lane to be noticed about vehicle movement.
bool vaporizeAnyCar(SUMOTime currentTime)
tries to remove any car from this segment
SUMOReal myJamThreshold
The space (in m) which needs to be occupied before the segment is considered jammed.
std::vector< const MEVehicle * > getVehicles() const
returns all vehicles (for debugging)
SUMOReal getBruttoOccupancy() const
Returns the occupany of the segment (the sum of the vehicle lengths + minGaps)
void removeDetector(MSMoveReminder *data)
Removes a data collector for a detector from this segment.
Base class for objects which have an id.
const MSEdge & myEdge
The microsim edge this segment belongs to.
SUMOReal myA
slope and axis offset for the jam-jam headway function
SUMOTime getNextInsertionTime(SUMOTime earliestEntry) const
return a time after earliestEntry at which a vehicle may be inserted at full speed ...
SUMOReal getLength() const
Returns the length of the segment in meters.
void setSpeed(SUMOReal newSpeed, SUMOTime currentTime, SUMOReal jamThresh=DO_NOT_PATCH_JAM_THRESHOLD)
reset mySpeed and patch the speed of all vehicles in it. Also set/recompute myJamThreshold ...
void addReminders(MEVehicle *veh) const
add this lanes MoveReminders to the given vehicle
const bool myTLSPenalty
Whether tls penalty is enabled.
MESegment * myNextSegment
The next segment of this edge, 0 if this is the last segment of this edge.
bool limitedControlOverride(const MSLink *link) const
whether the given link may be passed because the option meso-junction-control.limited is set ...
MSLink * getLink(const MEVehicle *veh, bool tlsPenalty=false) const
Returns the link the given car will use when passing the next junction.
A single mesoscopic segment (cell)
SUMOReal getLengthGeometryFactor() const
return precomputed geometrical length / myLength
int numQueues() const
return the number of queues
const bool myJunctionControl
Whether junction control is enabled.
const SUMOReal myLengthGeometryFactor
const Queue & getQueue(int index) const
Returns the cars in the queue with the given index for visualization.
Static storage of an output device and its base (abstract) implementation.
void saveState(OutputDevice &out)
Saves the state of this segment into the given stream.
std::vector< SUMOTime > myBlockTimes
The block times.
The class responsible for building and deletion of vehicles.
void prepareDetectorForWriting(MSMoveReminder &data)
Updates data of a detector for all vehicle queues.
void send(MEVehicle *veh, MESegment *next, SUMOTime time)
Removes the vehicle from the segment, adapting its parameters.
SUMOReal myMeanSpeed
the mean speed on this segment. Updated at event time or on demand
const int myIndex
Running number of the segment in the edge.
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
const SUMOTime myTau_ff
The time headway parameters, see the Eissfeldt thesis.
std::vector< Queue > Queues
SUMOReal getFlow() const
returns flow based on headway
void recomputeJamThreshold(SUMOReal jamThresh)
compute a value for myJamThreshold if jamThresh is negative, compute a value which allows free flow a...
SUMOTime getTimeHeadway(bool predecessorIsFree, SUMOReal leaderLength)