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);
220 std::string warning =
"";
235 "Change Vehicle Type State: unsupported variable " +
toHex(variable, 2)
236 +
" specified", outputStorage);
268 return server.
writeErrorStatusCmd(cmd,
"Setting length requires a double.", outputStorage);
270 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
279 return server.
writeErrorStatusCmd(cmd,
"Setting height requires a double.", outputStorage);
281 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
290 return server.
writeErrorStatusCmd(cmd,
"Setting maximum speed requires a double.", outputStorage);
292 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
301 return server.
writeErrorStatusCmd(cmd,
"Setting vehicle class requires a string.", outputStorage);
306 return server.
writeErrorStatusCmd(cmd,
"Unknown vehicle class '" + vclass +
"'.", outputStorage);
313 return server.
writeErrorStatusCmd(cmd,
"Setting speed factor requires a double.", outputStorage);
315 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
324 return server.
writeErrorStatusCmd(cmd,
"Setting speed deviation requires a double.", outputStorage);
326 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
335 return server.
writeErrorStatusCmd(cmd,
"Setting emission class requires a string.", outputStorage);
340 return server.
writeErrorStatusCmd(cmd,
"Unknown emission class '" + eclass +
"'.", outputStorage);
349 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
358 return server.
writeErrorStatusCmd(cmd,
"Setting minimum gap requires a double.", outputStorage);
360 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
369 return server.
writeErrorStatusCmd(cmd,
"Setting minimum lateral gap requires a double.", outputStorage);
371 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
380 return server.
writeErrorStatusCmd(cmd,
"Setting maximum lateral speed requires a double.", outputStorage);
382 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
389 std::string latAlign;
391 return server.
writeErrorStatusCmd(cmd,
"Setting preferred lateral alignment requires a string.",
397 return server.
writeErrorStatusCmd(cmd,
"Unknown lateral alignment " + latAlign +
"'.", outputStorage);
404 return server.
writeErrorStatusCmd(cmd,
"Setting vehicle shape requires a string.", outputStorage);
409 return server.
writeErrorStatusCmd(cmd,
"Unknown vehicle shape " + sclass +
"'.", outputStorage);
416 return server.
writeErrorStatusCmd(cmd,
"Setting acceleration requires a double.", outputStorage);
418 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
427 return server.
writeErrorStatusCmd(cmd,
"Setting deceleration requires a double.", outputStorage);
429 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
438 return server.
writeErrorStatusCmd(cmd,
"Setting driver imperfection requires a double.", outputStorage);
440 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
449 return server.
writeErrorStatusCmd(cmd,
"Setting headway time requires a double.", outputStorage);
451 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
460 return server.
writeErrorStatusCmd(cmd,
"The color must be given using the according type.", outputStorage);
467 return server.
writeErrorStatusCmd(cmd,
"A compound object is needed for setting a parameter.",
474 return server.
writeErrorStatusCmd(cmd,
"The name of the parameter must be given as a string.",
479 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 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 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)
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
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 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 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.
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)