60 "Change Edge State: unsupported variable " +
toHex(variable, 2)
61 +
" specified", outputStorage);
70 const std::vector<std::string> classes =
StoHelp::readTypedStringList(inputStorage,
"Allowed vehicle classes must be given as a list of strings.");
71 libsumo::Edge::setAllowed(
id, classes);
76 const std::vector<std::string> classes =
StoHelp::readTypedStringList(inputStorage,
"Not allowed vehicle classes must be given as a list of strings.");
77 libsumo::Edge::setDisallowed(
id, classes);
82 const int parameterCount =
StoHelp::readCompound(inputStorage, -1,
"Setting travel time requires a compound object.");
83 if (parameterCount == 3) {
85 const double begTime =
StoHelp::readTypedDouble(inputStorage,
"The first variable must be the begin time given as double.");
86 const double endTime =
StoHelp::readTypedDouble(inputStorage,
"The second variable must be the end time given as double.");
87 const double value =
StoHelp::readTypedDouble(inputStorage,
"The third variable must be the value given as double.");
88 libsumo::Edge::adaptTraveltime(
id, value, begTime, endTime);
89 }
else if (parameterCount == 1) {
92 libsumo::Edge::adaptTraveltime(
id, value, 0., std::numeric_limits<double>::max());
95 "Setting travel time requires either begin time, end time, and value, or only value as parameter.",
102 const int parameterCount =
StoHelp::readCompound(inputStorage, -1,
"Setting effort requires a compound object.");
103 if (parameterCount == 3) {
105 const double begTime =
StoHelp::readTypedDouble(inputStorage,
"The first variable must be the begin time given as double.");
106 const double endTime =
StoHelp::readTypedDouble(inputStorage,
"The second variable must be the end time given as double.");
107 const double value =
StoHelp::readTypedDouble(inputStorage,
"The third variable must be the value given as double.");
108 libsumo::Edge::setEffort(
id, value, begTime, endTime);
109 }
else if (parameterCount == 1) {
112 libsumo::Edge::setEffort(
id, value, 0., std::numeric_limits<double>::max());
115 "Setting effort requires either begin time, end time, and value, or only value as parameter.",
123 libsumo::Edge::setMaxSpeed(
id, value);
129 libsumo::Edge::setFriction(
id, value);
134 StoHelp::readCompound(inputStorage, 2,
"A compound object of size 2 is needed for setting a parameter.");
135 const std::string name =
StoHelp::readTypedString(inputStorage,
"The name of the parameter must be given as a string.");
136 const std::string value =
StoHelp::readTypedString(inputStorage,
"The value of the parameter must be given as a string.");
137 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)
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 writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
static int readCompound(tcpip::Storage &ret, int expectedSize=-1, const std::string &error="")
static std::vector< std::string > readTypedStringList(tcpip::Storage &ret, const std::string &error="")
static std::string readTypedString(tcpip::Storage &ret, const std::string &error="")
static double readTypedDouble(tcpip::Storage &ret, const std::string &error="")
An error which allows to continue.
virtual std::string readString()
virtual int readUnsignedByte()
TRACI_CONST int CMD_SET_EDGE_VARIABLE
TRACI_CONST int VAR_EDGE_TRAVELTIME
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_FRICTION
TRACI_CONST int LANE_ALLOWED