51 const std::string
id = inputStorage.
readString();
60 "The message must contain the time definition.", outputStorage);
70 "The message must contain the time definition.", outputStorage);
77 std::string paramName;
80 "Retrieval of a parameter requires its name.",
89 "Get Edge Variable: unsupported variable " +
toHex(variable, 2)
90 +
" specified", outputStorage);
111 "Change Edge State: unsupported variable " +
toHex(variable, 2)
112 +
" specified", outputStorage);
121 std::vector<std::string> classes;
124 "Allowed vehicle classes must be given as a list of strings.",
132 std::vector<std::string> classes;
135 "Not allowed vehicle classes must be given as a list of strings.",
145 "Setting travel time requires a compound object.", outputStorage);
147 const int parameterCount = inputStorage.
readInt();
148 if (parameterCount == 3) {
150 double begTime = 0., endTime = 0., value = 0.;
153 "The first variable must be the begin time given as double.",
158 "The second variable must be the end time given as double.",
163 "The third variable must be the value given as double",
167 }
else if (parameterCount == 1) {
172 "The variable must be the value given as double", outputStorage);
177 "Setting travel time requires either begin time, end time, and value, or only value as parameter.",
186 "Setting effort requires a compound object.",
189 const int parameterCount = inputStorage.
readInt();
190 if (parameterCount == 3) {
192 double begTime = 0., endTime = 0., value = 0.;
195 "The first variable must be the begin time given as double.",
200 "The second variable must be the end time given as double.",
205 "The third variable must be the value given as double",
209 }
else if (parameterCount == 1) {
214 "The variable must be the value given as double", outputStorage);
219 "Setting effort requires either begin time, end time, and value, or only value as parameter.",
237 "A compound object is needed for setting a parameter.",
245 "The name of the parameter must be given as a string.",
251 "The value of the parameter must be given as a string.",
static void setEffort(const std::string &id, double value, double begTime=0., double endTime=std::numeric_limits< double >::max())
TRACI_CONST int VAR_EDGE_TRAVELTIME
TRACI_CONST int RESPONSE_GET_EDGE_VARIABLE
static double getAdaptedTraveltime(const std::string &id, double time)
TRACI_CONST int VAR_PARAMETER
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 void setDisallowedVehicleClasses(const std::string &id, std::vector< std::string > classes)
TRACI_CONST int LANE_DISALLOWED
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xca: Change Edge State)
virtual void writeUnsignedByte(int)
TRACI_CONST int VAR_MAXSPEED
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
virtual int readUnsignedByte()
static std::string getParameter(const std::string &id, const std::string ¶mName)
static void setAllowedVehicleClasses(const std::string &id, std::vector< std::string > vector)
static double getEffort(const std::string &id, double time)
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
TRACI_CONST int TYPE_DOUBLE
tcpip::Storage & getWrapperStorage()
virtual std::string readString()
TRACI_CONST int TYPE_STRING
TraCI server used to control sumo by a remote TraCI client.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
static void setMaxSpeed(const std::string &id, double value)
static void adaptTraveltime(const std::string &id, double value, double begTime=0., double endTime=std::numeric_limits< double >::max())
TRACI_CONST int LANE_ALLOWED
virtual void writeString(const std::string &s)
TRACI_CONST int VAR_EDGE_EFFORT
std::string toHex(const T i, std::streamsize numDigits=0)
TRACI_CONST int CMD_SET_EDGE_VARIABLE
virtual void writeDouble(double)
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
void initWrapper(const int domainID, const int variable, const std::string &objID)
static void setParameter(const std::string &id, const std::string &name, const std::string &value)
TRACI_CONST int CMD_GET_EDGE_VARIABLE
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xaa: Get Edge Variable)
TRACI_CONST int TYPE_COMPOUND