88 typedef std::vector< MSVehicle* >
VehCont;
92 struct VehPosition :
public std::binary_function < const MSVehicle*, SUMOReal, bool > {
196 bool recheckNextLanes,
503 static void insertIDs(std::vector<std::string>& into);
510 template<
class RTREE>
511 static void fill(RTREE& into);
521 unsigned int nRouteSuccs,
522 const MSLane& succLinkSource,
523 const std::vector<MSLane*>& conts);
528 bool isLinkEnd(MSLinkCont::const_iterator& i)
const;
622 SUMOReal speed,
const MSVehicle& veh,
const std::vector<MSLane*>& bestLaneConts)
const;
758 const MSLane::VehCont::iterator& at,
void forceVehicleInsertion(MSVehicle *veh, SUMOReal pos)
Inserts the given vehicle at the given position.
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.
SUMOReal myWidth
Lane width [m].
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.
Position positionAtOffset(SUMOReal pos) const
Returns the position at the given length.
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.
int operator()(MSVehicle *v1, MSVehicle *v2) const
Comparing operator.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
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
size_t getNumericalID() const
Returns this lane's numerical id.
void setLength(SUMOReal val)
void addLink(MSLink *link)
Delayed initialization.
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.
MSLane(const std::string &id, SUMOReal maxSpeed, SUMOReal length, MSEdge *const edge, unsigned int numericalID, const PositionVector &shape, SUMOReal width, SVCPermissions permissions)
Constructor.
void addIncomingLane(MSLane *lane, MSLink *viaLink)
SUMOReal getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
by_connections_to_sorter(const MSEdge *const e)
constructor
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)
bool operator()(const IncomingLaneInfo &ili) const
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
by_connections_to_sorter & operator=(const by_connections_to_sorter &)
bool pWagGenericInsertion(MSVehicle &veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos)
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.
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
void setMaxSpeed(SUMOReal val)
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.
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
Performs lane changing of vehicles.
A road/street connecting two junctions.
bool insertVehicle(MSVehicle &v)
Tries to insert the given vehicle.
virtual bool isInsertionSuccess(MSVehicle *vehicle, SUMOReal speed, SUMOReal pos, bool recheckNextLanes, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Tries to insert the given vehicle with the given state (speed and pos)
MSLane * getLogicalPredecessorLane() const
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 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.
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.
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.
edge_finder & operator=(const edge_finder &)
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
MSEdge * myEdge
The lane's edge, for routing only.
MSLane * myLogicalPredecessorLane
Something on a lane to be noticed about vehicle movement.
SUMOReal myLength
Lane length [m].
bool empty() const
Returns true if there is not a single vehicle on the lane.
virtual 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
virtual const MSVehicle * getFirstVehicle() const
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.
bool pWagSimpleInsertion(MSVehicle &veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos)
const SUMOReal myLengthGeometryFactor
unsigned int getVehicleNumber() const
Returns the number of vehicles on this lane.
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.
SUMOReal getCOEmissions() const
Returns the sum of last step CO emissions.
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.
bool maxSpeedGapInsertion(MSVehicle &veh, SUMOReal mspeed)
static size_t dictSize()
Returns the number of stored lanes.
std::pair< MSVehicle *const, SUMOReal > getFollowerOnConsecutive(SUMOReal dist, SUMOReal leaderSpeed, SUMOReal backOffset, SUMOReal predMaxDecel) const
bool isApproachedFrom(MSEdge *const edge)
SUMOReal getMissingRearGap(SUMOReal dist, SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const
return by how much further the leader must be inserted to avoid rear end collisions ...
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.
void addApproachingLane(MSLane *lane)
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...