MSAbstractLaneChangeModel Class Reference

#include <MSAbstractLaneChangeModel.h>

Inheritance diagram for MSAbstractLaneChangeModel:

MSLCM_DK2004

Detailed Description

Definition at line 65 of file MSAbstractLaneChangeModel.h.


Public Member Functions

virtual void changed ()=0
virtual void fulfillChangeRequest (ChangeRequest request)
int getState () const
virtual void * inform (void *info, MSVehicle *sender)=0
 MSAbstractLaneChangeModel (MSVehicle &v)
virtual SUMOReal patchSpeed (SUMOReal min, SUMOReal wanted, SUMOReal max, SUMOReal vsafe)=0
virtual void prepareStep ()
virtual void requestLaneChange (ChangeRequest request)
void setState (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 ()

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.
ChangeRequest myChangeRequest
int myState
MSVehiclemyVehicle

Data Structures

class  MSLCMessager

Constructor & Destructor Documentation

MSAbstractLaneChangeModel::MSAbstractLaneChangeModel ( MSVehicle v  )  [inline]

Definition at line 98 of file MSAbstractLaneChangeModel.h.

00099             : myVehicle(v), myState(0),
00100 #ifndef NO_TRACI
00101             myChangeRequest(REQUEST_NONE),
00102 #endif
00103             myCarFollowModel(v.getCarFollowModel()) {
00104     }

virtual MSAbstractLaneChangeModel::~MSAbstractLaneChangeModel (  )  [inline, virtual]

Definition at line 106 of file MSAbstractLaneChangeModel.h.

00106 { }


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]

Definition at line 174 of file MSAbstractLaneChangeModel.h.

References MSVehicle::congested(), MSVehicle::getLane(), MSLane::getMaxSpeed(), and myVehicle.

Referenced by MSLCM_DK2004::wantsChangeToLeft(), and MSLCM_DK2004::wantsChangeToRight().

00174                                                                 {
00175         if (neighLeader==0) {
00176             return false;
00177         }
00178         // Congested situation are relevant only on highways (maxSpeed > 70km/h)
00179         // and congested on German Highways means that the vehicles have speeds
00180         // below 60km/h. Overtaking on the right is allowed then.
00181         if ((myVehicle.getLane().getMaxSpeed() <= 70.0 / 3.6) ||
00182                 (neighLeader->getLane().getMaxSpeed() <= 70.0 / 3.6)) {
00183 
00184             return false;
00185         }
00186         if (myVehicle.congested() && neighLeader->congested()) {
00187             return true;
00188         }
00189         return false;
00190     }

virtual void MSAbstractLaneChangeModel::fulfillChangeRequest ( ChangeRequest  request  )  [inline, 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:
request indicates the request that was fulfilled

Definition at line 166 of file MSAbstractLaneChangeModel.h.

References myChangeRequest, and REQUEST_NONE.

Referenced by MSLaneChanger::change().

00166                                                              {
00167         if (request == myChangeRequest) {
00168             myChangeRequest = REQUEST_NONE;
00169         }
00170     }

int MSAbstractLaneChangeModel::getState (  )  const [inline]

Definition at line 108 of file MSAbstractLaneChangeModel.h.

References myState.

Referenced by MSLaneChanger::change(), and GUIVehicle::setBlinkerInformation().

00108                          {
00109         return myState;
00110     }

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

virtual SUMOReal MSAbstractLaneChangeModel::patchSpeed ( SUMOReal  min,
SUMOReal  wanted,
SUMOReal  max,
SUMOReal  vsafe 
) [pure virtual]

Implemented in MSLCM_DK2004.

virtual bool MSAbstractLaneChangeModel::predInteraction ( const MSVehicle *const   leader  )  [inline, protected, virtual]

Definition at line 192 of file MSAbstractLaneChangeModel.h.

References MSVehicleType::getLength(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSVehicle::getVehicleType(), MSCFModel::interactionGap(), myCarFollowModel, myVehicle, and SUMOReal.

Referenced by MSLCM_DK2004::wantsChangeToLeft(), and MSLCM_DK2004::wantsChangeToRight().

00192                                                                  {
00193         if (leader==0) {
00194             return false;
00195         }
00196         // let's check it on highways only
00197         if (leader->getSpeed()<(80.0*3.6)) {
00198             return false;
00199         }
00200         SUMOReal gap = leader->getPositionOnLane() - leader->getVehicleType().getLength() - myVehicle.getPositionOnLane();
00201         return gap < myCarFollowModel.interactionGap(&myVehicle, leader->getSpeed());
00202     }

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

Reimplemented in MSLCM_DK2004.

Definition at line 116 of file MSAbstractLaneChangeModel.h.

Referenced by MSLaneChanger::change().

00116 { }

virtual void MSAbstractLaneChangeModel::requestLaneChange ( 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:
request indicates the requested change

Definition at line 156 of file MSAbstractLaneChangeModel.h.

References myChangeRequest.

Referenced by MSVehicle::checkForLaneChanges().

00156                                                           {
00157         myChangeRequest = request;
00158     };

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

Definition at line 112 of file MSAbstractLaneChangeModel.h.

References myState.

Referenced by MSLaneChanger::change().

00112                              {
00113         myState = state;
00114     }

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::advan2left().

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::advan2right().


Field Documentation


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

Generated on Wed May 5 00:06:46 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6