49 const std::string
id = inputStorage.
readString();
52 if (!libsumo::Edge::handleVariable(
id, variable, &server)) {
58 "The message must contain the time definition.", outputStorage);
68 "The message must contain the time definition.", outputStorage);
75 std::string paramName;
78 "Retrieval of a parameter requires its name.",
86 std::string paramName;
89 "Retrieval of a parameter requires its name.",
102 "Get Edge Variable: unsupported variable " +
toHex(variable, 2)
103 +
" specified", outputStorage);
124 "Change Edge State: unsupported variable " +
toHex(variable, 2)
125 +
" specified", outputStorage);
134 std::vector<std::string> classes;
137 "Allowed vehicle classes must be given as a list of strings.",
140 libsumo::Edge::setAllowedVehicleClasses(
id, classes);
145 std::vector<std::string> classes;
148 "Not allowed vehicle classes must be given as a list of strings.",
151 libsumo::Edge::setDisallowedVehicleClasses(
id, classes);
158 "Setting travel time requires a compound object.", outputStorage);
160 const int parameterCount = inputStorage.
readInt();
161 if (parameterCount == 3) {
163 double begTime = 0., endTime = 0., value = 0.;
166 "The first variable must be the begin time given as double.",
171 "The second variable must be the end time given as double.",
176 "The third variable must be the value given as double",
179 libsumo::Edge::adaptTraveltime(
id, value, begTime, endTime);
180 }
else if (parameterCount == 1) {
185 "The variable must be the value given as double", outputStorage);
187 libsumo::Edge::adaptTraveltime(
id, value, 0., std::numeric_limits<double>::max());
190 "Setting travel time requires either begin time, end time, and value, or only value as parameter.",
199 "Setting effort requires a compound object.",
202 const int parameterCount = inputStorage.
readInt();
203 if (parameterCount == 3) {
205 double begTime = 0., endTime = 0., value = 0.;
208 "The first variable must be the begin time given as double.",
213 "The second variable must be the end time given as double.",
218 "The third variable must be the value given as double",
221 libsumo::Edge::setEffort(
id, value, begTime, endTime);
222 }
else if (parameterCount == 1) {
227 "The variable must be the value given as double", outputStorage);
229 libsumo::Edge::setEffort(
id, value, 0., std::numeric_limits<double>::max());
232 "Setting effort requires either begin time, end time, and value, or only value as parameter.",
244 libsumo::Edge::setMaxSpeed(
id, value);
250 "A compound object is needed for setting a parameter.",
258 "The name of the parameter must be given as a string.",
264 "The value of the parameter must be given as a string.",
267 libsumo::Edge::setParameter(
id, name, value);
std::string toHex(const T i, std::streamsize numDigits=0)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xca: Change Edge State)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xaa: Get Edge Variable)
TraCI server used to control sumo by a remote TraCI client.
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
tcpip::Storage & getWrapperStorage()
void initWrapper(const int domainID, const int variable, const std::string &objID)
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
virtual std::string readString()
virtual void writeString(const std::string &s)
virtual void writeInt(int)
virtual void writeDouble(double)
virtual int readUnsignedByte()
virtual void writeUnsignedByte(int)
TRACI_CONST int CMD_SET_EDGE_VARIABLE
TRACI_CONST int VAR_EDGE_TRAVELTIME
TRACI_CONST int CMD_GET_EDGE_VARIABLE
TRACI_CONST int RESPONSE_GET_EDGE_VARIABLE
TRACI_CONST int TYPE_COMPOUND
TRACI_CONST int VAR_EDGE_EFFORT
TRACI_CONST int VAR_MAXSPEED
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int LANE_DISALLOWED
TRACI_CONST int VAR_PARAMETER_WITH_KEY
TRACI_CONST int TYPE_DOUBLE
TRACI_CONST int LANE_ALLOWED
TRACI_CONST int TYPE_STRING