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