54 std::ostringstream internals;
64 const std::string cfmID = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
65 if (cfmID !=
"BKerner") {
66 throw ProcessError(
TLF(
"incompatible carFollowModel '%' when loading state for BKerner", cfmID));
104 if (predSpeed == 0 && gap < 0.01) {
112 double va =
MAX2((
double) 0,
MIN3(vfree, vsafe, vcond)) + vars->
rand;
@ SUMO_ATTR_CF_KERNER_PHI
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
@ SUMO_ATTR_STATE
The state of a link.
T MIN4(T a, T b, T c, T d)
void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the vehicle variables from the given description.
void saveState(OutputDevice &out, const MSCFModel &cfm) const
Saves the vehicle variables.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
~MSCFModel_Kerner()
Destructor.
double myTauDecel
The precomputed value for myDecel*myTau.
double myPhi
Kerner's phi.
double _v(const MSVehicle *const veh, double speed, double vfree, double gap, double predSpeed) const
Returns the "safe" velocity.
double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred, double decel, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling).
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed (no dawdling).
MSCFModel::VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
MSCFModel_Kerner(const MSVehicleType *vtype)
Constructor.
The car-following model abstraction.
virtual double maxNextSpeed(double speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
virtual std::string getParameter(const MSVehicle *veh, const std::string &key) const
try to get the given parameter for this carFollowingModel
virtual double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences. Called at most once per simulation...
CalcReason
What the return value of stop/follow/free-Speed is used for.
double myCollisionMinGapFactor
The factor of minGap that must be maintained to avoid a collision event.
MSCFModel(const MSVehicleType *vtype)
Constructor.
double myDecel
The vehicle's maximum deceleration [m/s^2].
double myAccel
The vehicle's maximum acceleration [m/s^2].
double myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
Representation of a vehicle in the micro simulation.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
The car-following model and parameter.
const SUMOVTypeParameter & getParameter() const
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static double rand(SumoRNG *rng=nullptr)
Returns a random real number in [0, 1).
Encapsulated SAX-Attributes.
virtual std::string getString(int id, bool *isPresent=nullptr) const =0
Returns the string-value of the named (by its enum-value) attribute.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.