SUMOReal MSEdge::getCurrentTravelTime(SUMOReal minSpeed) const { assert(minSpeed > 0); if (!myAmDelayed) { return myEmptyTraveltime; } return getLength() / MAX2(minSpeed, getMeanSpeed()); }
SUMOReal GUIEdge::getScaleValue(size_t activeScheme) const { switch (activeScheme) { case 1: return gSelected.isSelected(getType(), getGlID()); case 2: return getAllowedSpeed(); case 3: return getBruttoOccupancy(); case 4: return getMeanSpeed(); case 5: return getFlow(); case 6: return getRelativeSpeed(); } return 0; }
SUMOReal GUIEdge::getScaleValue(int activeScheme) const { switch (activeScheme) { case 1: return gSelected.isSelected(getType(), getGlID()); case 2: return getAllowedSpeed(); case 3: return getBruttoOccupancy(); case 4: return getMeanSpeed(); case 5: return getFlow(); case 6: return getRelativeSpeed(); case 7: return MSNet::getInstance()->getInsertionControl().getPendingEmits(getLanes()[0]); } return 0; }
bool MESegment::hasSpaceFor(const MEVehicle* veh, SUMOTime entryTime, bool init) const { if (myOccupancy == 0.) { // we have always space for at least one vehicle return true; } const SUMOReal newOccupancy = myOccupancy + veh->getVehicleType().getLengthWithGap(); if (newOccupancy > myCapacity) { // we must ensure that occupancy remains below capacity return false; } // regular insertions and initial insertions must respect different constraints: // - regular insertions must respect entryBlockTime // - initial insertions should not cause additional jamming if (init) { // inserted vehicle should be able to continue at the current speed return newOccupancy <= jamThresholdForSpeed(getMeanSpeed(false), -1); } // maintain propper spacing between inflow from different lanes return entryTime >= myEntryBlockTime; }
SUMOReal GUIEdge::getRelativeSpeed() const { return getMeanSpeed() / getAllowedSpeed(); }
SUMOReal MESegment::getFlow() const { return 3600 * getCarNumber() * getMeanSpeed() / myLength; }