SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

bool alreadyMoved () const
 reset the flag whether a vehicle already moved to false More...
 
virtual void changed ()
 
void continueLaneChangeManeuver (bool moved)
 
void endLaneChangeManeuver ()
 
virtual void fulfillChangeRequest (MSVehicle::ChangeRequest request)
 
SUMOReal getChangeProbability () const
 
SUMOReal getLaneChangeCompletion () const
 return whether the vehicle passed the midpoint of a continuous lane change maneuver More...
 
int getLaneChangeDirection () const
 return the direction of the current lane change maneuver More...
 
SUMOTime getLastLaneChangeOffset () const
 
int getOwnState () const
 
SUMOReal getProb () const
 
MSLanegetShadowLane () const
 Returns the lane the vehicles shadow is on during continuouss lane change. More...
 
virtual void * inform (void *info, MSVehicle *sender)
 
bool isChangingLanes () const
 return true if the vehicle currently performs a lane change maneuver More...
 
bool isLaneChangeMidpointPassed () const
 return whether the vehicle passed the midpoint of a continuous lane change maneuver More...
 
 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. More...
 
virtual void prepareStep ()
 
void removeLaneChangeShadow ()
 remove the shadow copy of a lane change maneuver More...
 
virtual void requestLaneChange (MSVehicle::ChangeRequest request)
 
void resetMoved ()
 reset the flag whether a vehicle already moved to false More...
 
void setOwnState (int state)
 
bool startLaneChangeManeuver (MSLane *source, MSLane *target, int direction)
 start the lane change maneuver and return whether it continues More...
 
void unchanged ()
 
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. More...
 
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. More...
 
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

bool myAlreadyMoved
 whether the vehicle has already moved this step More...
 
const MSCFModelmyCarFollowModel
 The vehicle's car following model. More...
 
SUMOReal myChangeProbability
 
MSVehicle::ChangeRequest myChangeRequest
 
bool myDontBrake
 
bool myHaveShadow
 Wether a vehicle shadow exists. More...
 
SUMOReal myLaneChangeCompletion
 progress of the lane change maneuver 0:started, 1:complete More...
 
int myLaneChangeDirection
 direction of the lane change maneuver -1 means right, 1 means left More...
 
bool myLaneChangeMidpointPassed
 whether myLane has already been set to the target of the lane-change maneuver More...
 
SUMOTime myLastLaneChangeOffset
 information how long ago the vehicle has performed a lane-change More...
 
SUMOReal myLeadingBlockerLength
 
SUMOReal myLeftSpace
 
int myOwnState
 The current state of the vehicle. More...
 
MSLanemyShadowLane
 The lane the vehicle shadow is on during a continuous lane change. More...
 
MSVehiclemyVehicle
 The vehicle this lane-changer belongs to. More...
 
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

MSLCM_DK2004::MSLCM_DK2004 ( MSVehicle v)

Definition at line 71 of file MSLCM_DK2004.cpp.

MSLCM_DK2004::~MSLCM_DK2004 ( )
virtual

Definition at line 76 of file MSLCM_DK2004.cpp.

References changed().

Member Function Documentation

bool MSAbstractLaneChangeModel::alreadyMoved ( ) const
inlineinherited

reset the flag whether a vehicle already moved to false

Definition at line 265 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myAlreadyMoved.

Referenced by MSLane::executeMovements().

bool MSLCM_DK2004::amBlockingFollower ( )
inlineprotected
bool MSLCM_DK2004::amBlockingFollowerNB ( )
inlineprotected
bool MSLCM_DK2004::amBlockingFollowerPlusNB ( )
inlineprotected
bool MSLCM_DK2004::amBlockingLeader ( )
inlineprotected

Definition at line 123 of file MSLCM_DK2004.h.

References LCA_AMBLOCKINGLEADER, and MSAbstractLaneChangeModel::myOwnState.

bool MSAbstractLaneChangeModel::congested ( const MSVehicle *const  neighLeader)
protectedvirtualinherited
bool MSLCM_DK2004::currentDistAllows ( SUMOReal  dist,
int  laneOffset,
SUMOReal  lookForwardDist 
)
inlineprotected

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 
)
inlineprotected

Definition at line 135 of file MSLCM_DK2004.h.

References abs.

Referenced by wantsChangeToLeft(), and wantsChangeToRight().

virtual void MSAbstractLaneChangeModel::fulfillChangeRequest ( MSVehicle::ChangeRequest  request)
inlinevirtualinherited

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 312 of file MSAbstractLaneChangeModel.h.

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

Referenced by MSLaneChanger::change().

SUMOReal MSLCM_DK2004::getChangeProbability ( ) const
inline

Definition at line 112 of file MSLCM_DK2004.h.

References myChangeProbability.

SUMOReal MSAbstractLaneChangeModel::getLaneChangeCompletion ( ) const
inlineinherited

return whether the vehicle passed the midpoint of a continuous lane change maneuver

Definition at line 250 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myLaneChangeCompletion.

Referenced by MSVehicle::getAngle().

int MSAbstractLaneChangeModel::getLaneChangeDirection ( ) const
inlineinherited

return the direction of the current lane change maneuver

Definition at line 260 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myLaneChangeDirection.

Referenced by MSVehicle::getAngle().

SUMOTime MSAbstractLaneChangeModel::getLastLaneChangeOffset ( ) const
inlineinherited
int MSAbstractLaneChangeModel::getOwnState ( ) const
inlineinherited
SUMOReal MSLCM_DK2004::getProb ( ) const

Definition at line 666 of file MSLCM_DK2004.cpp.

References myChangeProbability.

MSLane* MSAbstractLaneChangeModel::getShadowLane ( ) const
inlineinherited

Returns the lane the vehicles shadow is on during continuouss lane change.

Returns
The vehicle's shadow lane

Definition at line 234 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myShadowLane.

Referenced by MSLane::executeMovements(), and MSVehicle::getPosition().

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

Implements MSAbstractLaneChangeModel.

Definition at line 604 of file MSLCM_DK2004.cpp.

References MSAbstractLaneChangeModel::myOwnState.

bool MSAbstractLaneChangeModel::isChangingLanes ( ) const
inlineinherited

return true if the vehicle currently performs a lane change maneuver

Definition at line 255 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myLaneChangeCompletion, and NUMERICAL_EPS.

Referenced by MSLaneChanger::change(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), MSLane::executeMovements(), and MSVehicle::getAngle().

bool MSAbstractLaneChangeModel::isLaneChangeMidpointPassed ( ) const
inlineinherited

return whether the vehicle passed the midpoint of a continuous lane change maneuver

Definition at line 245 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myLaneChangeMidpointPassed.

Referenced by MSVehicle::getAngle(), MSVehicle::getPosition(), and MSVehicle::planMoveInternal().

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 655 of file MSLCM_DK2004.cpp.

References myChangeProbability, myDontBrake, myLeadingBlockerLength, myLeftSpace, and myVSafes.

virtual void MSAbstractLaneChangeModel::requestLaneChange ( MSVehicle::ChangeRequest  request)
inlinevirtualinherited

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 302 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myChangeRequest.

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

void MSAbstractLaneChangeModel::resetMoved ( )
inlineinherited

reset the flag whether a vehicle already moved to false

Definition at line 270 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myAlreadyMoved.

Referenced by MSVehicle::planMove().

void MSAbstractLaneChangeModel::setOwnState ( int  state)
inlineinherited

Definition at line 179 of file MSAbstractLaneChangeModel.h.

References MSAbstractLaneChangeModel::myOwnState.

Referenced by MSLaneChanger::change().

void MSAbstractLaneChangeModel::unchanged ( )
inlineinherited
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 301 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(), MSVehicleType::getMinGap(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSLane::getVehicleMaxSpeed(), 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, SUMO_const_haltingSpeed, 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 82 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(), MSVehicleType::getMinGap(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSLane::getVehicleMaxSpeed(), 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, SUMO_const_haltingSpeed, and SUMOReal.

Field Documentation

bool MSAbstractLaneChangeModel::myAlreadyMoved
protectedinherited
const MSCFModel& MSAbstractLaneChangeModel::myCarFollowModel
protectedinherited

The vehicle's car following model.

Definition at line 358 of file MSAbstractLaneChangeModel.h.

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

SUMOReal MSLCM_DK2004::myChangeProbability
protected
bool MSLCM_DK2004::myDontBrake
protected
bool MSAbstractLaneChangeModel::myHaveShadow
protectedinherited
int MSAbstractLaneChangeModel::myLaneChangeDirection
protectedinherited
bool MSAbstractLaneChangeModel::myLaneChangeMidpointPassed
protectedinherited

whether myLane has already been set to the target of the lane-change maneuver

Definition at line 342 of file MSAbstractLaneChangeModel.h.

Referenced by MSAbstractLaneChangeModel::continueLaneChangeManeuver(), MSAbstractLaneChangeModel::isLaneChangeMidpointPassed(), and MSAbstractLaneChangeModel::startLaneChangeManeuver().

SUMOTime MSAbstractLaneChangeModel::myLastLaneChangeOffset
protectedinherited
SUMOReal MSLCM_DK2004::myLeadingBlockerLength
protected
SUMOReal MSLCM_DK2004::myLeftSpace
protected
std::vector<SUMOReal> MSLCM_DK2004::myVSafes
protected

The documentation for this class was generated from the following files: