Eclipse SUMO - Simulation of Urban MObility
|
A test execution class. More...
#include <TraCITestClient.h>
Public Member Functions | |
std::pair< int, std::string > | getVersion () |
return TraCI API and SUMO version | |
void | load (const std::vector< std::string > &args) |
Let sumo load a simulation using the given command line like options. | |
int | run (std::string fileName, int port, std::string host="localhost") |
Runs a test. | |
void | simulationStep (double time=0) |
Advances by one step (or up to the given time) | |
TraCITestClient (std::string outputFileName="testclient_result.out") | |
Constructor. | |
~TraCITestClient () | |
Destructor. | |
Connection handling | |
void | connect (const std::string &host, int port) |
Connects to the specified SUMO server. | |
void | setOrder (int order) |
set priority (execution order) for the client | |
void | close () |
ends the simulation and closes the connection | |
Data Fields | |
EdgeScope | edge |
Scope for interaction with edges. | |
GUIScope | gui |
Scope for interaction with the gui. | |
InductionLoopScope | inductionloop |
Scope for interaction with inductive loops. | |
JunctionScope | junction |
Scope for interaction with junctions. | |
LaneScope | lane |
Scope for interaction with lanes. | |
LaneAreaScope | lanearea |
Scope for interaction with lanes. | |
MeMeScope | multientryexit |
Scope for interaction with multi-entry/-exit detectors. | |
PersonScope | person |
Scope for interaction with persons. | |
POIScope | poi |
Scope for interaction with POIs. | |
PolygonScope | polygon |
Scope for interaction with polygons. | |
RerouterScope | rerouter |
Scope for interaction with rerouters. | |
RouteScope | route |
Scope for interaction with routes. | |
RouteProbeScope | routeprobe |
Scope for interaction with route probes. | |
SimulationScope | simulation |
Scope for interaction with the simulation. | |
TrafficLightScope | trafficlights |
Scope for interaction with traffic lights. | |
VehicleScope | vehicle |
Scope for interaction with vehicles. | |
VehicleTypeScope | vehicletype |
Scope for interaction with vehicle types. | |
Protected Member Functions | |
void | closeSocket () |
Closes the connection. | |
void | readContextSubscription (int cmdId, tcpip::Storage &inMsg) |
void | readVariables (tcpip::Storage &inMsg, const std::string &objectID, int variableCount, libsumo::SubscriptionResults &into) |
void | readVariableSubscription (int cmdId, tcpip::Storage &inMsg) |
Commands handling | |
void | commandSimulationStep (double time) |
Sends and validates a simulation step command. | |
void | commandClose () |
Sends and validates a Close command. | |
void | commandSetOrder (int order) |
Sends and validates a SetOrder command. | |
void | commandGetVariable (int domID, int varID, const std::string &objID, tcpip::Storage *addData=0) |
Sends and validates a GetVariable command. | |
void | commandSetValue (int domID, int varID, const std::string &objID, std::ifstream &defFile) |
Sends and validates a SetVariable command. | |
void | commandSubscribeObjectVariable (int domID, const std::string &objID, double beginTime, double endTime, int varNo, std::ifstream &defFile) |
Sends and validates a SubscribeVariable command. | |
void | commandSubscribeContextVariable (int domID, const std::string &objID, double beginTime, double endTime, int domain, double range, int varNo, std::ifstream &defFile) |
Sends and validates a SubscribeContext command. | |
Command sending methods | |
void | send_commandSimulationStep (double time) const |
Sends a SimulationStep command. | |
void | send_commandClose () const |
Sends a Close command. | |
void | send_commandSetOrder (int order) const |
Sends a SetOrder command. | |
void | createCommand (int cmdID, int varID, const std::string &objID, tcpip::Storage *add=nullptr) const |
Sends a GetVariable / SetVariable request if mySocket is connected. Otherwise writes to myOutput only. | |
void | createFilterCommand (int cmdID, int varID, tcpip::Storage *add=nullptr) const |
void | send_commandSubscribeObjectVariable (int domID, const std::string &objID, double beginTime, double endTime, const std::vector< int > &vars) const |
Sends a SubscribeVariable request. | |
void | send_commandSubscribeObjectContext (int domID, const std::string &objID, double beginTime, double endTime, int domain, double range, const std::vector< int > &vars) const |
Sends a SubscribeContext request. | |
void | check_resultState (tcpip::Storage &inMsg, int command, bool ignoreCommandId=false, std::string *acknowledgement=0) const |
Validates the result state of a command. | |
int | check_commandGetResult (tcpip::Storage &inMsg, int command, int expectedType=-1, bool ignoreCommandId=false) const |
Validates the result state of a command. | |
bool | processGet (int command, int expectedType, bool ignoreCommandId=false) |
bool | processSet (int command) |
Static Protected Member Functions | |
template<class T > | |
static std::string | toString (const T &t, std::streamsize accuracy=PRECISION) |
Protected Attributes | |
std::map< int, TraCIScopeWrapper * > | myDomains |
tcpip::Storage | myInput |
The reusable input storage. | |
tcpip::Storage | myOutput |
The reusable output storage. | |
tcpip::Socket * | mySocket |
The socket. | |
Private Member Functions | |
std::string | joinToString (const std::map< std::string, std::string > &m) |
std::string | joinToString (const std::vector< double > &v, const std::string &between) |
std::string | joinToString (const std::vector< std::string > &s, const std::string &between) |
void | testAPI () |
call all API methods once | |
Report helper | |
void | writeResult () |
Writes the results file. | |
void | errorMsg (std::stringstream &msg) |
Writes an error message. | |
Results validation methods | |
bool | validateSimulationStep2 (tcpip::Storage &inMsg) |
Validates whether the given message is a valid answer to CMD_SIMSTEP. | |
bool | validateSubscription (tcpip::Storage &inMsg) |
Validates whether the given message is a valid subscription return message. | |
Conversion helper | |
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. | |
void | readAndReportTypeDependent (tcpip::Storage &inMsg, int valueDataType) |
Reads a value of the given type from the given storage and reports it. | |
Private Attributes | |
std::stringstream | answerLog |
Stream containing the log. | |
std::string | outputFileName |
The name of the file to write the results log into. | |
A test execution class.
Reads a program file and executes the actions stored within it
Definition at line 42 of file TraCITestClient.h.
TraCITestClient::TraCITestClient | ( | std::string | outputFileName = "testclient_result.out" | ) |
Constructor.
[in] | outputFileName | The name of the file the outputs will be written into |
Definition at line 53 of file TraCITestClient.cpp.
References answerLog.
TraCITestClient::~TraCITestClient | ( | ) |
|
protectedinherited |
Validates the result state of a command.
Definition at line 299 of file TraCIAPI.cpp.
References tcpip::Storage::position(), tcpip::Storage::readInt(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), and TraCIAPI::toString().
Referenced by commandGetVariable(), TraCIAPI::processGet(), and TraCIAPI::simulationStep().
|
protectedinherited |
Validates the result state of a command.
[in] | inMsg | The buffer to read the message from |
[in] | command | The original command id |
[in] | ignoreCommandId | Whether the returning command id shall be validated |
[in] | acknowledgement | Pointer to an existing string into which the acknowledgement message shall be inserted |
Definition at line 260 of file TraCIAPI.cpp.
References TraCIAPI::mySocket, tcpip::Storage::position(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), tcpip::Socket::receiveExact(), libsumo::RTYPE_ERR, libsumo::RTYPE_NOTIMPLEMENTED, libsumo::RTYPE_OK, and TraCIAPI::toString().
Referenced by TraCIAPI::close(), commandClose(), commandGetVariable(), commandSetOrder(), commandSetValue(), commandSimulationStep(), commandSubscribeContextVariable(), commandSubscribeObjectVariable(), TraCIAPI::getVersion(), TraCIAPI::load(), TraCIAPI::processGet(), TraCIAPI::processSet(), TraCIAPI::setOrder(), and TraCIAPI::simulationStep().
|
inherited |
ends the simulation and closes the connection
Definition at line 96 of file TraCIAPI.cpp.
References TraCIAPI::check_resultState(), TraCIAPI::closeSocket(), libsumo::CMD_CLOSE, and TraCIAPI::send_commandClose().
|
protectedinherited |
Closes the connection.
Definition at line 106 of file TraCIAPI.cpp.
References tcpip::Socket::close(), and TraCIAPI::mySocket.
Referenced by TraCIAPI::close(), and run().
|
protected |
Sends and validates a Close command.
Definition at line 196 of file TraCITestClient.cpp.
References answerLog, TraCIAPI::check_resultState(), libsumo::CMD_CLOSE, and TraCIAPI::send_commandClose().
Referenced by run().
|
protected |
Sends and validates a GetVariable command.
[in] | domID | The ID of the domain the addressed object belongs to |
[in] | varID | The ID of the variable one asks for |
[in] | objID | The ID of the object a variable shall be retrieved from |
[in] | addData | Storage to read additional data from, if needed |
Definition at line 226 of file TraCITestClient.cpp.
References answerLog, TraCIAPI::check_commandGetResult(), TraCIAPI::check_resultState(), TraCIAPI::createCommand(), errorMsg(), TraCIAPI::myOutput, TraCIAPI::mySocket, readAndReportTypeDependent(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), and tcpip::Socket::sendExact().
Referenced by run().
|
protected |
Sends and validates a SetOrder command.
Definition at line 211 of file TraCITestClient.cpp.
References answerLog, TraCIAPI::check_resultState(), libsumo::CMD_SETORDER, and TraCIAPI::send_commandSetOrder().
Referenced by run().
|
protected |
Sends and validates a SetVariable command.
[in] | domID | The ID of the domain the addressed object belongs to |
[in] | varID | The ID of the variable to set |
[in] | objID | The ID of the object which shall be changed |
[in] | defFile | Storage to read additional data from |
Definition at line 260 of file TraCITestClient.cpp.
References answerLog, TraCIAPI::check_resultState(), TraCIAPI::createCommand(), errorMsg(), TraCIAPI::myOutput, TraCIAPI::mySocket, tcpip::Socket::sendExact(), and setValueTypeDependant().
Referenced by run().
|
protected |
Sends and validates a simulation step command.
[in] | time | The time step to send |
Definition at line 180 of file TraCITestClient.cpp.
References answerLog, TraCIAPI::check_resultState(), libsumo::CMD_SIMSTEP, TraCIAPI::send_commandSimulationStep(), and validateSimulationStep2().
Referenced by run().
|
protected |
Sends and validates a SubscribeContext command.
[in] | domID | The ID of the domain the addressed object belongs to |
[in] | objID | The ID of the object a variable shall be subscribed from |
[in] | beginTime | The time the subscription shall begin at |
[in] | endTime | The time the subscription shall end at |
[in] | domain | The domain of the objects which shall be reported |
[in] | range | The range within which objects shall be for being reported |
[in] | varNo | The number of subscribed variables |
[in] | defFile | The stream to read variable values from |
Definition at line 308 of file TraCITestClient.cpp.
References answerLog, TraCIAPI::check_resultState(), TraCIAPI::send_commandSubscribeObjectContext(), and validateSubscription().
Referenced by run().
|
protected |
Sends and validates a SubscribeVariable command.
[in] | domID | The ID of the domain the addressed object belongs to |
[in] | objID | The ID of the object a variable shall be subscribed from |
[in] | beginTime | The time the subscription shall begin at |
[in] | endTime | The time the subscription shall end at |
[in] | varNo | The number of subscribed variables |
[in] | defFile | The stream to read variable values from |
Definition at line 284 of file TraCITestClient.cpp.
References answerLog, TraCIAPI::check_resultState(), TraCIAPI::send_commandSubscribeObjectVariable(), and validateSubscription().
Referenced by run().
|
inherited |
Connects to the specified SUMO server.
[in] | host | The name of the host to connect to |
[in] | port | The port to connect to |
tcpip::SocketException | if the connection fails |
Definition at line 68 of file TraCIAPI.cpp.
References tcpip::Socket::connect(), and TraCIAPI::mySocket.
Referenced by joinToString(), joinToString(), joinToString(), and run().
|
protectedinherited |
Sends a GetVariable / SetVariable request if mySocket is connected. Otherwise writes to myOutput only.
[in] | cmdID | The command and domain of the variable |
[in] | varID | The variable to retrieve |
[in] | objID | The object to retrieve the variable from |
[in] | add | Optional additional parameter |
Definition at line 154 of file TraCIAPI.cpp.
References TraCIAPI::myOutput, tcpip::Storage::reset(), tcpip::Storage::size(), tcpip::Storage::writeInt(), tcpip::Storage::writeStorage(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by commandGetVariable(), and commandSetValue().
|
protectedinherited |
Definition at line 178 of file TraCIAPI.cpp.
References TraCIAPI::myOutput, tcpip::Storage::reset(), tcpip::Storage::size(), tcpip::Storage::writeInt(), tcpip::Storage::writeStorage(), and tcpip::Storage::writeUnsignedByte().
|
private |
Writes an error message.
[in] | msg | The message to write |
Definition at line 351 of file TraCITestClient.cpp.
References answerLog.
Referenced by commandGetVariable(), commandSetValue(), and run().
|
inherited |
return TraCI API and SUMO version
Definition at line 479 of file TraCIAPI.cpp.
References TraCIAPI::check_resultState(), libsumo::CMD_GETVERSION, TraCIAPI::mySocket, tcpip::Storage::readInt(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), tcpip::Socket::sendExact(), and tcpip::Storage::writeUnsignedByte().
Referenced by testAPI().
|
inlineprivate |
Definition at line 200 of file TraCITestClient.h.
References TraCIAPI::connect().
|
inlineprivate |
Definition at line 214 of file TraCITestClient.h.
References TraCIAPI::connect().
|
inlineprivate |
Definition at line 186 of file TraCITestClient.h.
References TraCIAPI::connect().
Referenced by testAPI().
|
inherited |
Let sumo load a simulation using the given command line like options.
Definition at line 461 of file TraCIAPI.cpp.
References TraCIAPI::check_resultState(), libsumo::CMD_LOAD, TraCIAPI::mySocket, tcpip::Socket::sendExact(), libsumo::TYPE_STRINGLIST, tcpip::Storage::writeInt(), tcpip::Storage::writeStringList(), and tcpip::Storage::writeUnsignedByte().
Referenced by testAPI().
|
protectedinherited |
Definition at line 323 of file TraCIAPI.cpp.
References TraCIAPI::check_commandGetResult(), TraCIAPI::check_resultState(), TraCIAPI::myInput, TraCIAPI::myOutput, TraCIAPI::mySocket, tcpip::Storage::reset(), and tcpip::Socket::sendExact().
|
protectedinherited |
Definition at line 336 of file TraCIAPI.cpp.
References TraCIAPI::check_resultState(), TraCIAPI::myInput, TraCIAPI::myOutput, TraCIAPI::mySocket, tcpip::Storage::reset(), and tcpip::Socket::sendExact().
|
private |
Reads a value of the given type from the given storage and reports it.
[in] | inMsg | The storage to read the value from |
[in] | valueDataType | The type of the expected value |
Definition at line 568 of file TraCITestClient.cpp.
References answerLog, libsumo::POSITION_2D, libsumo::POSITION_3D, libsumo::POSITION_ROADMAP, readAndReportTypeDependent(), tcpip::Storage::readByte(), tcpip::Storage::readDouble(), tcpip::Storage::readInt(), tcpip::Storage::readString(), tcpip::Storage::readStringList(), tcpip::Storage::readUnsignedByte(), libsumo::TYPE_BYTE, libsumo::TYPE_COLOR, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_POLYGON, libsumo::TYPE_STRING, libsumo::TYPE_STRINGLIST, and libsumo::TYPE_UBYTE.
Referenced by commandGetVariable(), readAndReportTypeDependent(), and validateSubscription().
|
protectedinherited |
Definition at line 424 of file TraCIAPI.cpp.
References TraCIAPI::myDomains, tcpip::Storage::readInt(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), and TraCIAPI::readVariables().
Referenced by TraCIAPI::simulationStep().
|
protectedinherited |
Definition at line 348 of file TraCIAPI.cpp.
References libsumo::POSITION_2D, libsumo::POSITION_3D, tcpip::Storage::readDouble(), tcpip::Storage::readInt(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), libsumo::RTYPE_OK, TraCIAPI::toString(), libsumo::TYPE_COLOR, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_STRING, and libsumo::TYPE_STRINGLIST.
Referenced by TraCIAPI::readContextSubscription(), and TraCIAPI::readVariableSubscription().
|
protectedinherited |
Definition at line 416 of file TraCIAPI.cpp.
References TraCIAPI::myDomains, tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), and TraCIAPI::readVariables().
Referenced by TraCIAPI::simulationStep().
int TraCITestClient::run | ( | std::string | fileName, |
int | port, | ||
std::string | host = "localhost" |
||
) |
Runs a test.
[in] | fileName | The name of the file containing the test script |
[in] | port | The server port to connect to |
[in] | host | The server name to connect to |
Definition at line 67 of file TraCITestClient.cpp.
References TraCIAPI::closeSocket(), commandClose(), commandGetVariable(), commandSetOrder(), commandSetValue(), commandSimulationStep(), commandSubscribeContextVariable(), commandSubscribeObjectVariable(), TraCIAPI::connect(), errorMsg(), setValueTypeDependant(), and testAPI().
Referenced by main().
|
protectedinherited |
Sends a Close command.
Definition at line 130 of file TraCIAPI.cpp.
References libsumo::CMD_CLOSE, TraCIAPI::mySocket, tcpip::Socket::sendExact(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCIAPI::close(), and commandClose().
|
protectedinherited |
Sends a SetOrder command.
Definition at line 141 of file TraCIAPI.cpp.
References libsumo::CMD_SETORDER, TraCIAPI::mySocket, tcpip::Socket::sendExact(), tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().
Referenced by commandSetOrder().
|
protectedinherited |
Sends a SimulationStep command.
Definition at line 117 of file TraCIAPI.cpp.
References libsumo::CMD_SIMSTEP, TraCIAPI::mySocket, tcpip::Socket::sendExact(), tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by commandSimulationStep(), and TraCIAPI::simulationStep().
|
protectedinherited |
Sends a SubscribeContext request.
[in] | domID | The domain of the variable |
[in] | objID | The object to subscribe the variables from |
[in] | beginTime | The begin time step of subscriptions |
[in] | endTime | The end time step of subscriptions |
[in] | domain | The domain of the objects which values shall be returned |
[in] | range | The range around the obj to investigate |
[in] | vars | The variables to subscribe |
Definition at line 229 of file TraCIAPI.cpp.
References TraCIAPI::mySocket, tcpip::Socket::sendExact(), tcpip::Storage::size(), tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by commandSubscribeContextVariable().
|
protectedinherited |
Sends a SubscribeVariable request.
[in] | domID | The domain of the variable |
[in] | objID | The object to subscribe the variables from |
[in] | beginTime | The begin time step of subscriptions |
[in] | endTime | The end time step of subscriptions |
[in] | vars | The variables to subscribe |
Definition at line 201 of file TraCIAPI.cpp.
References TraCIAPI::mySocket, tcpip::Socket::sendExact(), tcpip::Storage::size(), tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by commandSubscribeObjectVariable().
|
inherited |
set priority (execution order) for the client
Definition at line 81 of file TraCIAPI.cpp.
References TraCIAPI::check_resultState(), libsumo::CMD_SETORDER, TraCIAPI::mySocket, tcpip::Socket::sendExact(), tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().
Referenced by testAPI().
|
private |
Parses the next value type / value pair from the stream and inserts it into the storage.
[out] | into | The storage to add the value type and the value into |
[in] | defFile | The file to read the values from |
[out] | msg | If any error occurs, this should be filled |
Definition at line 437 of file TraCITestClient.cpp.
References libsumo::POSITION_2D, libsumo::POSITION_3D, libsumo::POSITION_ROADMAP, libsumo::REQUEST_AIRDIST, libsumo::REQUEST_DRIVINGDIST, setValueTypeDependant(), libsumo::TYPE_BYTE, libsumo::TYPE_COLOR, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_POLYGON, libsumo::TYPE_STRING, libsumo::TYPE_STRINGLIST, libsumo::TYPE_UBYTE, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), and tcpip::Storage::writeUnsignedByte().
Referenced by commandSetValue(), run(), and setValueTypeDependant().
|
inherited |
Advances by one step (or up to the given time)
Definition at line 439 of file TraCIAPI.cpp.
References TraCIAPI::check_commandGetResult(), TraCIAPI::check_resultState(), libsumo::CMD_SIMSTEP, TraCIAPI::myDomains, TraCIAPI::readContextSubscription(), tcpip::Storage::readInt(), TraCIAPI::readVariableSubscription(), libsumo::RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE, libsumo::RESPONSE_SUBSCRIBE_PERSON_VARIABLE, and TraCIAPI::send_commandSimulationStep().
Referenced by testAPI().
|
private |
call all API methods once
Definition at line 646 of file TraCITestClient.cpp.
References libsumo::TraCIColor::a, TraCIAPI::EdgeScope::adaptTraveltime(), TraCIAPI::PersonScope::add(), TraCIAPI::RouteScope::add(), TraCIAPI::VehicleScope::add(), TraCIAPI::VehicleScope::addSubscriptionFilterCFManeuver(), TraCIAPI::VehicleScope::addSubscriptionFilterDownstreamDistance(), TraCIAPI::VehicleScope::addSubscriptionFilterFieldOfVision(), TraCIAPI::VehicleScope::addSubscriptionFilterLanes(), TraCIAPI::VehicleScope::addSubscriptionFilterLateralDistance(), TraCIAPI::VehicleScope::addSubscriptionFilterLCManeuver(), TraCIAPI::VehicleScope::addSubscriptionFilterLeadFollow(), TraCIAPI::VehicleScope::addSubscriptionFilterNoOpposite(), TraCIAPI::VehicleScope::addSubscriptionFilterTurn(), TraCIAPI::VehicleScope::addSubscriptionFilterUpstreamDistance(), TraCIAPI::VehicleScope::addSubscriptionFilterVClass(), TraCIAPI::VehicleScope::addSubscriptionFilterVType(), answerLog, TraCIAPI::PersonScope::appendDrivingStage(), TraCIAPI::PersonScope::appendStage(), TraCIAPI::PersonScope::appendWaitingStage(), TraCIAPI::PersonScope::appendWalkingStage(), libsumo::TraCIConnection::approachedInternal, libsumo::TraCIConnection::approachedLane, libsumo::TraCIStage::arrivalPos, libsumo::TraCIColor::b, TraCIAPI::VehicleScope::changeTarget(), libsumo::CMD_GET_VEHICLE_VARIABLE, TraCIAPI::SimulationScope::convert2D(), TraCIAPI::SimulationScope::convert3D(), TraCIAPI::SimulationScope::convertGeo(), TraCIAPI::SimulationScope::convertRoad(), TraCIAPI::VehicleTypeScope::copy(), libsumo::TraCIStage::description, libsumo::TraCIConnection::direction, libsumo::TraCINextTLSData::dist, TraCIAPI::edge, libsumo::TraCIStage::edges, libsumo::TraCIVehicleData::entryTime, TraCIAPI::SimulationScope::findRoute(), libsumo::TraCIColor::g, TraCIAPI::VehicleTypeScope::getAccel(), TraCIAPI::VehicleScope::getAcceleration(), TraCIAPI::VehicleScope::getAccumulatedWaitingTime(), TraCIAPI::EdgeScope::getAdaptedTraveltime(), TraCIAPI::TrafficLightScope::getAllProgramLogics(), TraCIAPI::PersonScope::getAngle(), TraCIAPI::VehicleTypeScope::getApparentDecel(), TraCIAPI::SimulationScope::getBusStopWaiting(), TraCIAPI::SimulationScope::getBusStopWaitingIDList(), TraCIAPI::PersonScope::getColor(), TraCIAPI::POIScope::getColor(), TraCIAPI::PolygonScope::getColor(), TraCIAPI::VehicleScope::getColor(), TraCIAPI::TraCIScopeWrapper::getContextSubscriptionResults(), TraCIAPI::TrafficLightScope::getControlledLanes(), TraCIAPI::TrafficLightScope::getControlledLinks(), TraCIAPI::SimulationScope::getCurrentTime(), TraCIAPI::SimulationScope::getDeltaT(), TraCIAPI::SimulationScope::getDistance2D(), TraCIAPI::SimulationScope::getDistanceRoad(), TraCIAPI::PersonScope::getEdges(), TraCIAPI::EdgeScope::getEffort(), TraCIAPI::VehicleTypeScope::getEmergencyDecel(), TraCIAPI::LaneScope::getFoes(), TraCIAPI::VehicleScope::getFollower(), TraCIAPI::VehicleScope::getFollowSpeed(), TraCIAPI::VehicleTypeScope::getHeight(), TraCIAPI::TraCIScopeWrapper::getIDCount(), TraCIAPI::TraCIScopeWrapper::getIDList(), TraCIAPI::LaneScope::getInternalFoes(), TraCIAPI::VehicleScope::getLaneChangeMode(), TraCIAPI::VehicleScope::getLaneChangeState(), TraCIAPI::PersonScope::getLaneID(), TraCIAPI::VehicleScope::getLaneID(), TraCIAPI::EdgeScope::getLaneNumber(), TraCIAPI::PersonScope::getLanePosition(), TraCIAPI::VehicleScope::getLanePosition(), TraCIAPI::VehicleTypeScope::getLateralAlignment(), TraCIAPI::VehicleScope::getLateralLanePosition(), TraCIAPI::VehicleScope::getLateralSpeed(), TraCIAPI::VehicleScope::getLeader(), TraCIAPI::PersonScope::getLength(), TraCIAPI::VehicleScope::getLine(), TraCIAPI::PolygonScope::getLineWidth(), TraCIAPI::LaneScope::getLinkNumber(), TraCIAPI::LaneScope::getLinks(), TraCIAPI::LaneScope::getMaxSpeed(), TraCIAPI::VehicleScope::getMaxSpeed(), TraCIAPI::VehicleTypeScope::getMaxSpeedLat(), TraCIAPI::VehicleTypeScope::getMinGapLat(), TraCIAPI::PersonScope::getNextEdge(), TraCIAPI::TrafficLightScope::getNextSwitch(), TraCIAPI::VehicleScope::getNextTLS(), TraCIAPI::SimulationScope::getOption(), TraCIAPI::TraCIScopeWrapper::getParameter(), TraCIAPI::TraCIScopeWrapper::getParameterWithKey(), TraCIAPI::VehicleTypeScope::getPersonCapacity(), TraCIAPI::VehicleScope::getPersonCapacity(), TraCIAPI::TrafficLightScope::getPhase(), TraCIAPI::TrafficLightScope::getPhaseDuration(), TraCIAPI::TrafficLightScope::getPhaseName(), TraCIAPI::PersonScope::getPosition(), TraCIAPI::POIScope::getPosition(), TraCIAPI::PersonScope::getPosition3D(), TraCIAPI::TrafficLightScope::getProgram(), TraCIAPI::TrafficLightScope::getRedYellowGreenState(), TraCIAPI::PersonScope::getRemainingStages(), TraCIAPI::PersonScope::getRoadID(), TraCIAPI::VehicleScope::getRoadID(), TraCIAPI::VehicleScope::getRoute(), TraCIAPI::VehicleScope::getRouteID(), TraCIAPI::VehicleScope::getRoutingMode(), TraCIAPI::GUIScope::getSchema(), TraCIAPI::VehicleScope::getSecureGap(), TraCIAPI::JunctionScope::getShape(), TraCIAPI::PolygonScope::getShape(), TraCIAPI::VehicleScope::getShapeClass(), TraCIAPI::VehicleScope::getSignals(), TraCIAPI::PersonScope::getSlope(), TraCIAPI::VehicleScope::getSlope(), TraCIAPI::PersonScope::getSpeed(), TraCIAPI::VehicleScope::getSpeed(), TraCIAPI::VehicleScope::getSpeedMode(), TraCIAPI::PersonScope::getStage(), TraCIAPI::VehicleScope::getStopDelay(), TraCIAPI::VehicleScope::getStopSpeed(), TraCIAPI::VehicleScope::getStopState(), TraCIAPI::EdgeScope::getStreetName(), libsumo::TraCIPosition::getString(), libsumo::TraCIRoadPosition::getString(), libsumo::TraCIColor::getString(), libsumo::TraCIPositionVector::getString(), TraCIAPI::TraCIScopeWrapper::getSubscriptionResults(), TraCIAPI::EdgeScope::getTraveltime(), TraCIAPI::PersonScope::getTypeID(), TraCIAPI::VehicleScope::getTypeID(), TraCIAPI::PersonScope::getVehicle(), TraCIAPI::InductionLoopScope::getVehicleData(), TraCIAPI::getVersion(), TraCIAPI::VehicleScope::getVia(), TraCIAPI::PersonScope::getWaitingTime(), TraCIAPI::VehicleScope::getWaitingTime(), TraCIAPI::VehicleTypeScope::getWidth(), TraCIAPI::GUIScope::getZoom(), TraCIAPI::gui, libsumo::TraCIConnection::hasFoe, libsumo::TraCIConnection::hasPrio, libsumo::TraCIVehicleData::id, libsumo::TraCINextTLSData::id, TraCIAPI::inductionloop, libsumo::TraCIConnection::isOpen, TraCIAPI::VehicleScope::isRouteValid(), joinToString(), TraCIAPI::junction, TraCIAPI::lane, libsumo::TraCIVehicleData::leaveTime, libsumo::TraCIConnection::length, libsumo::TraCIVehicleData::length, TraCIAPI::load(), TraCIAPI::VehicleScope::moveTo(), TraCIAPI::VehicleScope::moveToXY(), TraCIAPI::person, libsumo::TraCILogic::phases, TraCIAPI::poi, TraCIAPI::polygon, libsumo::TraCIColor::r, TraCIAPI::VehicleScope::remove(), TraCIAPI::PersonScope::removeStage(), TraCIAPI::PersonScope::removeStages(), TraCIAPI::PersonScope::rerouteTraveltime(), TraCIAPI::VehicleScope::rerouteTraveltime(), TraCIAPI::route, libsumo::ROUTING_MODE_AGGREGATED, TraCIAPI::GUIScope::screenshot(), TraCIAPI::VehicleTypeScope::setAccel(), TraCIAPI::VehicleTypeScope::setApparentDecel(), TraCIAPI::PersonScope::setColor(), TraCIAPI::VehicleScope::setColor(), TraCIAPI::EdgeScope::setEffort(), TraCIAPI::VehicleTypeScope::setEmergencyDecel(), TraCIAPI::PersonScope::setHeight(), TraCIAPI::VehicleTypeScope::setHeight(), TraCIAPI::VehicleScope::setLaneChangeMode(), TraCIAPI::VehicleTypeScope::setLateralAlignment(), TraCIAPI::PersonScope::setLength(), TraCIAPI::VehicleScope::setLine(), TraCIAPI::PolygonScope::setLineWidth(), TraCIAPI::EdgeScope::setMaxSpeed(), TraCIAPI::LaneScope::setMaxSpeed(), TraCIAPI::VehicleScope::setMaxSpeed(), TraCIAPI::VehicleTypeScope::setMaxSpeedLat(), TraCIAPI::PersonScope::setMinGap(), TraCIAPI::VehicleTypeScope::setMinGapLat(), TraCIAPI::setOrder(), TraCIAPI::TraCIScopeWrapper::setParameter(), TraCIAPI::TrafficLightScope::setPhase(), TraCIAPI::TrafficLightScope::setPhaseName(), TraCIAPI::TrafficLightScope::setProgramLogic(), TraCIAPI::TrafficLightScope::setRedYellowGreenState(), TraCIAPI::VehicleScope::setRoute(), TraCIAPI::VehicleScope::setRouteID(), TraCIAPI::VehicleScope::setRoutingMode(), TraCIAPI::GUIScope::setSchema(), TraCIAPI::PolygonScope::setShape(), TraCIAPI::VehicleScope::setShapeClass(), TraCIAPI::VehicleScope::setSignals(), TraCIAPI::PersonScope::setSpeed(), TraCIAPI::VehicleScope::setSpeedFactor(), TraCIAPI::VehicleScope::setSpeedMode(), TraCIAPI::PersonScope::setType(), TraCIAPI::VehicleScope::setType(), TraCIAPI::VehicleScope::setVia(), TraCIAPI::PersonScope::setWidth(), TraCIAPI::VehicleTypeScope::setWidth(), TraCIAPI::GUIScope::setZoom(), TraCIAPI::VehicleScope::SIGNAL_FOGLIGHT, TraCIAPI::simulation, TraCIAPI::simulationStep(), libsumo::STAGE_WALKING, libsumo::TraCIConnection::state, libsumo::TraCINextTLSData::state, TraCIAPI::TraCIScopeWrapper::subscribe(), TraCIAPI::TraCIScopeWrapper::subscribeContext(), libsumo::TraCINextTLSData::tlIndex, TraCIAPI::trafficlights, libsumo::TraCIVehicleData::typeID, libsumo::TraCIPositionVector::value, libsumo::VAR_LANEPOSITION, libsumo::VAR_ROAD_ID, libsumo::VAR_SPEED, TraCIAPI::vehicle, TraCIAPI::vehicletype, and TraCIAPI::SimulationScope::writeMessage().
Referenced by run().
|
inlinestaticprotectedinherited |
Definition at line 942 of file TraCIAPI.h.
Referenced by TraCIAPI::VehicleScope::add(), TraCIAPI::check_commandGetResult(), TraCIAPI::check_resultState(), and TraCIAPI::readVariables().
|
private |
Validates whether the given message is a valid answer to CMD_SIMSTEP.
[in] | inMsg | The storage contain the message to validate |
Definition at line 362 of file TraCITestClient.cpp.
References answerLog, tcpip::Storage::readInt(), and validateSubscription().
Referenced by commandSimulationStep().
|
private |
Validates whether the given message is a valid subscription return message.
[in] | inMsg | The storage contain the message to validate |
Definition at line 379 of file TraCITestClient.cpp.
References answerLog, readAndReportTypeDependent(), tcpip::Storage::readInt(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), libsumo::RESPONSE_SUBSCRIBE_GUI_CONTEXT, libsumo::RESPONSE_SUBSCRIBE_GUI_VARIABLE, libsumo::RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT, libsumo::RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE, and libsumo::RTYPE_OK.
Referenced by commandSubscribeContextVariable(), commandSubscribeObjectVariable(), and validateSimulationStep2().
|
private |
Writes the results file.
Definition at line 335 of file TraCITestClient.cpp.
References answerLog, and outputFileName.
Referenced by ~TraCITestClient().
|
private |
Stream containing the log.
Definition at line 233 of file TraCITestClient.h.
Referenced by commandClose(), commandGetVariable(), commandSetOrder(), commandSetValue(), commandSimulationStep(), commandSubscribeContextVariable(), commandSubscribeObjectVariable(), errorMsg(), readAndReportTypeDependent(), testAPI(), TraCITestClient(), validateSimulationStep2(), validateSubscription(), and writeResult().
|
inherited |
Scope for interaction with edges.
Definition at line 829 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with the gui.
Definition at line 831 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with inductive loops.
Definition at line 833 of file TraCIAPI.h.
Referenced by testAPI().
|
inherited |
Scope for interaction with junctions.
Definition at line 835 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with lanes.
Definition at line 837 of file TraCIAPI.h.
Referenced by TraCIAPI::VehicleScope::moveToXY(), testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with lanes.
Definition at line 839 of file TraCIAPI.h.
Referenced by TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with multi-entry/-exit detectors.
Definition at line 841 of file TraCIAPI.h.
Referenced by TraCIAPI::TraCIAPI().
|
protectedinherited |
Definition at line 954 of file TraCIAPI.h.
Referenced by TraCIAPI::readContextSubscription(), TraCIAPI::readVariableSubscription(), TraCIAPI::simulationStep(), and TraCIAPI::TraCIAPI().
|
mutableprotectedinherited |
The reusable input storage.
Definition at line 960 of file TraCIAPI.h.
Referenced by TraCIAPI::processGet(), and TraCIAPI::processSet().
|
mutableprotectedinherited |
The reusable output storage.
Definition at line 958 of file TraCIAPI.h.
Referenced by commandGetVariable(), commandSetValue(), TraCIAPI::createCommand(), TraCIAPI::createFilterCommand(), TraCIAPI::processGet(), and TraCIAPI::processSet().
|
protectedinherited |
The socket.
Definition at line 956 of file TraCIAPI.h.
Referenced by TraCIAPI::check_resultState(), TraCIAPI::closeSocket(), commandGetVariable(), commandSetValue(), TraCIAPI::connect(), TraCIAPI::getVersion(), TraCIAPI::load(), TraCIAPI::processGet(), TraCIAPI::processSet(), TraCIAPI::send_commandClose(), TraCIAPI::send_commandSetOrder(), TraCIAPI::send_commandSimulationStep(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), TraCIAPI::setOrder(), and TraCIAPI::~TraCIAPI().
|
private |
The name of the file to write the results log into.
Definition at line 230 of file TraCITestClient.h.
Referenced by writeResult().
|
inherited |
Scope for interaction with persons.
Definition at line 843 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with POIs.
Definition at line 845 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with polygons.
Definition at line 847 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with rerouters.
Definition at line 849 of file TraCIAPI.h.
Referenced by TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with routes.
Definition at line 851 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with route probes.
Definition at line 853 of file TraCIAPI.h.
Referenced by TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with the simulation.
Definition at line 855 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with traffic lights.
Definition at line 857 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with vehicles.
Definition at line 859 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().
|
inherited |
Scope for interaction with vehicle types.
Definition at line 861 of file TraCIAPI.h.
Referenced by testAPI(), and TraCIAPI::TraCIAPI().