88 typedef std::vector< MSVehicle* >
VehCont;
92 struct VehPosition :
public std::binary_function < const MSVehicle*, SUMOReal, bool > {
197 bool recheckNextLanes,
518 static void insertIDs(std::vector<std::string>& into);
525 template<
class RTREE>
526 static void fill(RTREE& into);
536 unsigned int nRouteSuccs,
537 const MSLane& succLinkSource,
538 const std::vector<MSLane*>& conts);
543 bool isLinkEnd(MSLinkCont::const_iterator& i)
const;
643 SUMOReal speed,
const MSVehicle& veh,
const std::vector<MSLane*>& bestLaneConts)
const;
817 const MSLane::VehCont::iterator& at,
void forceVehicleInsertion(MSVehicle *veh, SUMOReal pos)
Inserts the given vehicle at the given position.
const std::map< SUMOVehicleClass, SUMOReal > * myRestrictions
The vClass speed restrictions for this lane.
void loadState(std::vector< std::string > &vehIDs, MSVehicleControl &vc)
Loads the state of this segment with the given parameters.
SVCPermissions myPermissions
The vClass permissions for this lane.
VehCont myVehicles
The lane's vehicles. The entering vehicles are inserted at the front of this container and the leavin...
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
bool isLinkEnd(MSLinkCont::const_iterator &i) const
SUMOReal getWaitingSeconds() const
Returns the overall waiting time on this lane.
static void insertIDs(std::vector< std::string > &into)
Adds the ids of all stored lanes into the given vector.
const MSEdge * getInternalFollower() const
Returns the lane's follower if it is an internal lane, the edge of the lane otherwise.
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
MSLane(const std::string &id, SUMOReal maxSpeed, SUMOReal length, MSEdge *const edge, unsigned int numericalID, const PositionVector &shape, SUMOReal width, SVCPermissions permissions, int index)
Constructor.
const Position geometryPositionAtOffset(SUMOReal offset) const
static void fill(RTREE &into)
Fills the given RTree with lane instances.
SUMOReal getLength() const
Returns the lane's length.
std::vector< IncomingLaneInfo > myIncomingLanes
MSVehicle * getFirstVehicle() const
size_t getNumericalID() const
Returns this lane's numerical id.
void setLength(SUMOReal val)
Sets a new length for the lane (used by TraCI only)
void addLink(MSLink *link)
Delayed initialization.
int myIndex
The lane index.
virtual bool integrateNewVehicle(SUMOTime t)
Insert buffered vehicle into the real lane.
std::vector< MSVehicle * > VehCont
Container for vehicles.
Notification
Definition of a vehicle state.
SUMOReal getFuelConsumption() const
Returns the sum of last step fuel consumption.
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
size_t myNumericalID
Unique numerical ID (set on reading by netload)
virtual void incorporateVehicle(MSVehicle *veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
const MSEdge *const myEdge
SUMOReal getWidth() const
Returns the lane's width.
SUMOReal getMaximumBrakeDist() const
compute maximum braking distance on this lane
void addIncomingLane(MSLane *lane, MSLink *viaLink)
SUMOReal getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
Realises dumping the complete network state.
virtual void addMoveReminder(MSMoveReminder *rem)
Add a move-reminder to move-reminder container.
void leftByLaneChange(MSVehicle *v)
void setPermissions(SVCPermissions permissions)
SUMOReal getElectricityConsumption() const
Returns the sum of last step electricity consumption.
virtual SUMOReal getMaxSpeed() const =0
Returns the vehicle's maximum speed.
bool operator()(const IncomingLaneInfo &ili) const
std::pair< MSVehicle *const, SUMOReal > getCriticalLeader(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle &veh) const
Returns the most dangerous leader and the distance to him.
const SUMOReal myWidth
Lane width [m].
bool freeInsertion(MSVehicle &veh, SUMOReal speed, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Tries to insert the given vehicle on any place.
SUMOReal myMaxSpeed
Lane-wide speedlimit [m/s].
SUMOReal getBruttoVehLenSum() const
Returns the sum of lengths of vehicles, including their minGaps, which were on the lane during the la...
SUMOReal setPartialOccupation(MSVehicle *v, SUMOReal leftVehicleLength)
Sets the information about a vehicle lapping into this lane.
static MSLinkCont::const_iterator succLinkSec(const SUMOVehicle &veh, unsigned int nRouteSuccs, const MSLane &succLinkSource, const std::vector< MSLane * > &conts)
PositionVector myShape
The shape of the lane.
SUMOReal getHCEmissions() const
Returns the sum of last step HC emissions.
bool isInsertionSuccess(MSVehicle *vehicle, SUMOReal speed, SUMOReal pos, bool recheckNextLanes, MSMoveReminder::Notification notification)
Tries to insert the given vehicle with the given state (speed and pos)
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
void setMaxSpeed(SUMOReal val)
Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)
SUMOReal getPartialOccupatorEnd() const
Returns the position of the in-lapping vehicle's end.
std::map< std::string, MSLane * > DictType
definition of the static dictionary type
virtual bool executeMovements(SUMOTime t, std::vector< MSLane * > &into)
Executes planned vehicle movements with regards to right-of-way.
bool lastInsertion(MSVehicle &veh, SUMOReal mspeed)
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
static DictType myDict
Static dictionary to associate string-ids with objects.
virtual SUMOReal getChosenSpeedFactor() const =0
void addApproachingLane(MSLane *lane, bool warnMultiCon)
Performs lane changing of vehicles.
A road/street connecting two junctions.
bool insertVehicle(MSVehicle &v)
Tries to insert the given vehicle.
virtual SUMOVehicleClass getVClass() const =0
Returns the vehicle's access class.
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
Allows to store the object; used as context while traveling the rtree in TraCI.
bool allowsVehicleClass(SUMOVehicleClass vclass) const
std::pair< MSVehicle *const, SUMOReal > getLeaderOnConsecutive(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle &veh, const std::vector< MSLane * > &bestLaneConts) const
Returns the immediate leader and the distance to him.
Export the queueing length in front of a junction (very experimental!)
void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
LinkState getIncomingLinkState() const
get the state of the link from the logical predecessor to this lane
SUMOReal getMissingRearGap(SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const
return by how much further the leader must be inserted to avoid rear end collisions ...
SUMOReal basePos(const MSVehicle &veh) const
departure position where the vehicle fits fully onto the lane (if possible)
const MSEdge *const myEdge
Representation of a vehicle.
std::vector< MSVehicle * > myVehBuffer
void add(const MSLane *const l) const
Adds the given object to the container.
SUMOReal getDepartSpeed(const MSVehicle &veh, bool &patchSpeed)
Sorts vehicles by their position (descending)
A point in 2D or 3D with translation and scaling methods.
void enteredByLaneChange(MSVehicle *v)
MSLane * getParallelLane(int offset) const
Returns the lane with the given offset parallel to this one or 0 if it does not exist.
SUMOReal getMeanSpeed() const
Returns the mean speed on this lane.
std::pair< MSVehicle *, SUMOReal > getLastVehicleInformation() const
Returns the last vehicle which is still on the lane.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
bool handleCollision(SUMOTime timestep, const std::string &stage, MSVehicle *collider, MSVehicle *victim, const SUMOReal victimRear)
detect whether there is a collision. then issue warning and add the vehicle to MSVehicleTransfer ...
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
MSLane * myLogicalPredecessorLane
Something on a lane to be noticed about vehicle movement.
std::pair< MSVehicle *const, SUMOReal > getLeader(const MSVehicle *veh, const SUMOReal vehPos, bool checkNext) const
Returns the immediate leader of veh and the distance to veh starting on this lane.
SUMOReal myLength
Lane length [m].
bool empty() const
Returns true if there is not a single vehicle on the lane.
MSVehicle * getLastVehicle() const
returns the last vehicle
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
SUMOReal getLengthGeometryFactor() const
return shape.length() / myLength
int getIndex() const
Returns the lane's index.
An upper class for objects with additional parameters.
std::map< MSEdge *, std::vector< MSLane * > > myApproachingLanes
Base class for objects which have an id.
std::vector< MSMoveReminder * > myMoveReminders
This lane's move reminder.
const SUMOReal myLengthGeometryFactor
unsigned int getVehicleNumber() const
Returns the number of vehicles on this lane.
std::vector< const MSLane * > getOutgoingLanes() const
get the list of outgoing lanes
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
SUMOReal getNOxEmissions() const
Returns the sum of last step NOx emissions.
SUMOReal getPMxEmissions() const
Returns the sum of last step PMx emissions.
The vehicle has departed (was inserted into the network)
bool operator()(const MSVehicle *cmp, SUMOReal pos) const
compares vehicle position to the detector position
MSVehicle * myInlappingVehicle
The vehicle which laps into this lane.
SUMOReal myBruttoVehicleLengthSum
The current length of all vehicles on this lane, including their minGaps.
vehicle_position_sorter()
Constructor.
static void clear()
Clears the dictionary.
SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const
SUMOReal getCO2Emissions() const
Returns the sum of last step CO2 emissions.
MSEdge *const myEdge
The lane's edge, for routing only.
SUMOReal getCOEmissions() const
Returns the sum of last step CO emissions.
std::pair< MSVehicle *const, SUMOReal > getFollowerOnConsecutive(SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const
return the follower with the largest missing rear gap among all predecessor lanes (within dist) ...
bool checkFailure(MSVehicle *aVehicle, SUMOReal &speed, SUMOReal &dist, const SUMOReal nspeed, const bool patchSpeed, const std::string errorMsg) const
SUMOReal myInlappingVehicleEnd
End position of a vehicle which laps into this lane.
static size_t dictSize()
Returns the number of stored lanes.
bool isApproachedFrom(MSEdge *const edge)
MSLane & operator=(const MSLane &)
invalidated assignment operator
void saveState(OutputDevice &out)
Saves the state of this lane into the given stream.
const PositionVector & getShape() const
Returns this lane's shape.
void visit(const TraCIServerAPI_Lane::StoringVisitor &cont) const
Callback for visiting the lane when traversing an RTree.
MSVehicle * getPartialOccupator() const
Returns the vehicle which laps into this lane.
Static storage of an output device and its base (abstract) implementation.
virtual ~MSLane()
Destructor.
SUMOReal myNettoVehicleLengthSum
The current length of all vehicles on this lane, excluding their minGaps.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
The class responsible for building and deletion of vehicles.
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
SUMOReal getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
const std::vector< IncomingLaneInfo > & getIncomingLanes() const
SUMOReal interpolateGeometryPosToLanePos(SUMOReal geometryPos) const
SUMOReal getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
const std::vector< MSMoveReminder * > & getMoveReminders() const
Return the list of this lane's move reminders.
Representation of a lane in the micro simulation.
int getCrossingIndex() const
return the index of the link to the next crossing if this is walkingArea, else -1 ...
virtual bool appropriate(const MSVehicle *veh)
virtual void planMovements(const SUMOTime t)
Compute safe velocities for all vehicles based on positions and speeds from the last time step...