SUMO - Simulation of Urban MObility
|
Interface for lane-change models. More...
#include <MSAbstractLaneChangeModel.h>
Data Structures | |
class | MSLCMessager |
A class responsible for exchanging messages between cars involved in lane-change interaction. More... |
Public Member Functions | |
virtual void | changed ()=0 |
virtual void | fulfillChangeRequest (MSVehicle::ChangeRequest request) |
int | getOwnState () const |
virtual void * | inform (void *info, MSVehicle *sender)=0 |
MSAbstractLaneChangeModel (MSVehicle &v) | |
Constructor. | |
virtual SUMOReal | patchSpeed (const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel &cfModel)=0 |
Called to adapt the speed in order to allow a lane change. | |
virtual void | prepareStep () |
virtual void | requestLaneChange (MSVehicle::ChangeRequest request) |
void | setOwnState (int state) |
virtual int | wantsChangeToLeft (MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, SUMOReal > &leader, const std::pair< MSVehicle *, SUMOReal > &neighLead, const std::pair< MSVehicle *, SUMOReal > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked)=0 |
Called to examine whether the vehicle wants to change to left This method gets the information about the surrounding vehicles and whether another lane may be more preferable. | |
virtual int | wantsChangeToRight (MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, SUMOReal > &leader, const std::pair< MSVehicle *, SUMOReal > &neighLead, const std::pair< MSVehicle *, SUMOReal > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked)=0 |
Called to examine whether the vehicle wants to change to right This method gets the information about the surrounding vehicles and whether another lane may be more preferable. | |
virtual | ~MSAbstractLaneChangeModel () |
Destructor. |
Protected Member Functions | |
virtual bool | congested (const MSVehicle *const neighLeader) |
virtual bool | predInteraction (const MSVehicle *const leader) |
Protected Attributes | |
const MSCFModel & | myCarFollowModel |
The vehicle's car following model. | |
MSVehicle::ChangeRequest | myChangeRequest |
int | myOwnState |
The current state of the vehicle. | |
MSVehicle & | myVehicle |
The vehicle this lane-changer belongs to. |
Private Member Functions | |
MSAbstractLaneChangeModel & | operator= (const MSAbstractLaneChangeModel &s) |
Invalidated assignment operator. |
Interface for lane-change models.
Definition at line 103 of file MSAbstractLaneChangeModel.h.
|
inline |
Constructor.
[in] | v | The vehicle this lane-changer belongs to |
Definition at line 172 of file MSAbstractLaneChangeModel.h.
|
inlinevirtual |
Destructor.
Definition at line 182 of file MSAbstractLaneChangeModel.h.
|
pure virtual |
Implemented in MSLCM_DK2004.
Referenced by MSLaneChanger::change().
|
inlineprotectedvirtual |
Definition at line 263 of file MSAbstractLaneChangeModel.h.
References MSVehicle::congested(), MSVehicle::getLane(), MSLane::getSpeedLimit(), and myVehicle.
Referenced by MSLCM_DK2004::wantsChangeToLeft(), and MSLCM_DK2004::wantsChangeToRight().
|
inlinevirtual |
Inform the model that a certain lane change request has been fulfilled by the lane changer, so the request won't be taken into account the next time.
request | indicates the request that was fulfilled |
Definition at line 255 of file MSAbstractLaneChangeModel.h.
References myChangeRequest, and MSVehicle::REQUEST_NONE.
Referenced by MSLaneChanger::change().
|
inline |
Definition at line 186 of file MSAbstractLaneChangeModel.h.
References myOwnState.
Referenced by MSLaneChanger::change(), and MSVehicle::setBlinkerInformation().
|
pure virtual |
|
private |
Invalidated assignment operator.
|
pure virtual |
Called to adapt the speed in order to allow a lane change.
It is guaranteed that min<=wanted<=max, but the implementation needs to make sure that the return value is between min and max.
min | The minimum resulting speed |
wanted | The aspired speed of the car following model |
max | The maximum resulting speed |
cfModel | The model used |
Implemented in MSLCM_DK2004.
Referenced by MSCFModel_Daniel1::moveHelper(), MSCFModel_SmartSK::moveHelper(), MSCFModel_KraussOrig1::moveHelper(), and MSCFModel::moveHelper().
|
inlineprotectedvirtual |
Definition at line 280 of file MSAbstractLaneChangeModel.h.
References MSVehicleType::getLength(), MSVehicleType::getMinGap(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), MSCFModel::interactionGap(), myCarFollowModel, myVehicle, and SUMOReal.
Referenced by MSLCM_DK2004::wantsChangeToLeft(), and MSLCM_DK2004::wantsChangeToRight().
|
inlinevirtual |
Reimplemented in MSLCM_DK2004.
Definition at line 194 of file MSAbstractLaneChangeModel.h.
Referenced by MSLaneChanger::change().
|
inlinevirtual |
The vehicle is requested to change the lane as soon as possible without violating any directives defined by this lane change model
request | indicates the requested change |
Definition at line 245 of file MSAbstractLaneChangeModel.h.
References myChangeRequest.
Referenced by MSVehicle::enterLaneAtLaneChange(), MSVehicle::enterLaneAtMove(), and TraCIServerAPI_Vehicle::processSet().
|
inline |
Definition at line 190 of file MSAbstractLaneChangeModel.h.
References myOwnState.
Referenced by MSLaneChanger::change().
|
pure virtual |
Called to examine whether the vehicle wants to change to left This method gets the information about the surrounding vehicles and whether another lane may be more preferable.
Implemented in MSLCM_DK2004.
Referenced by MSLaneChanger::change2left().
|
pure virtual |
Called to examine whether the vehicle wants to change to right This method gets the information about the surrounding vehicles and whether another lane may be more preferable.
Implemented in MSLCM_DK2004.
Referenced by MSLaneChanger::change2right().
|
protected |
The vehicle's car following model.
Definition at line 307 of file MSAbstractLaneChangeModel.h.
Referenced by MSLCM_DK2004::informBlocker(), predInteraction(), MSLCM_DK2004::wantsChangeToLeft(), and MSLCM_DK2004::wantsChangeToRight().
|
protected |
Definition at line 303 of file MSAbstractLaneChangeModel.h.
Referenced by fulfillChangeRequest(), requestLaneChange(), MSLCM_DK2004::wantsChangeToLeft(), and MSLCM_DK2004::wantsChangeToRight().
|
protected |
The current state of the vehicle.
Definition at line 299 of file MSAbstractLaneChangeModel.h.
Referenced by MSLCM_DK2004::amBlockingFollower(), MSLCM_DK2004::amBlockingFollowerNB(), MSLCM_DK2004::amBlockingFollowerPlusNB(), MSLCM_DK2004::amBlockingLeader(), MSLCM_DK2004::changed(), getOwnState(), MSLCM_DK2004::inform(), MSLCM_DK2004::patchSpeed(), setOwnState(), MSLCM_DK2004::wantsChangeToLeft(), and MSLCM_DK2004::wantsChangeToRight().
|
protected |
The vehicle this lane-changer belongs to.
Definition at line 296 of file MSAbstractLaneChangeModel.h.
Referenced by congested(), MSLCM_DK2004::informBlocker(), MSLCM_DK2004::patchSpeed(), predInteraction(), MSLCM_DK2004::wantsChangeToLeft(), and MSLCM_DK2004::wantsChangeToRight().