 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
44 std::vector<std::string>
46 std::vector<std::string> ids;
59 VehicleType::getLength(
const std::string& typeID) {
65 VehicleType::getMaxSpeed(
const std::string& typeID) {
71 VehicleType::getActionStepLength(
const std::string& typeID) {
77 VehicleType::getSpeedFactor(
const std::string& typeID) {
83 VehicleType::getSpeedDeviation(
const std::string& typeID) {
89 VehicleType::getAccel(
const std::string& typeID) {
95 VehicleType::getDecel(
const std::string& typeID) {
101 VehicleType::getEmergencyDecel(
const std::string& typeID) {
107 VehicleType::getApparentDecel(
const std::string& typeID) {
113 VehicleType::getImperfection(
const std::string& typeID) {
119 VehicleType::getTau(
const std::string& typeID) {
125 VehicleType::getVehicleClass(
const std::string& typeID) {
131 VehicleType::getEmissionClass(
const std::string& typeID) {
137 VehicleType::getShapeClass(
const std::string& typeID) {
143 VehicleType::getMinGap(
const std::string& typeID) {
149 VehicleType::getWidth(
const std::string& typeID) {
155 VehicleType::getHeight(
const std::string& typeID) {
161 VehicleType::getColor(
const std::string& typeID) {
167 VehicleType::getMinGapLat(
const std::string& typeID) {
173 VehicleType::getMaxSpeedLat(
const std::string& typeID) {
179 VehicleType::getLateralAlignment(
const std::string& typeID) {
190 VehicleType::getPersonCapacity(
const std::string& typeID) {
195 VehicleType::setLength(
const std::string& typeID,
double length) {
201 VehicleType::setMaxSpeed(
const std::string& typeID,
double speed) {
207 VehicleType::setActionStepLength(
const std::string& typeID,
double actionStepLength,
bool resetActionOffset) {
213 VehicleType::setVehicleClass(
const std::string& typeID,
const std::string& clazz) {
219 VehicleType::setSpeedFactor(
const std::string& typeID,
double factor) {
231 VehicleType::setEmissionClass(
const std::string& typeID,
const std::string& clazz) {
237 VehicleType::setShapeClass(
const std::string& typeID,
const std::string& shapeClass) {
243 VehicleType::setWidth(
const std::string& typeID,
double width) {
249 VehicleType::setHeight(
const std::string& typeID,
double height) {
255 VehicleType::setMinGap(
const std::string& typeID,
double minGap) {
261 VehicleType::setAccel(
const std::string& typeID,
double accel) {
267 VehicleType::setDecel(
const std::string& typeID,
double decel) {
274 WRITE_WARNING(
"Automatically setting emergencyDecel to " +
toString(decel) +
" for vType '" + typeID +
"' to match decel.");
282 VehicleType::setEmergencyDecel(
const std::string& typeID,
double decel) {
285 if (decel < v->getCarFollowModel().getMaxDecel()) {
292 VehicleType::setApparentDecel(
const std::string& typeID,
double decel) {
298 VehicleType::setImperfection(
const std::string& typeID,
double imperfection) {
304 VehicleType::setTau(
const std::string& typeID,
double tau) {
310 VehicleType::setColor(
const std::string& typeID,
const TraCIColor& c) {
316 VehicleType::setMinGapLat(
const std::string& typeID,
double minGapLat) {
322 VehicleType::setMaxSpeedLat(
const std::string& typeID,
double speed) {
328 VehicleType::setLateralAlignment(
const std::string& typeID,
const std::string& latAlignment) {
358 std::shared_ptr<VariableWrapper>
372 return wrapper->
wrapDouble(objID, variable, getLength(objID));
374 return wrapper->
wrapDouble(objID, variable, getHeight(objID));
376 return wrapper->
wrapDouble(objID, variable, getMinGap(objID));
378 return wrapper->
wrapDouble(objID, variable, getMaxSpeed(objID));
380 return wrapper->
wrapDouble(objID, variable, getAccel(objID));
382 return wrapper->
wrapDouble(objID, variable, getDecel(objID));
384 return wrapper->
wrapDouble(objID, variable, getEmergencyDecel(objID));
386 return wrapper->
wrapDouble(objID, variable, getApparentDecel(objID));
388 return wrapper->
wrapDouble(objID, variable, getActionStepLength(objID));
390 return wrapper->
wrapDouble(objID, variable, getImperfection(objID));
392 return wrapper->
wrapDouble(objID, variable, getTau(objID));
394 return wrapper->
wrapDouble(objID, variable, getSpeedFactor(objID));
396 return wrapper->
wrapDouble(objID, variable, getSpeedDeviation(objID));
398 return wrapper->
wrapString(objID, variable, getVehicleClass(objID));
400 return wrapper->
wrapString(objID, variable, getEmissionClass(objID));
402 return wrapper->
wrapString(objID, variable, getShapeClass(objID));
404 return wrapper->
wrapDouble(objID, variable, getWidth(objID));
406 return wrapper->
wrapColor(objID, variable, getColor(objID));
408 return wrapper->
wrapDouble(objID, variable, getMinGapLat(objID));
410 return wrapper->
wrapDouble(objID, variable, getMaxSpeedLat(objID));
412 return wrapper->
wrapString(objID, variable, getLateralAlignment(objID));
414 return wrapper->
wrapInt(objID, variable, getPersonCapacity(objID));
The car-following model and parameter.
void setHeight(const double &height)
Set a new value for this type's height.
TRACI_CONST int VAR_HEIGHT
static ContextSubscriptionResults myContextSubscriptionResults
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
static SubscriptionResults mySubscriptionResults
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
void setAccel(double accel)
Set a new value for this type's acceleration.
#define WRITE_WARNING(msg)
TRACI_CONST int VAR_EMISSIONCLASS
virtual double getImperfection() const
Get the driver's imperfection.
virtual bool wrapString(const std::string &objID, const int variable, const std::string &value)=0
TRACI_CONST int VAR_MINGAP
static TraCIColor makeTraCIColor(const RGBColor &color)
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.
TRACI_CONST int VAR_MAXSPEED
TRACI_CONST int VAR_COLOR
static LIBSUMO_VEHICLE_TYPE_GETTER std::string getParameter(const std::string &typeID, const std::string &key)
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
double getApparentDecel() const
Get the vehicle type's apparent deceleration [m/s^2] (the one regarded by its followers.
static RGBColor makeRGBColor(const TraCIColor &color)
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
TRACI_CONST int VAR_WIDTH
void setEmergencyDecel(double emergencyDecel)
Set a new value for this type's emergency deceleration.
static std::vector< std::string > getIDList()
TRACI_CONST int VAR_VEHICLECLASS
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
TRACI_CONST int VAR_ACCEL
std::vector< double > & getParameter()
Returns the parameters of this distribution.
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
MSVehicleType * duplicateType(const std::string &id, bool persistent) const
Duplicates the microsim vehicle type giving the newly created type the given id.
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
void setWidth(const double &width)
Set a new value for this type's width.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
int getPersonCapacity() const
Get this vehicle type's person capacity.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
virtual bool wrapColor(const std::string &objID, const int variable, const TraCIColor &value)=0
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
static MSVehicleType * getVType(std::string id)
static LIBSUMO_SUBSCRIPTION_API std::shared_ptr< VariableWrapper > makeWrapper()
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
void setColor(const RGBColor &color)
Set a new value for this type's color.
static LIBSUMO_VEHICLE_TYPE_SETTER void copy(const std::string &origTypeID, const std::string &newTypeID)
TRACI_CONST int VAR_MINGAP_LAT
static SUMOTime processActionStepLength(double given)
Checks and converts given value for the action step length from seconds to miliseconds assuring it be...
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
TRACI_CONST int VAR_LATALIGNMENT
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
Structure representing possible vehicle parameter.
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
SubParams cfParameter
Car-following parameter.
void setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset)
Set a new value for this type's action step length.
static void setSpeedDeviation(const std::string &typeID, double deviation)
TRACI_CONST int TRACI_ID_LIST
void setLength(const double &length)
Set a new value for this type's length.
double getMinGap() const
Get the free space in front of vehicles of this class.
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
void setDecel(double decel)
Set a new value for this type's deceleration.
TRACI_CONST int VAR_SPEED_FACTOR
TRACI_CONST int VAR_SPEED_DEVIATION
TRACI_CONST int VAR_LENGTH
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
TRACI_CONST int VAR_EMERGENCY_DECEL
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
TRACI_CONST int VAR_SHAPECLASS
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
void setSpeedDeviation(const double &dev)
Set a new value for this type's speed deviation.
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
double getLength() const
Get vehicle's length [m].
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
const SUMOVTypeParameter & getParameter() const
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
TRACI_CONST int VAR_DECEL
@ SUMO_ATTR_EMERGENCYDECEL
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
void insertVTypeIDs(std::vector< std::string > &into) const
Inserts ids of all known vehicle types and vehicle type distributions to the given vector.
static void setParameter(const std::string &id, const std::string &name, const std::string &value)
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
TRACI_CONST int VAR_IMPERFECTION
TRACI_CONST int VAR_APPARENT_DECEL
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
TRACI_CONST int VAR_MAXSPEED_LAT
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
TRACI_CONST int VAR_PERSON_CAPACITY
TRACI_CONST int VAR_ACTIONSTEPLENGTH
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
void setTau(double tau)
Set a new value for this type's headway.
void setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
void setImperfection(double imperfection)
Set a new value for this type's imperfection.