68 "Get Vehicle Type Variable: unsupported variable " +
toHex(variable, 2)
69 +
" specified", outputStorage);
90 std::string paramName =
"";
93 "Retrieval of a parameter requires its name.", outputStorage);
233 std::string warning =
"";
250 "Change Vehicle Type State: unsupported variable " +
toHex(variable, 2)
251 +
" specified", outputStorage);
283 return server.
writeErrorStatusCmd(cmd,
"Setting length requires a double.", outputStorage);
285 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
294 return server.
writeErrorStatusCmd(cmd,
"Setting height requires a double.", outputStorage);
296 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
305 return server.
writeErrorStatusCmd(cmd,
"Setting maximum speed requires a double.", outputStorage);
307 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
316 return server.
writeErrorStatusCmd(cmd,
"Setting vehicle class requires a string.", outputStorage);
321 return server.
writeErrorStatusCmd(cmd,
"Unknown vehicle class '" + vclass +
"'.", outputStorage);
328 return server.
writeErrorStatusCmd(cmd,
"Setting speed factor requires a double.", outputStorage);
330 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
339 return server.
writeErrorStatusCmd(cmd,
"Setting speed deviation requires a double.", outputStorage);
341 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
350 return server.
writeErrorStatusCmd(cmd,
"Setting emission class requires a string.", outputStorage);
355 return server.
writeErrorStatusCmd(cmd,
"Unknown emission class '" + eclass +
"'.", outputStorage);
364 if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
373 return server.
writeErrorStatusCmd(cmd,
"Setting minimum gap requires a double.", outputStorage);
375 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
384 return server.
writeErrorStatusCmd(cmd,
"Setting minimum lateral gap requires a double.", outputStorage);
386 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
395 return server.
writeErrorStatusCmd(cmd,
"Setting maximum lateral speed requires a double.", outputStorage);
397 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
404 std::string latAlign;
406 return server.
writeErrorStatusCmd(cmd,
"Setting preferred lateral alignment requires a string.",
412 return server.
writeErrorStatusCmd(cmd,
"Unknown lateral alignment " + latAlign +
"'.", outputStorage);
419 return server.
writeErrorStatusCmd(cmd,
"Setting vehicle shape requires a string.", outputStorage);
424 return server.
writeErrorStatusCmd(cmd,
"Unknown vehicle shape " + sclass +
"'.", outputStorage);
431 return server.
writeErrorStatusCmd(cmd,
"Setting acceleration requires a double.", outputStorage);
433 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
442 return server.
writeErrorStatusCmd(cmd,
"Setting deceleration requires a double.", outputStorage);
444 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
453 return server.
writeErrorStatusCmd(cmd,
"Setting deceleration requires a double.", outputStorage);
455 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
464 return server.
writeErrorStatusCmd(cmd,
"Setting deceleration requires a double.", outputStorage);
466 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
477 if (fabs(value) == std::numeric_limits<double>::infinity()) {
480 bool resetActionOffset = value >= 0.0;
487 return server.
writeErrorStatusCmd(cmd,
"Setting driver imperfection requires a double.", outputStorage);
489 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
498 return server.
writeErrorStatusCmd(cmd,
"Setting headway time requires a double.", outputStorage);
500 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
509 return server.
writeErrorStatusCmd(cmd,
"The color must be given using the according type.", outputStorage);
515 std::string newTypeID;
525 return server.
writeErrorStatusCmd(cmd,
"A compound object is needed for setting a parameter.",
532 return server.
writeErrorStatusCmd(cmd,
"The name of the parameter must be given as a string.",
537 return server.
writeErrorStatusCmd(cmd,
"The value of the parameter must be given as a string.",
static double getImperfection(const std::string &typeID)
static void setSpeedFactor(const std::string &typeID, double factor)
static double getHeight(const std::string &typeID)
static double getDecel(const std::string &typeID)
bool readTypeCheckingColor(tcpip::Storage &inputStorage, libsumo::TraCIColor &into)
Reads the value type and a color, verifying the type.
#define VAR_EMISSIONCLASS
static double getEmergencyDecel(const std::string &typeID)
static double getSpeedDeviation(const std::string &typeID)
#define RESPONSE_GET_VEHICLETYPE_VARIABLE
static double getSpeedFactor(const std::string &typeID)
static double getMaxSpeed(const std::string &typeID)
static void setSpeedDeviation(const std::string &typeID, double deviation)
static void setLength(const std::string &typeID, double length)
static std::string getParameter(const std::string &typeID, const std::string &key)
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.
static double getApparentDecel(const std::string &typeID)
virtual void writeUnsignedByte(int)
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 setMaxSpeed(const std::string &typeID, double speed)
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 double getLength(const std::string &typeID)
static void setApparentDecel(const std::string &typeID, double decel)
#define CMD_GET_VEHICLETYPE_VARIABLE
static void setTau(const std::string &typeID, double tau)
static std::string getVehicleClass(const std::string &typeID)
static void setWidth(const std::string &typeID, double width)
#define VAR_ACTIONSTEPLENGTH
#define CMD_SET_VEHICLETYPE_VARIABLE
#define VAR_EMERGENCY_DECEL
static void setMinGapLat(const std::string &typeID, double minGapLat)
static void setShapeClass(const std::string &typeID, const std::string &shapeClass)
static void copy(const std::string &origTypeID, const std::string &newTypeID)
virtual void writeStringList(const std::vector< std::string > &s)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa5: Get Vehicle Type Variable)
#define CMD_SET_VEHICLE_VARIABLE
static double getMaxSpeedLat(const std::string &typeID)
virtual std::string readString()
static void setActionStepLength(const std::string &typeID, double actionStepLength, bool resetActionOffset)
static double getWidth(const std::string &typeID)
TraCI server used to control sumo by a remote TraCI client.
static void setDecel(const std::string &typeID, double decel)
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
static void setImperfection(const std::string &typeID, double imperfection)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc5: Change Vehicle Type State)
static std::string getEmissionClass(const std::string &typeID)
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.
virtual void writeString(const std::string &s)
static void setParameter(const std::string &id, const std::string &name, const std::string &value)
static void setEmergencyDecel(const std::string &typeID, double decel)
static void setLateralAlignment(const std::string &typeID, const std::string &latAlignment)
static void setMinGap(const std::string &typeID, double minGap)
std::string toHex(const T i, std::streamsize numDigits=0)
static double getActionStepLength(const std::string &typeID)
static void setMaxSpeedLat(const std::string &typeID, double speed)
static double getMinGap(const std::string &typeID)
virtual void writeDouble(double)
static void setColor(const std::string &typeID, const TraCIColor &c)
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 getMinGapLat(const std::string &typeID)
static double getTau(const std::string &typeID)
static double getAccel(const std::string &typeID)
static std::string getLateralAlignment(const std::string &typeID)
static void setHeight(const std::string &typeID, double height)
static void setEmissionClass(const std::string &typeID, const std::string &clazz)
static void setVehicleClass(const std::string &typeID, const std::string &clazz)
static std::string getShapeClass(const std::string &typeID)
static TraCIColor getColor(const std::string &typeID)
static void setAccel(const std::string &typeID, double accel)
static std::vector< std::string > getIDList()