|
SUMO - Simulation of Urban MObility
|
A lane change model developed by D. Krajzewicz between 2004 and 2010. More...
#include <MSLCM_DK2004.h>
Public Member Functions | |
| virtual void | changed () |
| virtual void | fulfillChangeRequest (MSVehicle::ChangeRequest request) |
| SUMOReal | getChangeProbability () const |
| int | getOwnState () const |
| SUMOReal | getProb () const |
| virtual void * | inform (void *info, MSVehicle *sender) |
| MSLCM_DK2004 (MSVehicle &v) | |
| virtual SUMOReal | patchSpeed (const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel &cfModel) |
| 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 (MSAbstractLaneChangeModel::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) |
| 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 (MSAbstractLaneChangeModel::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) |
| 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 | ~MSLCM_DK2004 () |
Protected Types | |
| typedef std::pair< SUMOReal, int > | Info |
Protected Member Functions | |
| bool | amBlockingFollower () |
| bool | amBlockingFollowerNB () |
| bool | amBlockingFollowerPlusNB () |
| bool | amBlockingLeader () |
| virtual bool | congested (const MSVehicle *const neighLeader) |
| bool | currentDistAllows (SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) |
| bool | currentDistDisallows (SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) |
| void | informBlocker (MSAbstractLaneChangeModel::MSLCMessager &msgPass, int &blocked, int dir, const std::pair< MSVehicle *, SUMOReal > &neighLead, const std::pair< MSVehicle *, SUMOReal > &neighFollow) |
| virtual bool | predInteraction (const MSVehicle *const leader) |
Protected Attributes | |
| const MSCFModel & | myCarFollowModel |
| The vehicle's car following model. | |
| SUMOReal | myChangeProbability |
| MSVehicle::ChangeRequest | myChangeRequest |
| bool | myDontBrake |
| SUMOReal | myLeadingBlockerLength |
| SUMOReal | myLeftSpace |
| int | myOwnState |
| The current state of the vehicle. | |
| MSVehicle & | myVehicle |
| The vehicle this lane-changer belongs to. | |
| std::vector< SUMOReal > | myVSafes |
A lane change model developed by D. Krajzewicz between 2004 and 2010.
Definition at line 60 of file MSLCM_DK2004.h.
typedef std::pair<SUMOReal, int> MSLCM_DK2004::Info [protected] |
Definition at line 138 of file MSLCM_DK2004.h.
| MSLCM_DK2004::MSLCM_DK2004 | ( | MSVehicle & | v | ) |
Definition at line 65 of file MSLCM_DK2004.cpp.
| MSLCM_DK2004::~MSLCM_DK2004 | ( | ) | [virtual] |
Definition at line 70 of file MSLCM_DK2004.cpp.
References changed().
| bool MSLCM_DK2004::amBlockingFollower | ( | ) | [inline, protected] |
Definition at line 122 of file MSLCM_DK2004.h.
References LCA_AMBLOCKINGFOLLOWER, and MSAbstractLaneChangeModel::myOwnState.
| bool MSLCM_DK2004::amBlockingFollowerNB | ( | ) | [inline, protected] |
Definition at line 125 of file MSLCM_DK2004.h.
References LCA_AMBLOCKINGFOLLOWER_DONTBRAKE, and MSAbstractLaneChangeModel::myOwnState.
| bool MSLCM_DK2004::amBlockingFollowerPlusNB | ( | ) | [inline, protected] |
Definition at line 128 of file MSLCM_DK2004.h.
References LCA_AMBLOCKINGFOLLOWER, LCA_AMBLOCKINGFOLLOWER_DONTBRAKE, and MSAbstractLaneChangeModel::myOwnState.
Referenced by wantsChangeToLeft(), and wantsChangeToRight().
| bool MSLCM_DK2004::amBlockingLeader | ( | ) | [inline, protected] |
Definition at line 119 of file MSLCM_DK2004.h.
References LCA_AMBLOCKINGLEADER, and MSAbstractLaneChangeModel::myOwnState.
| void MSLCM_DK2004::changed | ( | ) | [virtual] |
Implements MSAbstractLaneChangeModel.
Definition at line 606 of file MSLCM_DK2004.cpp.
References myChangeProbability, myDontBrake, myLeadingBlockerLength, myLeftSpace, MSAbstractLaneChangeModel::myOwnState, and myVSafes.
Referenced by patchSpeed(), and ~MSLCM_DK2004().
| virtual bool MSAbstractLaneChangeModel::congested | ( | const MSVehicle *const | neighLeader | ) | [inline, protected, virtual, inherited] |
Definition at line 259 of file MSAbstractLaneChangeModel.h.
References MSVehicle::congested(), MSVehicle::getLane(), MSLane::getMaxSpeed(), and MSAbstractLaneChangeModel::myVehicle.
Referenced by wantsChangeToLeft(), and wantsChangeToRight().
| bool MSLCM_DK2004::currentDistAllows | ( | SUMOReal | dist, |
| int | laneOffset, | ||
| SUMOReal | lookForwardDist | ||
| ) | [inline, protected] |
Definition at line 134 of file MSLCM_DK2004.h.
References abs.
Referenced by wantsChangeToLeft(), and wantsChangeToRight().
| bool MSLCM_DK2004::currentDistDisallows | ( | SUMOReal | dist, |
| int | laneOffset, | ||
| SUMOReal | lookForwardDist | ||
| ) | [inline, protected] |
Definition at line 131 of file MSLCM_DK2004.h.
References abs.
Referenced by wantsChangeToLeft(), and wantsChangeToRight().
| virtual void MSAbstractLaneChangeModel::fulfillChangeRequest | ( | MSVehicle::ChangeRequest | request | ) | [inline, virtual, inherited] |
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 251 of file MSAbstractLaneChangeModel.h.
References MSAbstractLaneChangeModel::myChangeRequest, and MSVehicle::REQUEST_NONE.
Referenced by MSLaneChanger::change().
| SUMOReal MSLCM_DK2004::getChangeProbability | ( | ) | const [inline] |
Definition at line 108 of file MSLCM_DK2004.h.
References myChangeProbability.
| int MSAbstractLaneChangeModel::getOwnState | ( | ) | const [inline, inherited] |
Definition at line 182 of file MSAbstractLaneChangeModel.h.
References MSAbstractLaneChangeModel::myOwnState.
Referenced by MSLaneChanger::change(), and MSVehicle::setBlinkerInformation().
| SUMOReal MSLCM_DK2004::getProb | ( | ) | const |
Definition at line 655 of file MSLCM_DK2004.cpp.
References myChangeProbability.
| void * MSLCM_DK2004::inform | ( | void * | info, |
| MSVehicle * | sender | ||
| ) | [virtual] |
Implements MSAbstractLaneChangeModel.
Definition at line 596 of file MSLCM_DK2004.cpp.
References MSAbstractLaneChangeModel::myOwnState.
| void MSLCM_DK2004::informBlocker | ( | MSAbstractLaneChangeModel::MSLCMessager & | msgPass, |
| int & | blocked, | ||
| int | dir, | ||
| const std::pair< MSVehicle *, SUMOReal > & | neighLead, | ||
| const std::pair< MSVehicle *, SUMOReal > & | neighFollow | ||
| ) | [protected] |
Definition at line 617 of file MSLCM_DK2004.cpp.
References ACCEL2DIST, MSCFModel::followSpeed(), MSVehicle::getCarFollowModel(), MSCFModel::getMaxDecel(), MSCFModel::getSecureGap(), MSVehicle::getSpeed(), MSAbstractLaneChangeModel::MSLCMessager::informNeighFollower(), MSAbstractLaneChangeModel::MSLCMessager::informNeighLeader(), LCA_AMBLOCKINGFOLLOWER, LCA_AMBLOCKINGFOLLOWER_DONTBRAKE, LCA_AMBLOCKINGLEADER, LCA_BLOCKED_BY_FOLLOWER, LCA_BLOCKED_BY_LEADER, MAX2(), MSAbstractLaneChangeModel::myCarFollowModel, MSAbstractLaneChangeModel::myVehicle, SPEED2DIST, and SUMOReal.
Referenced by wantsChangeToLeft(), and wantsChangeToRight().
| SUMOReal MSLCM_DK2004::patchSpeed | ( | const SUMOReal | min, |
| const SUMOReal | wanted, | ||
| const SUMOReal | max, | ||
| const MSCFModel & | cfModel | ||
| ) | [virtual] |
Called to adapt the speed in order to allow a lane change.
| min | The minimum resulting speed |
| wanted | The aspired speed of the car following model |
| max | The maximum resulting speed |
| cfModel | The model used |
Implements MSAbstractLaneChangeModel.
Definition at line 502 of file MSLCM_DK2004.cpp.
References bla, changed(), MSVehicle::getCarFollowModel(), MSLane::getEdge(), MSVehicle::getLane(), MSEdge::getLanes(), MSVehicle::getSpeed(), GLO_VEHICLE, gSelected, GUISelectedStorage::isSelected(), LCA_AMBACKBLOCKER, LCA_AMBACKBLOCKER_STANDING, LCA_AMBLOCKINGFOLLOWER, LCA_AMBLOCKINGFOLLOWER_DONTBRAKE, LCA_AMBLOCKINGLEADER, LCA_BLOCKED, LCA_BLOCKED_BY_FOLLOWER, LCA_BLOCKED_BY_LEADER, LCA_WANTS_LANECHANGE, MAX2(), MSCFModel::maxNextSpeed(), min, MIN2(), myDontBrake, myLeadingBlockerLength, myLeftSpace, MSAbstractLaneChangeModel::myOwnState, MSAbstractLaneChangeModel::myVehicle, myVSafes, MSCFModel::stopSpeed(), and SUMOReal.
| virtual bool MSAbstractLaneChangeModel::predInteraction | ( | const MSVehicle *const | leader | ) | [inline, protected, virtual, inherited] |
Definition at line 276 of file MSAbstractLaneChangeModel.h.
References MSVehicleType::getLengthWithGap(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), MSCFModel::interactionGap(), MSAbstractLaneChangeModel::myCarFollowModel, MSAbstractLaneChangeModel::myVehicle, and SUMOReal.
Referenced by wantsChangeToLeft(), and wantsChangeToRight().
| void MSLCM_DK2004::prepareStep | ( | ) | [virtual] |
Reimplemented from MSAbstractLaneChangeModel.
Definition at line 646 of file MSLCM_DK2004.cpp.
References myDontBrake, myLeadingBlockerLength, myLeftSpace, and myVSafes.
| virtual void MSAbstractLaneChangeModel::requestLaneChange | ( | MSVehicle::ChangeRequest | request | ) | [inline, virtual, inherited] |
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 241 of file MSAbstractLaneChangeModel.h.
References MSAbstractLaneChangeModel::myChangeRequest.
Referenced by MSVehicle::enterLaneAtLaneChange(), and MSVehicle::enterLaneAtMove().
| void MSAbstractLaneChangeModel::setOwnState | ( | int | state | ) | [inline, inherited] |
Definition at line 186 of file MSAbstractLaneChangeModel.h.
References MSAbstractLaneChangeModel::myOwnState.
Referenced by MSLaneChanger::change().
| int MSLCM_DK2004::wantsChangeToLeft | ( | MSAbstractLaneChangeModel::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 | ||
| ) | [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.
!!
Implements MSAbstractLaneChangeModel.
Definition at line 293 of file MSLCM_DK2004.cpp.
References ACCEL2SPEED, amBlockingFollowerPlusNB(), MSVehicle::LaneQ::bestLaneOffset, bla, MSAbstractLaneChangeModel::congested(), currentDistAllows(), currentDistDisallows(), MSCFModel::followSpeed(), MSVehicle::getCarFollowModel(), MSVehicle::getLane(), MSLane::getLength(), MSVehicleType::getLengthWithGap(), MSCFModel::getMaxDecel(), MSVehicleType::getMaxSpeed(), MSLane::getMaxSpeed(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), GLO_VEHICLE, gSelected, informBlocker(), GUISelectedStorage::isSelected(), JAM_FACTOR2, MSVehicle::LaneQ::lane, LCA_AMBACKBLOCKER, LCA_AMBACKBLOCKER_STANDING, LCA_AMBLOCKINGFOLLOWER_DONTBRAKE, LCA_BLOCKED, LCA_LEFT, LCA_MLEFT, LCA_RIGHT, LCA_SPEEDGAIN, LCA_URGENT, MSVehicle::LaneQ::length, LOOK_FORWARD_FAR, LOOK_FORWARD_NEAR, LOOK_FORWARD_SPEED_DIVIDER, MAX2(), MIN2(), MSAbstractLaneChangeModel::myCarFollowModel, myChangeProbability, MSAbstractLaneChangeModel::myChangeRequest, myDontBrake, myLeadingBlockerLength, myLeftSpace, MSAbstractLaneChangeModel::myOwnState, MSAbstractLaneChangeModel::myVehicle, myVSafes, MSVehicle::LaneQ::occupation, MSAbstractLaneChangeModel::predInteraction(), MSVehicle::REQUEST_LEFT, and SUMOReal.
| int MSLCM_DK2004::wantsChangeToRight | ( | MSAbstractLaneChangeModel::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 | ||
| ) | [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.
!!
Implements MSAbstractLaneChangeModel.
Definition at line 76 of file MSLCM_DK2004.cpp.
References ACCEL2SPEED, amBlockingFollowerPlusNB(), MSVehicle::LaneQ::bestLaneOffset, bla, MSAbstractLaneChangeModel::congested(), currentDistAllows(), currentDistDisallows(), MSCFModel::followSpeed(), MSVehicle::getCarFollowModel(), MSVehicle::getLane(), MSLane::getLength(), MSVehicleType::getLengthWithGap(), MSCFModel::getMaxDecel(), MSVehicleType::getMaxSpeed(), MSLane::getMaxSpeed(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), GLO_VEHICLE, gSelected, informBlocker(), GUISelectedStorage::isSelected(), JAM_FACTOR2, MSVehicle::LaneQ::lane, LCA_AMBACKBLOCKER, LCA_AMBACKBLOCKER_STANDING, LCA_AMBLOCKINGFOLLOWER_DONTBRAKE, LCA_BLOCKED, LCA_LEFT, LCA_MRIGHT, LCA_RIGHT, LCA_SPEEDGAIN, LCA_URGENT, MSVehicle::LaneQ::length, LOOK_FORWARD_FAR, LOOK_FORWARD_NEAR, LOOK_FORWARD_SPEED_DIVIDER, MAX2(), MIN2(), MSAbstractLaneChangeModel::myCarFollowModel, myChangeProbability, MSAbstractLaneChangeModel::myChangeRequest, myDontBrake, myLeadingBlockerLength, myLeftSpace, MSAbstractLaneChangeModel::myOwnState, MSAbstractLaneChangeModel::myVehicle, myVSafes, MSVehicle::LaneQ::occupation, MSAbstractLaneChangeModel::predInteraction(), MSVehicle::REQUEST_HOLD, MSVehicle::REQUEST_RIGHT, and SUMOReal.
const MSCFModel& MSAbstractLaneChangeModel::myCarFollowModel [protected, inherited] |
The vehicle's car following model.
Definition at line 303 of file MSAbstractLaneChangeModel.h.
Referenced by informBlocker(), MSAbstractLaneChangeModel::predInteraction(), wantsChangeToLeft(), and wantsChangeToRight().
SUMOReal MSLCM_DK2004::myChangeProbability [protected] |
Definition at line 143 of file MSLCM_DK2004.h.
Referenced by changed(), getChangeProbability(), getProb(), wantsChangeToLeft(), and wantsChangeToRight().
MSVehicle::ChangeRequest MSAbstractLaneChangeModel::myChangeRequest [protected, inherited] |
Definition at line 299 of file MSAbstractLaneChangeModel.h.
Referenced by MSAbstractLaneChangeModel::fulfillChangeRequest(), MSAbstractLaneChangeModel::requestLaneChange(), wantsChangeToLeft(), and wantsChangeToRight().
bool MSLCM_DK2004::myDontBrake [protected] |
Definition at line 149 of file MSLCM_DK2004.h.
Referenced by changed(), patchSpeed(), prepareStep(), wantsChangeToLeft(), and wantsChangeToRight().
SUMOReal MSLCM_DK2004::myLeadingBlockerLength [protected] |
Definition at line 145 of file MSLCM_DK2004.h.
Referenced by changed(), patchSpeed(), prepareStep(), wantsChangeToLeft(), and wantsChangeToRight().
SUMOReal MSLCM_DK2004::myLeftSpace [protected] |
Definition at line 146 of file MSLCM_DK2004.h.
Referenced by changed(), patchSpeed(), prepareStep(), wantsChangeToLeft(), and wantsChangeToRight().
int MSAbstractLaneChangeModel::myOwnState [protected, inherited] |
The current state of the vehicle.
Definition at line 295 of file MSAbstractLaneChangeModel.h.
Referenced by amBlockingFollower(), amBlockingFollowerNB(), amBlockingFollowerPlusNB(), amBlockingLeader(), changed(), MSAbstractLaneChangeModel::getOwnState(), inform(), patchSpeed(), MSAbstractLaneChangeModel::setOwnState(), wantsChangeToLeft(), and wantsChangeToRight().
MSVehicle& MSAbstractLaneChangeModel::myVehicle [protected, inherited] |
The vehicle this lane-changer belongs to.
Definition at line 292 of file MSAbstractLaneChangeModel.h.
Referenced by MSAbstractLaneChangeModel::congested(), informBlocker(), patchSpeed(), MSAbstractLaneChangeModel::predInteraction(), wantsChangeToLeft(), and wantsChangeToRight().
std::vector<SUMOReal> MSLCM_DK2004::myVSafes [protected] |
Definition at line 148 of file MSLCM_DK2004.h.
Referenced by changed(), patchSpeed(), prepareStep(), wantsChangeToLeft(), and wantsChangeToRight().