58 : outputFileName(outputFileName), answerLog(
"") {
59 answerLog.setf(std::ios::fixed , std::ios::floatfield);
72 std::ifstream defFile;
73 std::string fileContentStr;
74 std::stringstream fileContent;
75 std::string lineCommand;
76 std::stringstream msg;
78 bool commentRead =
false;
84 std::stringstream msg;
85 msg <<
"#Error while connecting: " << e.
what();
91 defFile.open(fileName.c_str());
93 msg <<
"Can not open definition file " << fileName << std::endl;
97 defFile.unsetf(std::ios::dec);
99 while (defFile >> lineCommand) {
101 if (lineCommand.compare(
"%") == 0) {
103 commentRead = !commentRead;
110 if (lineCommand.compare(
"repeat") == 0) {
112 defFile >> lineCommand;
114 if (lineCommand.compare(
"simstep2") == 0) {
118 for (
int i = 0; i < repNo; i++) {
121 }
else if (lineCommand.compare(
"getvariable") == 0) {
125 defFile >> domID >> varID >> objID;
127 }
else if (lineCommand.compare(
"getvariable_plus") == 0) {
131 defFile >> domID >> varID >> objID;
132 std::stringstream msg;
135 std::string msgS = msg.str();
140 }
else if (lineCommand.compare(
"subscribevariable") == 0) {
143 std::string beginTime, endTime;
145 defFile >> domID >> objID >> beginTime >> endTime >> varNo;
147 }
else if (lineCommand.compare(
"subscribecontext") == 0) {
149 int domID, varNo, domain;
151 std::string beginTime, endTime;
153 defFile >> domID >> objID >> beginTime >> endTime >> domain >> range >> varNo;
155 }
else if (lineCommand.compare(
"setvalue") == 0) {
159 defFile >> domID >> varID >> objID;
161 }
else if (lineCommand.compare(
"testAPI") == 0) {
164 }
else if (lineCommand.compare(
"setorder") == 0) {
170 msg <<
"Error in definition file: " << lineCommand <<
" is not a valid command";
189 answerLog << std::endl <<
"-> Command sent: <SimulationStep>:" << std::endl;
191 std::string acknowledgement;
193 answerLog << acknowledgement << std::endl;
205 answerLog << std::endl <<
"-> Command sent: <Close>:" << std::endl;
207 std::string acknowledgement;
209 answerLog << acknowledgement << std::endl;
220 answerLog << std::endl <<
"-> Command sent: <SetOrder>:" << std::endl;
222 std::string acknowledgement;
224 answerLog << acknowledgement << std::endl;
236 answerLog << std::endl <<
"-> Command sent: <GetVariable>:" << std::endl
237 <<
" domID=" << domID <<
" varID=" << varID
238 <<
" objID=" << objID << std::endl;
239 std::string acknowledgement;
241 answerLog << acknowledgement << std::endl;
251 answerLog <<
" CommandID=" << (domID + 0x10) <<
" VariableID=" << variableID <<
" ObjectID=" << objectID;
253 answerLog <<
" valueDataType=" << valueDataType;
256 std::stringstream msg;
257 msg <<
"Error while receiving command: " << e.
what();
266 std::stringstream msg;
269 std::string msgS = msg.str();
274 answerLog << std::endl <<
"-> Command sent: <SetValue>:" << std::endl
275 <<
" domID=" << domID <<
" varID=" << varID
276 <<
" objID=" << objID << std::endl;
278 std::string acknowledgement;
280 answerLog << acknowledgement << std::endl;
289 std::vector<int> vars;
290 for (
int i = 0; i < varNo; ++i) {
297 answerLog << std::endl <<
"-> Command sent: <SubscribeVariable>:" << std::endl
298 <<
" domID=" << domID <<
" objID=" << objID <<
" with " << varNo <<
" variables" << std::endl;
301 std::string acknowledgement;
303 answerLog << acknowledgement << std::endl;
313 int domain,
double range,
int varNo, std::ifstream& defFile) {
314 std::vector<int> vars;
315 for (
int i = 0; i < varNo; ++i) {
322 answerLog << std::endl <<
"-> Command sent: <SubscribeContext>:" << std::endl
323 <<
" domID=" << domID <<
" objID=" << objID <<
" domain=" << domain <<
" range=" << range
324 <<
" with " << varNo <<
" variables" << std::endl;
327 std::string acknowledgement;
329 answerLog << acknowledgement << std::endl;
344 std::cerr <<
"Unable to write result file" << std::endl;
347 locTime = localtime(&seconds);
348 outFile <<
"TraCITestClient output file. Date: " << asctime(locTime) << std::endl;
356 std::cerr << msg.str() << std::endl;
357 answerLog <<
"----" << std::endl << msg.str() << std::endl;
368 int noSubscriptions = inMsg.
readInt();
369 for (
int s = 0; s < noSubscriptions; ++s) {
374 }
catch (std::invalid_argument& e) {
375 answerLog <<
"#Error while reading message:" << e.what() << std::endl;
394 answerLog <<
" #variables=" << varNo << std::endl;
395 for (
int i = 0; i < varNo; ++i) {
400 answerLog <<
" valueDataType=" << valueDataType;
408 answerLog <<
" #variables=" << varNo << std::endl;
410 answerLog <<
" #objects=" << objNo << std::endl;
411 for (
int j = 0; j < objNo; ++j) {
413 for (
int i = 0; i < varNo; ++i) {
418 answerLog <<
" valueDataType=" << valueDataType;
423 answerLog <<
"#Error: received response with command id: " << cmdId <<
" but expected a subscription response (0xe0-0xef / 0x90-0x9f)" << std::endl;
426 }
catch (std::invalid_argument& e) {
427 answerLog <<
"#Error while reading message:" << e.what() << std::endl;
442 std::string dataTypeS;
443 defFile >> dataTypeS;
444 if (dataTypeS ==
"<airDist>") {
447 }
else if (dataTypeS ==
"<drivingDist>") {
450 }
else if (dataTypeS ==
"<objSubscription>") {
451 int beginTime, endTime, numVars;
452 defFile >> beginTime >> endTime >> numVars;
456 for (
int i = 0; i < numVars; ++i) {
461 return 4 + 4 + 4 + numVars;
465 if (dataTypeS ==
"<int>") {
470 }
else if (dataTypeS ==
"<byte>") {
475 }
else if (dataTypeS ==
"<ubyte>") {
480 }
else if (dataTypeS ==
"<float>") {
485 }
else if (dataTypeS ==
"<double>") {
490 }
else if (dataTypeS ==
"<string>") {
493 if (valueS ==
"\"\"") {
498 return 4 + 1 + (int) valueS.length();
499 }
else if (dataTypeS ==
"<string*>") {
500 std::vector<std::string> slValue;
503 for (
int i = 0; i < valI; ++i) {
506 slValue.push_back(tmp);
507 length += 4 + int(tmp.length());
512 }
else if (dataTypeS ==
"<compound>") {
517 for (
int i = 0; i < valI; ++i) {
521 }
else if (dataTypeS ==
"<color>") {
525 for (
int i = 0; i < 3; ++i) {
530 }
else if (dataTypeS ==
"<position2D>") {
537 }
else if (dataTypeS ==
"<position3D>") {
545 return 1 + 8 + 8 + 8;
546 }
else if (dataTypeS ==
"<positionRoadmap>") {
551 int length = 1 + 8 + (int) valueS.length();
556 return length + 4 + 1;
557 }
else if (dataTypeS ==
"<shape>") {
562 for (
int i = 0; i < valI; ++i) {
571 msg <<
"## Unknown data type: " << dataTypeS;
580 answerLog <<
" Unsigned Byte Value: " << ubyte << std::endl;
583 answerLog <<
" Byte value: " << byte << std::endl;
586 answerLog <<
" Int value: " << integer << std::endl;
589 if (floatv < 0.1 && floatv > 0) {
590 answerLog.setf(std::ios::scientific, std::ios::floatfield);
592 answerLog <<
" float value: " << floatv << std::endl;
593 answerLog.setf(std::ios::fixed , std::ios::floatfield);
598 answerLog <<
" Double value: " << doublev << std::endl;
604 answerLog <<
" BoundaryBoxValue: lowerLeft x=" << lowerLeftX
605 <<
" y=" << lowerLeftY <<
" upperRight x=" << upperRightX
606 <<
" y=" << upperRightY << std::endl;
610 for (
int i = 0; i < length; i++) {
613 answerLog <<
"(" << x <<
"," << y <<
") ";
620 answerLog <<
" Position3DValue: " << std::endl;
622 <<
" z: " << z << std::endl;
627 answerLog <<
" RoadMapPositionValue: roadId=" << roadId
629 <<
" laneId=" << laneId << std::endl;
632 answerLog <<
" TLPhaseListValue: length=" << length << std::endl;
633 for (
int i = 0; i < length; i++) {
637 answerLog <<
" precRoad=" << pred <<
" succRoad=" << succ
650 answerLog <<
"#Error: unknown phase value" << (int)phase << std::endl;
656 answerLog <<
" string value: " << s << std::endl;
659 answerLog <<
" string list value: [ " << std::endl;
660 for (std::vector<std::string>::iterator i = s.begin(); i != s.end(); ++i) {
661 if (i != s.begin()) {
669 answerLog <<
" compound value with " << no <<
" members: [ " << std::endl;
670 for (
int i = 0; i < no; ++i) {
672 answerLog <<
" valueDataType=" << currentValueDataType;
679 answerLog <<
" position value: (" << xv <<
"," << yv <<
")" << std::endl;
685 answerLog <<
" color value: (" << r <<
"," << g <<
"," << b <<
"," << a <<
")" << std::endl;
687 answerLog <<
"#Error: unknown valueDataType!" << std::endl;
701 const std::string edgeID =
"e_m0";
712 const std::string laneID =
"e_m6_0";
714 std::vector<TraCIConnection> connections =
lane.
getLinks(laneID);
716 for (
int i = 0; i < (int)connections.size(); ++i) {
723 <<
" state=" << c.
state 740 std::vector<std::string> edges;
741 edges.push_back(
"e_u1");
742 edges.push_back(
"e_u0");
745 edges.push_back(
"e_m4");
766 answerLog <<
" copy type 't1' to 't1_copy' and set accel to 100.\n";
774 answerLog <<
" vehicle:\n";
776 std::vector<std::string> via;
777 via.push_back(
"e_shape1");
800 answerLog <<
" getColor: r=" << (int)col2.
r <<
" g=" << (
int)col2.
g <<
" b=" << (int)col2.
b <<
" a=" << (
int)col2.
a <<
"\n";
801 answerLog <<
" getNextTLS:\n";
803 for (
int i = 0; i < (int)result.size(); ++i) {
805 answerLog <<
" tls=" << d.
id <<
" tlIndex=" << d.
tlIndex <<
" dist=" << d.
dist <<
" state=" << d.
state <<
"\n";
807 answerLog <<
" moveToXY, simStep:\n";
814 answerLog <<
" edges: " <<
joinToString(edges2,
" ") <<
"\n";
819 answerLog <<
" add:\n";
830 answerLog <<
" getLeader: " << leader.first <<
", " << leader.second <<
"\n";
832 answerLog <<
" remove:\n";
837 answerLog <<
" inductionloop:\n";
839 answerLog <<
" getVehicleData:\n";
841 for (
int i = 0; i < (int)result2.size(); ++i) {
847 answerLog <<
" simulation:\n";
849 answerLog <<
" subscribe to road and pos of vehicle '1':\n";
850 std::vector<int> vars;
855 answerLog <<
" subscription results:\n";
859 answerLog <<
" subscribe to vehicles around edge 'e_u1':\n";
860 std::vector<int> vars2;
864 answerLog <<
" context subscription results:\n";
866 for (SubscribedValues::iterator it = result4.begin(); it != result4.end(); ++it) {
867 answerLog <<
" vehicle=" << it->first <<
" pos=" << it->second[
VAR_LANEPOSITION].scalar <<
"\n";
871 answerLog <<
" person:\n";
891 std::vector<std::string> walkEdges;
892 walkEdges.push_back(
"e_u1");
893 walkEdges.push_back(
"e_shape1");
904 walkEdges.push_back(
"e_m5");
911 answerLog <<
" trafficlights:\n";
919 answerLog <<
" controlledLinks:\n";
920 for (
int i = 0; i < (int)links.size(); ++i) {
921 for (
int j = 0; j < (int)links[i].size(); ++j) {
922 answerLog <<
" index=" << i <<
" link=" << j <<
" from=" << links[i][j].from <<
" via=" << links[i][j].via <<
" to=" << links[i][j].to <<
"\n";
926 answerLog <<
" completeDefinition:\n";
927 for (
int i = 0; i < (int)logics.size(); ++i) {
928 answerLog <<
" subID=" << logics[i].subID <<
" type=" << logics[i].type <<
" phase=" << logics[i].currentPhaseIndex <<
"\n";
929 answerLog <<
" params=" <<
joinToString(logics[i].subParameter,
" ",
":") <<
"\n";
930 for (
int j = 0; j < (int)logics[i].phases.size(); ++j) {
931 answerLog <<
" phase=" << logics[i].phases[j].phase
932 <<
" dur=" << logics[i].phases[j].duration
933 <<
" minDur=" << logics[i].phases[j].duration1
934 <<
" maxDur=" << logics[i].phases[j].duration2
938 answerLog <<
" load:\n";
939 std::vector<std::string> args;
940 args.push_back(
"-n");
941 args.push_back(
"net.net.xml");
942 args.push_back(
"-r");
943 args.push_back(
"input_routes.rou.xml");
944 args.push_back(
"--no-step-log");
951 answerLog <<
" gui:\n";
953 answerLog <<
" setScheme: \n";
955 answerLog <<
" getScheme: " <<
gui.
getSchema(
"View #0") <<
"\n";
956 answerLog <<
" take screenshot: \n";
959 answerLog <<
" no support for gui commands\n";
EdgeScope edge
Scope for interaction with edges.
int run(std::string fileName, int port, std::string host="localhost")
Runs a test.
std::vector< std::string > getIDList() const
std::string getRouteID(const std::string &vehicleID) const
#define RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT
void setAccel(const std::string &typeID, double accel) const
void setRoute(const std::string &vehicleID, const std::vector< std::string > &edge) const
std::vector< libsumo::TraCILogic > getCompleteRedYellowGreenDefinition(const std::string &tlsID) const
std::vector< std::string > getIDList() const
std::string id
The id of the next tls.
void send_commandSetValue(int domID, int varID, const std::string &objID, tcpip::Storage &content) const
Sends a SetVariable request.
void remove(const std::string &vehicleID, char reason=REMOVE_VAPORIZED) const
void setMinGapLat(const std::string &typeID, double minGapLat) const
int getNextSwitch(const std::string &tlsID) const
double leaveTime
Leave-time of the vehicle in [s].
void readAndReportTypeDependent(tcpip::Storage &inMsg, int valueDataType)
Reads a value of the given type from the given storage and reports it.
void screenshot(const std::string &viewID, const std::string &filename) const
void setWidth(const std::string &typeID, double width) const
void setColor(const std::string &vehicleID, const libsumo::TraCIColor &c) const
void appendDrivingStage(const std::string &personID, const std::string &toEdge, const std::string &lines, const std::string &stopID="")
#define REQUEST_DRIVINGDIST
std::vector< std::string > getIDList() const
void check_resultState(tcpip::Storage &inMsg, int command, bool ignoreCommandId=false, std::string *acknowledgement=0) const
Validates the result state of a command.
void connect(const std::string &host, int port)
Connects to the specified SUMO server.
double dist
The distance to the tls.
void setLength(const std::string &personID, double length) const
std::string typeID
Type of the vehicle in.
void changeTarget(const std::string &vehicleID, const std::string &edgeID) const
void setOrder(int order)
set priority (execution order) for the client
#define CMD_GET_VEHICLE_VARIABLE
std::vector< libsumo::TraCIConnection > getLinks(const std::string &laneID) const
void commandSetOrder(int order)
Sends and validates a SetOrder command.
SUMOTime getCurrentTime() const
std::stringstream answerLog
Stream containing the log.
void setVia(const std::string &vehicleID, const std::vector< std::string > &via) const
virtual std::vector< std::string > readStringList()
#define RESPONSE_SUBSCRIBE_GUI_VARIABLE
void commandSubscribeObjectVariable(int domID, const std::string &objID, SUMOTime beginTime, SUMOTime endTime, int varNo, std::ifstream &defFile)
Sends and validates a SubscribeVariable command.
mirrors MSInductLoop::VehicleData
void setRouteID(const std::string &vehicleID, const std::string &routeID) const
void testAPI()
call all API methods once
int setValueTypeDependant(tcpip::Storage &into, std::ifstream &defFile, std::stringstream &msg)
Parses the next value type / value pair from the stream and inserts it into the storage.
libsumo::TraCIColor getColor(const std::string &vehicleID) const
std::vector< libsumo::TraCINextTLSData > getNextTLS(const std::string &vehID) const
double getWaitingTime(const std::string &vehicleID) const
std::string getTypeID(const std::string &vehicleID) const
void send_commandGetVariable(int domID, int varID, const std::string &objID, tcpip::Storage *add=0) const
Sends a GetVariable request.
double getEmergencyDecel(const std::string &typeID) const
LaneScope lane
Scope for interaction with lanes.
virtual double readDouble()
PersonScope person
Scope for interaction with persons.
double getMaxSpeedLat(const std::string &typeID) const
void rerouteTraveltime(const std::string &vehicleID, bool currentTravelTimes=true) const
void setMaxSpeedLat(const std::string &typeID, double speed) const
double getMaxSpeed(const std::string &vehicleID) const
void setLine(const std::string &vehicleID, const std::string &line) const
bool validateSubscription(tcpip::Storage &inMsg)
Validates whether the given message is a valid subscription return message.
std::string getRoadID(const std::string &vehicleID) const
void appendWaitingStage(const std::string &personID, double duration, const std::string &description="waiting", const std::string &stopID="")
void load(const std::vector< std::string > &args)
Let sumo load a simulation using the given command line like options.
double getSpeed(const std::string &personID) const
void send_commandSetOrder(int order) const
Sends a SetOrder command.
void closeSocket()
Closes the connection.
void simulationStep(SUMOTime time=0)
Advances by one step (or up to the given time)
std::string getNextEdge(const std::string &personID) const
std::string outputFileName
The name of the file to write the results log into.
virtual void writeUnsignedByte(int)
std::string getRedYellowGreenState(const std::string &tlsID) const
TrafficLightScope trafficlights
Scope for interaction with traffic lights.
int getPhase(const std::string &tlsID) const
std::string getLine(const std::string &vehicleID) const
void removeStage(const std::string &personID, int nextStageIndex) const
InductionLoopScope inductionloop
Scope for interaction with inductive loops.
virtual void writeInt(int)
std::vector< std::string > getEdges(const std::string &vehicleID) const
virtual int readUnsignedByte()
std::vector< libsumo::TraCIVehicleData > getVehicleData(const std::string &loopID) const
#define RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE
bool validateSimulationStep2(tcpip::Storage &inMsg)
Validates whether the given message is a valid answer to CMD_SIMSTEP.
const SubscribedValues & getSubscriptionResults() const
void commandSetValue(int domID, int varID, const std::string &objID, std::ifstream &defFile)
Sends and validates a SetVariable command.
void moveToXY(const std::string &vehicleID, const std::string &edgeID, const int lane, const double x, const double y, const double angle, const int keepRoute) const
void rerouteTraveltime(const std::string &personID) const
std::string getShapeClass(const std::string &vehicleID) const
std::string getTypeID(const std::string &personID) const
std::vector< std::string > getIDList() const
void setHeight(const std::string &personID, double height) const
std::vector< std::string > getVia(const std::string &vehicleID) const
std::map< std::string, TraCIValues > SubscribedValues
void setType(const std::string &vehicleID, const std::string &typeID) const
std::string approachedInternal
void writeResult()
Writes the results file.
void send_commandSubscribeObjectVariable(int domID, const std::string &objID, SUMOTime beginTime, SUMOTime endTime, const std::vector< int > &vars) const
Sends a SubscribeVariable request.
double getAccumulatedWaitingTime(const std::string &vehicleID) const
virtual void writeByte(int)
RouteScope route
Scope for interaction with routes.
std::map< int, libsumo::TraCIValue > TraCIValues
{object->{variable->value}}
void send_commandSimulationStep(SUMOTime time) const
Sends a SimulationStep command.
virtual const char * what() const
double getLateralLanePosition(const std::string &vehicleID) const
virtual void writeStringList(const std::vector< std::string > &s)
void setLateralAlignment(const std::string &typeID, const std::string &latAlignment) const
SUMOTime string2time(const std::string &r)
double length
Length of the vehicle.
void add(const std::string &personID, const std::string &edgeID, double pos, double depart=DEPARTFLAG_NOW, const std::string typeID="DEFAULT_PEDTYPE")
double getWaitingTime(const std::string &personID) const
std::string getRoadID(const std::string &personID) const
std::string id
The id of the vehicle.
virtual std::string readString()
bool isRouteValid(const std::string &vehicleID) const
void add(const std::string &routeID, const std::vector< std::string > &edges) const
std::string getProgram(const std::string &tlsID) const
#define CMD_SUBSCRIBE_EDGE_CONTEXT
void setWidth(const std::string &personID, double width) const
void setSpeed(const std::string &personID, double speed) const
void setShapeClass(const std::string &vehicleID, const std::string &clazz) const
std::string getVehicle(const std::string &personID) const
std::string approachedLane
TraCITestClient(std::string outputFileName="testclient_result.out")
Constructor.
virtual void writeFloat(float)
const SubscribedContextValues & getContextSubscriptionResults() const
double getEffort(const std::string &edgeID, SUMOTime time) const
int getRemainingStages(const std::string &personID) const
double getSlope(const std::string &vehicleID) const
void errorMsg(std::stringstream &msg)
Writes an error message.
#define RESPONSE_SUBSCRIBE_GUI_CONTEXT
void commandSubscribeContextVariable(int domID, const std::string &objID, SUMOTime beginTime, SUMOTime endTime, int domain, double range, int varNo, std::ifstream &defFile)
Sends and validates a SubscribeContext command.
SimulationScope simulation
Scope for interaction with the simulation.
std::pair< std::string, double > getLeader(const std::string &vehicleID, double dist) const
virtual void writeString(const std::string &s)
void setMaxSpeed(const std::string &vehicleID, double speed) const
void setColor(const std::string &personID, const libsumo::TraCIColor &c) const
VehicleScope vehicle
Scope for interaction with vehicles.
void adaptTraveltime(const std::string &edgeID, double time, int beginSeconds=0, int endSeconds=std::numeric_limits< int >::max()) const
#define CMD_SUBSCRIBE_VEHICLE_VARIABLE
double getHeight(const std::string &typeID) const
std::vector< std::string > getControlledLanes(const std::string &tlsID) const
int getLinkNumber(const std::string &laneID) const
virtual float readFloat()
char state
The current state of the tls.
void setEmergencyDecel(const std::string &typeID, double decel) const
void commandClose()
Sends and validates a Close command.
void send_commandClose() const
Sends a Close command.
void copy(const std::string &origTypeID, const std::string &newTypeID) const
int check_commandGetResult(tcpip::Storage &inMsg, int command, int expectedType=-1, bool ignoreCommandId=false) const
Validates the result state of a command.
int getSpeedMode(const std::string &vehicleID) const
void setSchema(const std::string &viewID, const std::string &schemeName) const
void setEffort(const std::string &edgeID, double effort, int beginSeconds=0, int endSeconds=std::numeric_limits< int >::max()) const
std::vector< std::string > getIDList() const
virtual void writeDouble(double)
double getTraveltime(const std::string &edgeID) const
GUIScope gui
Scope for interaction with the gui.
void setMinGap(const std::string &personID, double minGap) const
void subscribe(int domID, const std::string &objID, SUMOTime beginTime, SUMOTime endTime, const std::vector< int > &vars) const
void subscribeContext(int domID, const std::string &objID, SUMOTime beginTime, SUMOTime endTime, int domain, double range, const std::vector< int > &vars) const
std::string getLateralAlignment(const std::string &typeID) const
void appendWalkingStage(const std::string &personID, const std::vector< std::string > &edges, double arrivalPos, double duration=-1, double speed=-1, const std::string &stopID="")
double getApparentDecel(const std::string &typeID) const
std::vector< std::string > getIDList() const
void setHeight(const std::string &typeID, double height) const
std::string getLaneID(const std::string &vehicleID) const
std::vector< std::vector< libsumo::TraCILink > > getControlledLinks(const std::string &tlsID) const
int getStage(const std::string &personID, int nextStageIndex=0) const
double getLanePosition(const std::string &vehicleID) const
double entryTime
Entry-time of the vehicle in [s].
void commandGetVariable(int domID, int varID, const std::string &objID, tcpip::Storage *addData=0)
Sends and validates a GetVariable command.
void removeStages(const std::string &personID) const
double getAccel(const std::string &typeID) const
void add(const std::string &vehicleID, const std::string &routeID, const std::string &typeID="DEFAULT_VEHTYPE", std::string depart="-1", const std::string &departLane="first", const std::string &departPos="base", const std::string &departSpeed="0", const std::string &arrivalLane="current", const std::string &arrivalPos="max", const std::string &arrivalSpeed="current", const std::string &fromTaz="", const std::string &toTaz="", const std::string &line="", int personCapacity=0, int personNumber=0) const
void commandSimulationStep(SUMOTime time)
Sends and validates a simulation step command.
double getAdaptedTraveltime(const std::string &edgeID, double time) const
void setType(const std::string &personID, const std::string &typeID) const
void moveTo(const std::string &vehicleID, const std::string &laneID, double position) const
void send_commandSubscribeObjectContext(int domID, const std::string &objID, SUMOTime beginTime, SUMOTime endTime, int domain, double range, const std::vector< int > &vars) const
Sends a SubscribeContext request.
std::vector< std::string > getEdges(const std::string &personID, int nextStageIndex=0) const
std::vector< std::string > getInternalFoes(const std::string &laneID) const
int tlIndex
The tls index of the controlled link.
std::vector< std::string > getFoes(const std::string &laneID, const std::string &toLaneID) const
double getWidth(const std::string &typeID) const
double getMinGapLat(const std::string &typeID) const
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
~TraCITestClient()
Destructor.
std::vector< std::string > getIDList() const
std::vector< std::string > getIDList() const
std::string getSchema(const std::string &viewID=DEFAULT_VIEW) const
void setApparentDecel(const std::string &typeID, double decel) const
VehicleTypeScope vehicletype
Scope for interaction with vehicle types.