23 #ifndef MSLaneChanger_h
24 #define MSLaneChanger_h
79 MSLane::VehCont::reverse_iterator
veh;
94 typedef std::vector< ChangeElem >
Changer;
123 if (ce->veh != ce->lane->myVehicles.rend()) {
152 const std::pair<MSVehicle* const, SUMOReal>& leader,
153 const std::vector<MSVehicle::LaneQ>& preb)
const;
void laneChange(SUMOTime t)
Start lane-change-process for all vehicles on the edge'e lanes.
MSVehicle * firstBlocked
the first vehicle on this edge that wants to change to this lane
Representation of a vehicle in the micro simulation.
MSLane * lane
the lane the vehicle is on
std::pair< MSVehicle *const, SUMOReal > getRealLeader(const ChangerIt &target) const
MSLane::VehCont::reverse_iterator veh
the regarded vehicle
void initChanger()
Initialize the changer before looping over all vehicles.
MSVehicle * veh(ConstChangerIt ce) const
void startChange(MSVehicle *vehicle, ChangerIt &from, int direction)
start the lane change maneuver (and finish it instantly if gLaneChangeDuration == 0) ...
MSVehicle * lead
the vehicle in front of the current vehicle
MSVehicle * follow
the vehicle following the current vehicle
ChangerIt findCandidate()
Find current candidate. If there is none, myChanger.end() is returned.
Performs lane changing of vehicles.
std::pair< MSVehicle *const, SUMOReal > getRealFollower(const ChangerIt &target) const
void updateChanger(bool vehHasChanged)
Changer::const_iterator ConstChangerIt
the iterator moving over the ChangeElems
std::pair< MSVehicle *const, SUMOReal > getRealThisLeader(const ChangerIt &target) const
MSLaneChanger()
Default constructor.
int checkChange(int laneOffset, const std::pair< MSVehicle *const, SUMOReal > &leader, const std::vector< MSVehicle::LaneQ > &preb) const
void updateLanes(SUMOTime t)
MSVehicle * lastBlocked
the vehicle that really wants to change to this lane
std::vector< ChangeElem > Changer
The list of changers; For each lane, a ChangeElem is being build.
bool myAllowsSwap
Whether blocking vehicles may be swapped.
MSLaneChanger & operator=(const MSLaneChanger &)
Assignment operator.
~MSLaneChanger()
Destructor.
Changer::iterator ChangerIt
the iterator moving over the ChangeElems
Changer myChanger
Container for ChangeElemements, one for every lane in the edge.
void registerUnchanged(MSVehicle *vehicle)
MSVehicle * hoppedVeh
last vehicle that changed into this lane
bool vehInChanger() const
Check if there is a single change-candidate in the changer. Returns true if there is one...
Representation of a lane in the micro simulation.