45 const std::string
id = inputStorage.
readString();
48 if (!libsumo::Person::handleVariable(
id, variable, &server, &inputStorage)) {
63 std::string warning =
"";
95 if (p ==
nullptr && shouldExist) {
106 libsumo::Person::setSpeed(
id, speed);
114 libsumo::Person::setType(
id, vTypeID);
118 double speedfactor = 0;
122 libsumo::Person::setSpeedFactor(
id, speedfactor);
130 libsumo::Person::setColor(
id, col);
137 if (inputStorage.
readInt() != 4) {
156 libsumo::Person::add(
id, edgeID, pos, depart, vTypeID);
164 libsumo::Person::remove(
id, (
char)why);
171 int numParameters = inputStorage.
readInt();
172 if (numParameters == 13) {
175 libsumo::Person::appendStage(
id, stage);
177 const int stageType =
StoHelp::readTypedInt(inputStorage,
"The first parameter for adding a stage must be the stage type given as int.");
180 if (numParameters != 4) {
195 libsumo::Person::appendDrivingStage(
id, edgeID, lines, stopID);
198 if (numParameters != 4) {
205 std::string description;
213 libsumo::Person::appendWaitingStage(
id, duration, description, stopID);
216 if (numParameters != 6) {
219 std::vector<std::string> edgeIDs;
239 libsumo::Person::appendWalkingStage(
id, edgeIDs, arrivalPos, duration, speed, stopID);
252 if (inputStorage.
readInt() != 2) {
255 const int nextStageIndex =
StoHelp::readTypedInt(inputStorage,
"First parameter of replace stage should be an integer");
259 if (inputStorage.
readInt() != 13) {
264 libsumo::Person::replaceStage(
id, nextStageIndex, stage);
269 const int nextStageIndex =
StoHelp::readTypedInt(inputStorage,
"The message must contain the stage index.");
270 libsumo::Person::removeStage(
id, nextStageIndex);
277 if (inputStorage.
readInt() != 0) {
280 libsumo::Person::rerouteTraveltime(
id);
287 const int numArgs = inputStorage.
readInt();
304 libsumo::Person::moveTo(
id, laneID, position, posLat);
311 const int numArgs = inputStorage.
readInt();
312 if (numArgs != 5 && numArgs != 6) {
335 int keepRouteFlag = 1;
339 double matchThreshold = 100;
345 libsumo::Person::moveToXY(
id, edgeID, x, y, angle, keepRouteFlag, matchThreshold);
362 libsumo::Person::setParameter(
id, name, value);
std::string toHex(const T i, std::streamsize numDigits=0)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual MSTransportableControl & getPersonControl()
Returns the person control.
MSTransportable * get(const std::string &id) const
Returns the named transportable, if existing.
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
const std::string & getID() const
Returns the name of the vehicle type.
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xae: Get Person Variable)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xce: Change Person State)
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.
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.
bool readTypeCheckingByte(tcpip::Storage &inputStorage, int &into)
Reads the value type and a byte, 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)
bool readTypeCheckingColor(tcpip::Storage &inputStorage, libsumo::TraCIColor &into)
Reads the value type and a color, verifying the type.
static int readTypedInt(tcpip::Storage &ret, const std::string &error="")
static void readStage(tcpip::Storage &inputStorage, libsumo::TraCIStage &stage, const std::string &error="")
An error which allows to continue.
virtual std::string readString()
virtual int readUnsignedByte()
TRACI_CONST int VAR_MINGAP
TRACI_CONST int REPLACE_STAGE
TRACI_CONST int VAR_SPEED_FACTOR
TRACI_CONST int MOVE_TO_XY
TRACI_CONST int TYPE_COMPOUND
TRACI_CONST int CMD_GET_PERSON_VARIABLE
TRACI_CONST int VAR_MOVE_TO
TRACI_CONST int VAR_COLOR
TRACI_CONST int VAR_WIDTH
TRACI_CONST int STAGE_WAITING
TRACI_CONST int CMD_REROUTE_TRAVELTIME
TRACI_CONST int APPEND_STAGE
TRACI_CONST int CMD_SET_VEHICLE_VARIABLE
TRACI_CONST int VAR_LENGTH
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int CMD_SET_PERSON_VARIABLE
TRACI_CONST int VAR_HEIGHT
TRACI_CONST int RESPONSE_GET_PERSON_VARIABLE
TRACI_CONST int STAGE_WALKING
TRACI_CONST int REMOVE_STAGE
TRACI_CONST int VAR_SPEED
TRACI_CONST int STAGE_DRIVING