140 int nextStageIndex = 0;
149 int nextStageIndex = 0;
167 std::string paramName =
"";
192 std::string warning =
"";
218 const bool shouldExist = variable !=
ADD;
220 if (p == 0 && shouldExist) {
248 if (inputStorage.
readInt() != 4) {
274 int numParameters = inputStorage.
readInt();
281 if (numParameters != 4) {
299 if (numParameters != 4) {
306 std::string description;
317 if (numParameters != 6) {
320 std::vector<std::string> edgeIDs;
347 int nextStageIndex = 0;
358 if (inputStorage.
readInt() != 0) {
368 const int numArgs = inputStorage.
readInt();
392 int keepRouteFlag = 1;
static std::string getNextEdge(const std::string &personID)
#define CMD_GET_PERSON_VARIABLE
static void setType(const std::string &personID, const std::string &typeID)
bool readTypeCheckingInt(tcpip::Storage &inputStorage, int &into)
Reads the value type and an int, verifying the type.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static void moveToXY(const std::string &personID, const std::string &edgeID, const double x, const double y, double angle, const int keepRouteFlag)
static std::string getSingularVType(const std::string &personID)
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
static std::vector< std::string > getIDList()
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
static std::string getTypeID(const std::string &personID)
virtual void writeUnsignedByte(int)
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
static bool getVariable(const int variable, const std::string &v, tcpip::Storage &tempMsg)
Processes a value request for the given type.
static double getLanePosition(const std::string &personID)
virtual void writeInt(int)
static void appendDrivingStage(const std::string &personID, const std::string &toEdge, const std::string &lines, const std::string &stopID="")
virtual int readUnsignedByte()
static int getRemainingStages(const std::string &personID)
static std::string getVehicle(const std::string &personID)
static bool getPosition(const std::string &id, Position &p)
Returns the named persons's position.
static TraCIPosition getPosition(const std::string &personID)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xce: Change Person State)
static void add(const std::string &personID, const std::string &edgeID, double pos, double depart=DEPARTFLAG_NOW, const std::string typeID="DEFAULT_PEDTYPE")
virtual MSTransportableControl & getPersonControl()
Returns the person control.
A point in 2D or 3D with translation and scaling methods.
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
virtual void writeStringList(const std::vector< std::string > &s)
#define CMD_SET_VEHICLE_VARIABLE
virtual std::string readString()
static void setParameter(const std::string &personID, const std::string &key, const std::string &value)
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 0xae: Get Person Variable)
static std::string getParameter(const std::string &routeID, const std::string ¶m)
static void setSpeed(const std::string &personID, double speed)
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
static TraCIColor getColor(const std::string &personID)
static std::string getRoadID(const std::string &personID)
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.
virtual void writeString(const std::string &s)
static void removeStage(const std::string &personID, int nextStageIndex)
std::string toHex(const T i, std::streamsize numDigits=0)
static double getWaitingTime(const std::string &personID)
virtual Position getPosition() const
Return the Network coordinate of the transportable.
#define CMD_REROUTE_TRAVELTIME
#define RESPONSE_GET_PERSON_VARIABLE
virtual void writeDouble(double)
static int getStage(const std::string &personID, int nextStageIndex=0)
static void appendWaitingStage(const std::string &personID, double duration, const std::string &description="waiting", const std::string &stopID="")
MSTransportable * get(const std::string &id) const
Returns the named transportable, if existing.
static std::vector< std::string > getEdges(const std::string &personID, int nextStageIndex=0)
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
#define CMD_SET_PERSON_VARIABLE
static void appendWalkingStage(const std::string &personID, const std::vector< std::string > &edgeIDs, double arrivalPos, double duration=-1, double speed=-1, const std::string &stopID="")
static double getSpeed(const std::string &personID)
static void rerouteTraveltime(const std::string &personID)
#define VAR_STAGES_REMAINING
bool readTypeCheckingByte(tcpip::Storage &inputStorage, int &into)
Reads the value type and a byte, verifying the type.
static double getAngle(const std::string &personID)