47#define DEFAULT_VEH_LENGTH_WITH_GAP (SUMOVTypeParameter::getDefault().length + SUMOVTypeParameter::getDefault().minGap)
53#define DEBUG_COND (myEdge.isSelected())
54#define DEBUG_COND2(obj) ((obj != 0 && (obj)->isSelected()))
67 const double length,
const double speed,
69 const bool multiQueue,
71 MESegment(id, parent, next, length, speed, idx, multiQueue, edgeType)
102 for (
int qIdx = 0; qIdx < (int)
myQueues.size(); qIdx++) {
105 while (!gapTimes.empty() && gapTimes.back() <= time) {
119 while (!gapTimes.empty() && gapTimes.back() <= entryTime) {
#define DEFAULT_VEH_LENGTH_WITH_GAP
void updateBlockTime(Queue &q, const Queue &qNext, const MESegment *const next, const MEVehicle *veh) override
update blockTime of Queue q
void send(MEVehicle *veh, MESegment *const next, const int nextQIdx, SUMOTime time, const MSMoveReminder::Notification reason) override
Removes the vehicle from the segment, adapting its parameters.
void updateEntryBlockTime(SUMOTime time) override
update entry blockTime for all queues
bool hasSpaceForInsertion(const Queue &q, int qIdx, double newOccupancy, SUMOTime entryTime) const override
check jam-avoidance constraints during insertion
std::vector< GapTimes > myGapTimes
MELSegment(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
std::vector< SUMOTime > GapTimes
upstream arrival times of traveling gaps between cars (for each queue)
void setBlockTime(SUMOTime t)
SUMOTime getBlockTime() const
void setEntryBlockTime(SUMOTime entryBlockTime)
set the next time at which a vehicle may enter this queue
double getOccupancy() const
SUMOTime getEntryBlockTime() const
return the next time at which a vehicle may enter this queue
A single mesoscopic segment (cell)
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.
std::vector< Queue > myQueues
The car queues. Vehicles are inserted in the front and removed in the back.
SUMOTime myLastHeadway
the last headway
MSLink * getLink(const MEVehicle *veh, bool tlsPenalty=false) const
Returns the link the given car will use when passing the next junction.
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.
const double myLength
The segment's length.
bool myTLSPenalty
Whether tls penalty is enabled.
A vehicle from the mesoscopic point of view.
int getQueIndex() const
Returns the index of the que the vehicle is in.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
A road/street connecting two junctions.
bool isTLSControlled() const
double getGreenFraction() const
Returns the average proportion of green time to cycle time.
Notification
Definition of a vehicle state.
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)
edge type specific meso parameters