21 #ifndef MSLCM_DK2008_h 22 #define MSLCM_DK2008_h 59 const std::pair<MSVehicle*, double>& leader,
60 const std::pair<MSVehicle*, double>& neighLead,
61 const std::pair<MSVehicle*, double>& neighFollow,
63 const std::vector<MSVehicle::LaneQ>& preb,
77 virtual double patchSpeed(
const double min,
const double wanted,
const double max,
91 const std::pair<MSVehicle*, double>& leader,
92 const std::pair<MSVehicle*, double>& neighLead,
93 const std::pair<MSVehicle*, double>& neighFollow,
95 const std::vector<MSVehicle::LaneQ>& preb,
104 const std::pair<MSVehicle*, double>& leader,
105 const std::pair<MSVehicle*, double>& neighLead,
106 const std::pair<MSVehicle*, double>& neighFollow,
108 const std::vector<MSVehicle::LaneQ>& preb,
113 int& blocked,
int dir,
114 const std::pair<MSVehicle*, double>& neighLead,
115 const std::pair<MSVehicle*, double>& neighFollow);
130 return dist / (abs(laneOffset)) < lookForwardDist;
133 return dist / abs(laneOffset) > lookForwardDist;
136 typedef std::pair<double, int>
Info;
double myChangeProbability
Representation of a vehicle in the micro simulation.
bool amBlockingFollowerNB()
bool amBlockingFollower()
The car-following model abstraction.
virtual void prepareStep()
bool currentDistDisallows(double dist, int laneOffset, double lookForwardDist)
virtual double patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel)
Called to adapt the speed in order to allow a lane change.
MSLCM_DK2008(MSVehicle &v)
virtual int wantsChangeToRight(MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, double > &leader, const std::pair< MSVehicle *, double > &neighLead, const std::pair< MSVehicle *, double > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked)
Called to examine whether the vehicle wants to change to right This method gets the information about...
A class responsible for exchanging messages between cars involved in lane-change interaction.
virtual int wantsChangeToLeft(MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, double > &leader, const std::pair< MSVehicle *, double > &neighLead, const std::pair< MSVehicle *, double > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked)
Called to examine whether the vehicle wants to change to left This method gets the information about ...
bool amBlockingFollowerPlusNB()
int myOwnState
The current state of the vehicle.
int wantsChange(int laneOffset, MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, double > &leader, const std::pair< MSVehicle *, double > &neighLead, const std::pair< MSVehicle *, double > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked)
Called to examine whether the vehicle wants to change using the given laneOffset. This method gets th...
bool currentDistAllows(double dist, int laneOffset, double lookForwardDist)
double myLeadingBlockerLength
std::vector< double > myVSafes
A lane change model developed by D. Krajzewicz between 2004 and 2010.
std::pair< double, int > Info
Representation of a lane in the micro simulation.
virtual void * inform(void *info, MSVehicle *sender)
void informBlocker(MSAbstractLaneChangeModel::MSLCMessager &msgPass, int &blocked, int dir, const std::pair< MSVehicle *, double > &neighLead, const std::pair< MSVehicle *, double > &neighFollow)
Interface for lane-change models.
LaneChangeModel getModelID() const
Returns the model's id.