 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
19 #ifndef MSLaneChanger_h
20 #define MSLaneChanger_h
50 MSLaneChanger(
const std::vector<MSLane*>* lanes,
bool allowChanging);
134 if (!ce->lane->myVehicles.empty()) {
135 return ce->lane->myVehicles.back();
147 virtual bool changeOpposite(std::pair<MSVehicle*, double> leader);
177 const std::pair<MSVehicle* const, double>& leader,
178 const std::vector<MSVehicle::LaneQ>& preb)
const;
185 const std::pair<MSVehicle* const, double>& leader,
186 const std::pair<MSVehicle* const, double>& neighLead,
187 const std::pair<MSVehicle* const, double>& neighFollow,
188 const std::vector<MSVehicle::LaneQ>& preb)
const;
217 static std::pair<MSVehicle*, double>
getColumnleader(
MSVehicle* vehicle, std::pair<MSVehicle*, double> leader,
double maxLookAhead = std::numeric_limits<double>::max());
MSVehicle * veh(ConstChangerIt ce) const
const bool myChangeToOpposite
whether this edge allows changing to the opposite direction edge
void registerHop(MSVehicle *vehicle)
Register that vehicle belongs to Changer Item to after LC decisions.
Representation of a lane in the micro simulation.
MSVehicle * lastBlocked
the next vehicle downstream of the ego vehicle that is blocked from changing to this lane
virtual void initChanger()
Initialize the changer before looping over all vehicles.
Performs lane changing of vehicles.
saves leader/follower vehicles and their distances relative to an ego vehicle
bool mayChange(int direction) const
whether changing to the lane in the given direction should be considered
bool mayChangeRight
whether changing is possible to either direction
virtual bool changeOpposite(std::pair< MSVehicle *, double > leader)
const bool myAllowsChanging
static std::pair< MSVehicle *, double > getColumnleader(MSVehicle *vehicle, std::pair< MSVehicle *, double > leader, double maxLookAhead=std::numeric_limits< double >::max())
static MSVehicle * getCloserFollower(const double maxPos, MSVehicle *follow1, MSVehicle *follow2)
return the closer follower of ego
bool continueChange(MSVehicle *vehicle, ChangerIt &from)
continue a lane change maneuver and return whether the vehicle has completely moved onto the new lane...
bool applyTraCICommands(MSVehicle *vehicle)
Execute TraCI LC-commands.
bool startChange(MSVehicle *vehicle, ChangerIt &from, int direction)
MSVehicle * hoppedVeh
last vehicle that changed into this lane
std::pair< MSVehicle *const, double > getRealLeader(const ChangerIt &target) const
bool vehInChanger() const
Check if there is a single change-candidate in the changer. Returns true if there is one.
static MSLane * getLaneAfter(MSLane *lane, const std::vector< MSLane * > &conts)
return the next lane in conts beyond lane or nullptr
void checkTraCICommands(MSVehicle *vehicle)
Take into account traci LC-commands.
ChangerIt findCandidate()
Find current candidate. If there is none, myChanger.end() is returned.
int checkChangeWithinEdge(int laneOffset, const std::pair< MSVehicle *const, double > &leader, const std::vector< MSVehicle::LaneQ > &preb) const
MSLaneChanger()
Default constructor.
MSLaneChanger & operator=(const MSLaneChanger &)
Assignment operator.
MSVehicle * firstBlocked
the farthest downstream vehicle on this edge that is blocked from changing to this lane
virtual ~MSLaneChanger()
Destructor.
virtual void updateChanger(bool vehHasChanged)
MSLane * lane
the lane corresponding to this ChangeElem (the current change candidate is on this lane)
std::vector< ChangeElem > Changer
The list of changers; For each lane, a ChangeElem is being build.
Changer::const_iterator ConstChangerIt
the iterator moving over the ChangeElems
Changer myChanger
Container for ChangeElemements, one for every lane in the edge.
std::pair< MSVehicle *const, double > getRealFollower(const ChangerIt &target) const
void registerUnchanged(MSVehicle *vehicle)
MSLeaderDistanceInfo aheadNext
static void computeOvertakingTime(const MSVehicle *vehicle, const MSVehicle *leader, double gap, double &timeToOvertake, double &spaceToOvertake)
Compute the time and space required for overtaking the given leader.
Changer::iterator ChangerIt
the iterator moving over the ChangeElems
ChangeElem(MSLane *_lane)
void updateLanes(SUMOTime t)
MSVehicle * lead
the leader vehicle for the current change candidate
std::vector< int > siblings
void laneChange(SUMOTime t)
Start lane-change-process for all vehicles on the edge'e lanes.
MSLaneChanger(const MSLaneChanger &)
Copy constructor.
Representation of a vehicle in the micro simulation.
int checkChange(int laneOffset, const MSLane *targetLane, const std::pair< MSVehicle *const, double > &leader, const std::pair< MSVehicle *const, double > &neighLead, const std::pair< MSVehicle *const, double > &neighFollow, const std::vector< MSVehicle::LaneQ > &preb) const