 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
50 const std::string
id = inputStorage.
readString();
59 "The message must contain the time definition.", outputStorage);
69 "The message must contain the time definition.", outputStorage);
76 std::string paramName;
79 "Retrieval of a parameter requires its name.",
88 "Get Edge Variable: unsupported variable " +
toHex(variable, 2)
89 +
" specified", outputStorage);
110 "Change Edge State: unsupported variable " +
toHex(variable, 2)
111 +
" specified", outputStorage);
120 std::vector<std::string> classes;
123 "Allowed vehicle classes must be given as a list of strings.",
131 std::vector<std::string> classes;
134 "Not allowed vehicle classes must be given as a list of strings.",
144 "Setting travel time requires a compound object.", outputStorage);
146 const int parameterCount = inputStorage.
readInt();
147 if (parameterCount == 3) {
149 double begTime = 0., endTime = 0., value = 0.;
152 "The first variable must be the begin time given as double.",
157 "The second variable must be the end time given as double.",
162 "The third variable must be the value given as double",
166 }
else if (parameterCount == 1) {
171 "The variable must be the value given as double", outputStorage);
176 "Setting travel time requires either begin time, end time, and value, or only value as parameter.",
185 "Setting effort requires a compound object.",
188 const int parameterCount = inputStorage.
readInt();
189 if (parameterCount == 3) {
191 double begTime = 0., endTime = 0., value = 0.;
194 "The first variable must be the begin time given as double.",
199 "The second variable must be the end time given as double.",
204 "The third variable must be the value given as double",
208 }
else if (parameterCount == 1) {
213 "The variable must be the value given as double", outputStorage);
218 "Setting effort requires either begin time, end time, and value, or only value as parameter.",
236 "A compound object is needed for setting a parameter.",
244 "The name of the parameter must be given as a string.",
250 "The value of the parameter must be given as a string.",
virtual void writeUnsignedByte(int)
static void adaptTraveltime(const std::string &id, double value, double begTime=0., double endTime=std::numeric_limits< double >::max())
static void setParameter(const std::string &id, const std::string &name, const std::string &value)
TRACI_CONST int VAR_MAXSPEED
static void setMaxSpeed(const std::string &id, double value)
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
TRACI_CONST int RESPONSE_GET_EDGE_VARIABLE
TRACI_CONST int LANE_DISALLOWED
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_EDGE_TRAVELTIME
tcpip::Storage & getWrapperStorage()
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
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.
void initWrapper(const int domainID, const int variable, const std::string &objID)
virtual void writeString(const std::string &s)
TRACI_CONST int TYPE_DOUBLE
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 void setDisallowedVehicleClasses(const std::string &id, std::vector< std::string > classes)
std::string toHex(const T i, std::streamsize numDigits=0)
static void setEffort(const std::string &id, double value, double begTime=0., double endTime=std::numeric_limits< double >::max())
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xca: Change Edge State)
TRACI_CONST int LANE_ALLOWED
TRACI_CONST int TYPE_STRING
TRACI_CONST int VAR_EDGE_EFFORT
static double getAdaptedTraveltime(const std::string &id, double time)
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
TRACI_CONST int CMD_SET_EDGE_VARIABLE
virtual std::string readString()
TraCI server used to control sumo by a remote TraCI client.
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xaa: Get Edge Variable)
TRACI_CONST int CMD_GET_EDGE_VARIABLE
static double getEffort(const std::string &id, double time)
TRACI_CONST int TYPE_COMPOUND
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.