40 #define INVALID_SPEED 299792458 + 1 // nothing can go faster than the speed of light! 103 SUMOReal maxSpeed,
const bool onInsertion =
false)
const;
SUMOReal getSpeedAfterMaxDecel(SUMOReal v) const
Returns the velocity after maximum deceleration.
Representation of a vehicle in the micro simulation.
const MSVehicleType * myType
The type to which this model definition belongs to.
virtual SUMOReal insertionFollowSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle's safe speed (no dawdling) This method is used during the insertion stage...
SUMOReal maximumSafeStopSpeedBallistic(SUMOReal gap, SUMOReal currentSpeed, bool onInsertion=false, SUMOReal headway=-1) const
Returns the maximum next velocity for stopping within gap when using the ballistic positional update...
virtual void setMaxDecel(SUMOReal decel)
Sets a new value for maximum deceleration [m/s^2].
virtual ~VehicleVariables()
virtual SUMOReal getImperfection() const
Get the driver's imperfection.
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const =0
Duplicates the car-following model.
virtual SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const =0
Computes the vehicle's follow speed (no dawdling)
The car-following model abstraction.
virtual SUMOReal moveHelper(MSVehicle *const veh, SUMOReal vPos) const
Applies interaction with stops and lane changing model influences.
SUMOReal myAccel
The vehicle's maximum acceleration [m/s^2].
SUMOReal getMaxDecel() const
Get the vehicle type's maximum deceleration [m/s^2].
virtual VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting...
MSCFModel(const MSVehicleType *vtype, SUMOReal accel, SUMOReal decel, SUMOReal headwayTime)
Constructor.
SUMOReal myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
virtual void setMaxAccel(SUMOReal accel)
Sets a new value for maximum acceleration [m/s^2].
#define UNUSED_PARAMETER(x)
SUMOReal getSecureGap(const SUMOReal speed, const SUMOReal leaderSpeed, const SUMOReal leaderMaxDecel) const
Returns the minimum gap to reserve if the leader is braking at maximum (>=0)
SUMOReal maximumSafeStopSpeedEuler(SUMOReal gap) const
Returns the maximum next velocity for stopping within gap when using the semi-implicit Euler update...
SUMOReal minNextSpeed(SUMOReal speed, const MSVehicle *const veh=0) const
Returns the minimum speed given the current speed (depends on the numerical update scheme and its ste...
The car-following model and parameter.
SUMOReal getMinimalArrivalSpeedEuler(SUMOReal dist, SUMOReal currentSpeed) const
Computes the minimal possible arrival speed after covering a given distance for Euler update...
static SUMOReal speedAfterTime(const SUMOReal t, const SUMOReal oldSpeed, const SUMOReal dist)
Calculates the speed after a time t [0,TS] given the initial speed and the distance traveled in an i...
SUMOTime getMinimalArrivalTime(SUMOReal dist, SUMOReal currentSpeed, SUMOReal arrivalSpeed) const
Computes the minimal time needed to cover a distance given the desired speed at arrival.
virtual int getModelID() const =0
Returns the model's ID; the XML-Tag number is used.
virtual SUMOReal getHeadwayTime() const
Get the driver's reaction time [s].
virtual SUMOReal freeSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal seen, SUMOReal maxSpeed, const bool onInsertion=false) const
Computes the vehicle's safe speed without a leader.
static SUMOReal passingTime(const SUMOReal lastPos, const SUMOReal passedPos, const SUMOReal currentPos, const SUMOReal lastSpeed, const SUMOReal currentSpeed)
Calculates the time at which the position passedPosition has been passed In case of a ballistic updat...
SUMOReal getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
SUMOReal maximumSafeStopSpeed(SUMOReal gap, SUMOReal currentSpeed, bool onInsertion=false, SUMOReal headway=-1) const
Returns the maximum next velocity for stopping within gap.
SUMOReal maximumSafeFollowSpeed(SUMOReal gap, SUMOReal egoSpeed, SUMOReal predSpeed, SUMOReal predMaxDecel, bool onInsertion=false) const
Returns the maximum safe velocity for following the given leader.
SUMOReal brakeGap(const SUMOReal speed) const
Returns the distance the vehicle needs to halt including driver's reaction time, assuming that during...
virtual ~MSCFModel()
Destructor.
SUMOReal estimateSpeedAfterDistance(const SUMOReal dist, const SUMOReal v, const SUMOReal accel) const
virtual void setImperfection(SUMOReal imperfection)
Sets a new value for driver imperfection.
SUMOReal getMinimalArrivalSpeed(SUMOReal dist, SUMOReal currentSpeed) const
Computes the minimal possible arrival speed after covering a given distance.
virtual SUMOReal stopSpeed(const MSVehicle *const veh, const SUMOReal speed, SUMOReal gap) const =0
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) ...
static SUMOReal gapExtrapolation(const SUMOReal duration, const SUMOReal currentGap, SUMOReal v1, SUMOReal v2, SUMOReal a1=0, SUMOReal a2=0, const SUMOReal maxV1=std::numeric_limits< SUMOReal >::max(), const SUMOReal maxV2=std::numeric_limits< SUMOReal >::max())
return the resulting gap if, starting with gap currentGap, two vehicles continue with constant accele...
virtual SUMOReal maxNextSpeed(SUMOReal speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
virtual void setHeadwayTime(SUMOReal headwayTime)
Sets a new value for driver reaction time [s].
virtual SUMOReal interactionGap(const MSVehicle *const veh, SUMOReal vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
Representation of a lane in the micro simulation.
SUMOReal myDecel
The vehicle's maximum deceleration [m/s^2].
virtual SUMOReal insertionStopSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap) const
Computes the vehicle's safe speed for approaching an obstacle at insertion without constraints due to...