 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
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));
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
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
std::vector< double > & getParameter()
Returns the parameters of this distribution.
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
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.