70 "Get Vehicle Type Variable: unsupported variable " +
toHex(variable, 2)
71 +
" specified", outputStorage);
92 std::string paramName =
"";
95 "Retrieval of a parameter requires its name.", outputStorage);
230 std::string warning =
"";
247 "Change Vehicle Type State: unsupported variable " +
toHex(variable, 2)
248 +
" specified", outputStorage);
280 return server.
writeErrorStatusCmd(cmd,
"Setting length requires a double.", outputStorage);
282 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
291 return server.
writeErrorStatusCmd(cmd,
"Setting height requires a double.", outputStorage);
293 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
302 return server.
writeErrorStatusCmd(cmd,
"Setting maximum speed requires a double.", outputStorage);
304 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
313 return server.
writeErrorStatusCmd(cmd,
"Setting vehicle class requires a string.", outputStorage);
318 return server.
writeErrorStatusCmd(cmd,
"Unknown vehicle class '" + vclass +
"'.", outputStorage);
325 return server.
writeErrorStatusCmd(cmd,
"Setting speed factor requires a double.", outputStorage);
327 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
336 return server.
writeErrorStatusCmd(cmd,
"Setting speed deviation requires a double.", outputStorage);
338 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
347 return server.
writeErrorStatusCmd(cmd,
"Setting emission class requires a string.", outputStorage);
352 return server.
writeErrorStatusCmd(cmd,
"Unknown emission class '" + eclass +
"'.", outputStorage);
361 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
370 return server.
writeErrorStatusCmd(cmd,
"Setting minimum gap requires a double.", outputStorage);
372 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
381 return server.
writeErrorStatusCmd(cmd,
"Setting minimum lateral gap requires a double.", outputStorage);
383 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
392 return server.
writeErrorStatusCmd(cmd,
"Setting maximum lateral speed requires a double.", outputStorage);
394 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
401 std::string latAlign;
403 return server.
writeErrorStatusCmd(cmd,
"Setting preferred lateral alignment requires a string.",
409 return server.
writeErrorStatusCmd(cmd,
"Unknown lateral alignment " + latAlign +
"'.", outputStorage);
416 return server.
writeErrorStatusCmd(cmd,
"Setting vehicle shape requires a string.", outputStorage);
421 return server.
writeErrorStatusCmd(cmd,
"Unknown vehicle shape " + sclass +
"'.", outputStorage);
428 return server.
writeErrorStatusCmd(cmd,
"Setting acceleration requires a double.", outputStorage);
430 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
439 return server.
writeErrorStatusCmd(cmd,
"Setting deceleration requires a double.", outputStorage);
441 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
450 return server.
writeErrorStatusCmd(cmd,
"Setting deceleration requires a double.", outputStorage);
452 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
461 return server.
writeErrorStatusCmd(cmd,
"Setting deceleration requires a double.", outputStorage);
463 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
472 return server.
writeErrorStatusCmd(cmd,
"Setting driver imperfection requires a double.", outputStorage);
474 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
483 return server.
writeErrorStatusCmd(cmd,
"Setting headway time requires a double.", outputStorage);
485 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
494 return server.
writeErrorStatusCmd(cmd,
"The color must be given using the according type.", outputStorage);
500 std::string newTypeID;
510 return server.
writeErrorStatusCmd(cmd,
"A compound object is needed for setting a parameter.",
517 return server.
writeErrorStatusCmd(cmd,
"The name of the parameter must be given as a string.",
522 return server.
writeErrorStatusCmd(cmd,
"The value of the parameter must be given as a string.",
static void setAccel(const std::string &typeID, double accel)
static void setSpeedDeviation(const std::string &typeID, double deviation)
bool readTypeCheckingColor(tcpip::Storage &inputStorage, TraCIColor &into)
Reads the value type and a color, verifying the type.
#define VAR_EMISSIONCLASS
static void setShapeClass(const std::string &typeID, const std::string &shapeClass)
static std::string getParameter(const std::string &typeID, const std::string &key)
static double getSpeedFactor(const std::string &typeID)
static std::string getShapeClass(const std::string &typeID)
#define RESPONSE_GET_VEHICLETYPE_VARIABLE
static TraCIColor getColor(const std::string &typeID)
static void setVehicleClass(const std::string &typeID, const std::string &clazz)
static std::string getEmissionClass(const std::string &typeID)
static double getApparentDecel(const std::string &typeID)
static std::vector< std::string > getIDList()
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
virtual void writeUnsignedByte(int)
static void copy(const std::string &origTypeID, const std::string &newTypeID)
static double getMaxSpeedLat(const std::string &typeID)
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
static void setMinGapLat(const std::string &typeID, double minGapLat)
static bool getVariable(const int variable, const std::string &v, tcpip::Storage &tempMsg)
Processes a value request for the given type.
#define VAR_SPEED_DEVIATION
virtual void writeInt(int)
static void setApparentDecel(const std::string &typeID, double decel)
virtual int readUnsignedByte()
static void setEmissionClass(const std::string &typeID, const std::string &clazz)
#define CMD_GET_VEHICLETYPE_VARIABLE
static std::string getLateralAlignment(const std::string &typeID)
static double getMinGap(const std::string &typeID)
static double getMinGapLat(const std::string &typeID)
static std::string getVehicleClass(const std::string &typeID)
static void setMaxSpeedLat(const std::string &typeID, double speed)
static double getAccel(const std::string &typeID)
static void setHeight(const std::string &typeID, double height)
static void setImperfection(const std::string &typeID, double imperfection)
static void setSpeedFactor(const std::string &typeID, double factor)
#define CMD_SET_VEHICLETYPE_VARIABLE
#define VAR_EMERGENCY_DECEL
static void setLength(const std::string &typeID, double length)
virtual void writeStringList(const std::vector< std::string > &s)
static double getTau(const std::string &typeID)
static void setMinGap(const std::string &typeID, double minGap)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa5: Get Vehicle Type Variable)
virtual std::string readString()
static void setMaxSpeed(const std::string &typeID, double speed)
TraCI server used to control sumo by a remote TraCI client.
static void setWidth(const std::string &typeID, double width)
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
static double getImperfection(const std::string &typeID)
static void setEmergencyDecel(const std::string &typeID, double decel)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc5: Change Vehicle Type State)
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
static bool setVariable(const int cmd, const int variable, const std::string &id, TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value for the given type.
static double getDecel(const std::string &typeID)
virtual void writeString(const std::string &s)
std::string toHex(const T i, std::streamsize numDigits=0)
static void setTau(const std::string &typeID, double tau)
static double getEmergencyDecel(const std::string &typeID)
static double getHeight(const std::string &typeID)
static void setDecel(const std::string &typeID, double decel)
virtual void writeDouble(double)
static void setColor(const std::string &typeID, const TraCIColor &c)
static void setLateralAlignment(const std::string &typeID, const std::string &latAlignment)
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
#define VAR_APPARENT_DECEL
static double getLength(const std::string &typeID)
static double getSpeedDeviation(const std::string &typeID)
static double getWidth(const std::string &typeID)
static void addParameter(const std::string &id, const std::string &name, const std::string &value)
static double getMaxSpeed(const std::string &typeID)