45 std::vector<std::string>
47 std::vector<std::string> ids;
60 VehicleType::getLength(
const std::string& typeID) {
66 VehicleType::getMaxSpeed(
const std::string& typeID) {
72 VehicleType::getActionStepLength(
const std::string& typeID) {
78 VehicleType::getSpeedFactor(
const std::string& typeID) {
84 VehicleType::getSpeedDeviation(
const std::string& typeID) {
90 VehicleType::getAccel(
const std::string& typeID) {
96 VehicleType::getDecel(
const std::string& typeID) {
102 VehicleType::getEmergencyDecel(
const std::string& typeID) {
108 VehicleType::getApparentDecel(
const std::string& typeID) {
114 VehicleType::getImperfection(
const std::string& typeID) {
120 VehicleType::getTau(
const std::string& typeID) {
126 VehicleType::getVehicleClass(
const std::string& typeID) {
132 VehicleType::getEmissionClass(
const std::string& typeID) {
138 VehicleType::getShapeClass(
const std::string& typeID) {
144 VehicleType::getMinGap(
const std::string& typeID) {
150 VehicleType::getWidth(
const std::string& typeID) {
156 VehicleType::getHeight(
const std::string& typeID) {
162 VehicleType::getColor(
const std::string& typeID) {
168 VehicleType::getMinGapLat(
const std::string& typeID) {
174 VehicleType::getMaxSpeedLat(
const std::string& typeID) {
180 VehicleType::getLateralAlignment(
const std::string& typeID) {
191 VehicleType::getPersonCapacity(
const std::string& typeID) {
196 VehicleType::setLength(
const std::string& typeID,
double length) {
202 VehicleType::setMaxSpeed(
const std::string& typeID,
double speed) {
208 VehicleType::setActionStepLength(
const std::string& typeID,
double actionStepLength,
bool resetActionOffset) {
214 VehicleType::setVehicleClass(
const std::string& typeID,
const std::string& clazz) {
220 VehicleType::setSpeedFactor(
const std::string& typeID,
double factor) {
232 VehicleType::setEmissionClass(
const std::string& typeID,
const std::string& clazz) {
238 VehicleType::setShapeClass(
const std::string& typeID,
const std::string& shapeClass) {
244 VehicleType::setWidth(
const std::string& typeID,
double width) {
250 VehicleType::setHeight(
const std::string& typeID,
double height) {
256 VehicleType::setMinGap(
const std::string& typeID,
double minGap) {
262 VehicleType::setAccel(
const std::string& typeID,
double accel) {
268 VehicleType::setDecel(
const std::string& typeID,
double decel) {
275 WRITE_WARNING(
"Automatically setting emergencyDecel to " +
toString(decel) +
" for vType '" + typeID +
"' to match decel.");
283 VehicleType::setEmergencyDecel(
const std::string& typeID,
double decel) {
286 if (decel < v->getCarFollowModel().getMaxDecel()) {
293 VehicleType::setApparentDecel(
const std::string& typeID,
double decel) {
299 VehicleType::setImperfection(
const std::string& typeID,
double imperfection) {
305 VehicleType::setTau(
const std::string& typeID,
double tau) {
311 VehicleType::setColor(
const std::string& typeID,
const TraCIColor& c) {
317 VehicleType::setMinGapLat(
const std::string& typeID,
double minGapLat) {
323 VehicleType::setMaxSpeedLat(
const std::string& typeID,
double speed) {
329 VehicleType::setLateralAlignment(
const std::string& typeID,
const std::string& latAlignment) {
359 std::shared_ptr<VariableWrapper>
373 return wrapper->
wrapDouble(objID, variable, getLength(objID));
375 return wrapper->
wrapDouble(objID, variable, getHeight(objID));
377 return wrapper->
wrapDouble(objID, variable, getMinGap(objID));
379 return wrapper->
wrapDouble(objID, variable, getMaxSpeed(objID));
381 return wrapper->
wrapDouble(objID, variable, getAccel(objID));
383 return wrapper->
wrapDouble(objID, variable, getDecel(objID));
385 return wrapper->
wrapDouble(objID, variable, getEmergencyDecel(objID));
387 return wrapper->
wrapDouble(objID, variable, getApparentDecel(objID));
389 return wrapper->
wrapDouble(objID, variable, getActionStepLength(objID));
391 return wrapper->
wrapDouble(objID, variable, getImperfection(objID));
393 return wrapper->
wrapDouble(objID, variable, getTau(objID));
395 return wrapper->
wrapDouble(objID, variable, getSpeedFactor(objID));
397 return wrapper->
wrapDouble(objID, variable, getSpeedDeviation(objID));
399 return wrapper->
wrapString(objID, variable, getVehicleClass(objID));
401 return wrapper->
wrapString(objID, variable, getEmissionClass(objID));
403 return wrapper->
wrapString(objID, variable, getShapeClass(objID));
405 return wrapper->
wrapDouble(objID, variable, getWidth(objID));
407 return wrapper->
wrapColor(objID, variable, getColor(objID));
409 return wrapper->
wrapDouble(objID, variable, getMinGapLat(objID));
411 return wrapper->
wrapDouble(objID, variable, getMaxSpeedLat(objID));
413 return wrapper->
wrapString(objID, variable, getLateralAlignment(objID));
415 return wrapper->
wrapInt(objID, variable, getPersonCapacity(objID));
TRACI_CONST int VAR_APPARENT_DECEL
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
double getApparentDecel() const
Get the vehicle type's apparent deceleration [m/s^2] (the one regarded by its followers.
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int VAR_EMISSIONCLASS
TRACI_CONST int VAR_MINGAP
TRACI_CONST int VAR_MAXSPEED_LAT
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
TRACI_CONST int VAR_ACTIONSTEPLENGTH
static TraCIColor makeTraCIColor(const RGBColor &color)
TRACI_CONST int VAR_COLOR
TRACI_CONST int VAR_WIDTH
void setTau(double tau)
Set a new value for this type's headway.
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
Structure representing possible vehicle parameter.
virtual double getImperfection() const
Get the driver's imperfection.
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, std::mt19937 *rng=nullptr)
Returns the named vehicle type or a sample from the named distribution.
void setDecel(double decel)
Set a new value for this type's deceleration.
static ContextSubscriptionResults myContextSubscriptionResults
TRACI_CONST int VAR_MINGAP_LAT
TRACI_CONST int VAR_VEHICLECLASS
static void setSpeedDeviation(const std::string &typeID, double deviation)
static LIBSUMO_VEHICLE_TYPE_GETTER std::string getParameter(const std::string &typeID, const std::string &key)
static SUMOTime processActionStepLength(double given)
Checks and converts given value for the action step length from seconds to miliseconds assuring it be...
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
std::vector< double > & getParameter()
Returns the parameters of this distribution.
static SubscriptionResults mySubscriptionResults
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
void setLength(const double &length)
Set a new value for this type's length.
virtual bool wrapString(const std::string &objID, const int variable, const std::string &value)=0
TRACI_CONST int VAR_MAXSPEED
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
void setImperfection(double imperfection)
Set a new value for this type's imperfection.
int getPersonCapacity() const
Get this vehicle type's person capacity.
MSVehicleType * duplicateType(const std::string &id, bool persistent) const
Duplicates the microsim vehicle type giving the newly created type the given id.
#define WRITE_WARNING(msg)
The car-following model and parameter.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
TRACI_CONST int VAR_LATALIGNMENT
static LIBSUMO_SUBSCRIPTION_API std::shared_ptr< VariableWrapper > makeWrapper()
TRACI_CONST int VAR_ACCEL
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
static RGBColor makeRGBColor(const TraCIColor &color)
TRACI_CONST int TRACI_ID_LIST
static MSVehicleType * getVType(std::string id)
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void setAccel(double accel)
Set a new value for this type's acceleration.
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
void setHeight(const double &height)
Set a new value for this type's height.
static LIBSUMO_VEHICLE_TYPE_SETTER void copy(const std::string &origTypeID, const std::string &newTypeID)
TRACI_CONST int VAR_LENGTH
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
void setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
double getMinGap() const
Get the free space in front of vehicles of this class.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
void setSpeedDeviation(const double &dev)
Set a new value for this type's speed deviation.
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
const SUMOVTypeParameter & getParameter() const
void insertVTypeIDs(std::vector< std::string > &into) const
Inserts ids of all known vehicle types and vehicle type distributions to the given vector...
TRACI_CONST int VAR_SPEED_DEVIATION
void setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset)
Set a new value for this type's action step length.
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
TRACI_CONST int VAR_EMERGENCY_DECEL
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
static void setParameter(const std::string &id, const std::string &name, const std::string &value)
TRACI_CONST int VAR_SPEED_FACTOR
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
void setEmergencyDecel(double emergencyDecel)
Set a new value for this type's emergency deceleration.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
virtual bool wrapColor(const std::string &objID, const int variable, const TraCIColor &value)=0
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
TRACI_CONST int VAR_PERSON_CAPACITY
SubParams cfParameter
Car-following parameter.
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
void setWidth(const double &width)
Set a new value for this type's width.
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
double getLength() const
Get vehicle's length [m].
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
TRACI_CONST int VAR_SHAPECLASS
void setColor(const RGBColor &color)
Set a new value for this type's color.
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
TRACI_CONST int VAR_HEIGHT
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
TRACI_CONST int VAR_IMPERFECTION
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
TRACI_CONST int VAR_DECEL
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
static std::vector< std::string > getIDList()