SUMO - Simulation of Urban MObility
MSLCM_DK2004 Class Reference

A lane change model developed by D. Krajzewicz between 2004 and 2010. More...

#include <MSLCM_DK2004.h>

Inheritance diagram for MSLCM_DK2004:
MSAbstractLaneChangeModel

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, intInfo

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 MSCFModelmyCarFollowModel
 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.
MSVehiclemyVehicle
 The vehicle this lane-changer belongs to.
std::vector< SUMORealmyVSafes

Detailed Description

A lane change model developed by D. Krajzewicz between 2004 and 2010.

Definition at line 64 of file MSLCM_DK2004.h.


Member Typedef Documentation

typedef std::pair<SUMOReal, int> MSLCM_DK2004::Info [protected]

Definition at line 142 of file MSLCM_DK2004.h.


Constructor & Destructor Documentation

Definition at line 70 of file MSLCM_DK2004.cpp.

Definition at line 75 of file MSLCM_DK2004.cpp.

References changed().


Member Function Documentation

bool MSLCM_DK2004::amBlockingFollower ( ) [inline, protected]
bool MSLCM_DK2004::amBlockingLeader ( ) [inline, protected]

Definition at line 123 of file MSLCM_DK2004.h.

References LCA_AMBLOCKINGLEADER, and MSAbstractLaneChangeModel::myOwnState.

virtual bool MSAbstractLaneChangeModel::congested ( const MSVehicle *const  neighLeader) [inline, protected, virtual, inherited]
bool MSLCM_DK2004::currentDistAllows ( SUMOReal  dist,
int  laneOffset,
SUMOReal  lookForwardDist 
) [inline, protected]

Definition at line 138 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 135 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.

Parameters:
requestindicates the request that was fulfilled

Definition at line 255 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myChangeRequest, and MSVehicle::REQUEST_NONE.

Referenced by MSLaneChanger::change().

Definition at line 112 of file MSLCM_DK2004.h.

References myChangeProbability.

Definition at line 660 of file MSLCM_DK2004.cpp.

References myChangeProbability.

void * MSLCM_DK2004::inform ( void *  info,
MSVehicle sender 
) [virtual]

Implements MSAbstractLaneChangeModel.

Definition at line 601 of file MSLCM_DK2004.cpp.

References MSAbstractLaneChangeModel::myOwnState.

SUMOReal MSLCM_DK2004::patchSpeed ( const SUMOReal  min,
const SUMOReal  wanted,
const SUMOReal  max,
const MSCFModel cfModel 
) [virtual]
void MSLCM_DK2004::prepareStep ( ) [virtual]

Reimplemented from MSAbstractLaneChangeModel.

Definition at line 651 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

Parameters:
requestindicates the requested change

Definition at line 245 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myChangeRequest.

Referenced by MSVehicle::enterLaneAtLaneChange(), and MSVehicle::enterLaneAtMove().

void MSAbstractLaneChangeModel::setOwnState ( int  state) [inline, inherited]

Definition at line 190 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 298 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(), MSVehicleType::getMinGap(), 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 81 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(), MSVehicleType::getMinGap(), 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.


Field Documentation

The vehicle's car following model.

Definition at line 307 of file MSAbstractLaneChangeModel.h.

Referenced by informBlocker(), MSAbstractLaneChangeModel::predInteraction(), wantsChangeToLeft(), and wantsChangeToRight().

std::vector<SUMOReal> MSLCM_DK2004::myVSafes [protected]

The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines