SUMO - Simulation of Urban MObility
MSAbstractLaneChangeModel Class Reference

Interface for lane-change models. More...

#include <MSAbstractLaneChangeModel.h>

Inheritance diagram for MSAbstractLaneChangeModel:
MSLCM_DK2004

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 MSCFModelmyCarFollowModel
 The vehicle's car following model.
MSVehicle::ChangeRequest myChangeRequest
int myOwnState
 The current state of the vehicle.
MSVehiclemyVehicle
 The vehicle this lane-changer belongs to.

Detailed Description

Interface for lane-change models.

Definition at line 103 of file MSAbstractLaneChangeModel.h.


Constructor & Destructor Documentation

Constructor.

Parameters:
[in]vThe vehicle this lane-changer belongs to

Definition at line 172 of file MSAbstractLaneChangeModel.h.

Destructor.

Definition at line 182 of file MSAbstractLaneChangeModel.h.


Member Function Documentation

virtual void MSAbstractLaneChangeModel::changed ( ) [pure virtual]

Implemented in MSLCM_DK2004.

Referenced by MSLaneChanger::change().

virtual bool MSAbstractLaneChangeModel::congested ( const MSVehicle *const  neighLeader) [inline, protected, virtual]

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 myChangeRequest, and MSVehicle::REQUEST_NONE.

Referenced by MSLaneChanger::change().

virtual SUMOReal MSAbstractLaneChangeModel::patchSpeed ( const SUMOReal  min,
const SUMOReal  wanted,
const SUMOReal  max,
const MSCFModel cfModel 
) [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.

Parameters:
minThe minimum resulting speed
wantedThe aspired speed of the car following model
maxThe maximum resulting speed
cfModelThe model used
Returns:
the new speed of the vehicle as proposed by the lane changer

Implemented in MSLCM_DK2004.

Referenced by MSCFModel_KraussOrig1::moveHelper(), and MSCFModel::moveHelper().

virtual void MSAbstractLaneChangeModel::prepareStep ( ) [inline, virtual]

Reimplemented in MSLCM_DK2004.

Definition at line 194 of file MSAbstractLaneChangeModel.h.

Referenced by MSLaneChanger::change().

virtual void MSAbstractLaneChangeModel::requestLaneChange ( MSVehicle::ChangeRequest  request) [inline, virtual]

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 myChangeRequest.

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

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

Definition at line 190 of file MSAbstractLaneChangeModel.h.

References myOwnState.

Referenced by MSLaneChanger::change().

virtual int MSAbstractLaneChangeModel::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 
) [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().

virtual int MSAbstractLaneChangeModel::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 
) [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().


Field Documentation


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