49 const std::string
id = inputStorage.
readString();
142 server.
wrapStringList(
id, variable, libsumo::Simulation::getBusStopIDList());
149 server.
wrapStringList(
id, variable, libsumo::Simulation::getBusStopWaitingIDList(
id));
165 const int compoundSize = inputStorage.
readInt();
166 if (compoundSize < 2 || compoundSize > 3) {
178 if (inputStorage.
readInt() != 3) {
189 if (inputStorage.
readInt() != 5) {
192 std::string from, to, vtype;
217 if (inputStorage.
readInt() != 13) {
220 std::string from, to, modes, ptype, vtype, destStop;
221 double depart, speed, walkFactor, departPos, arrivalPos, departPosLat;
262 const std::vector<libsumo::TraCIStage>& result = libsumo::Simulation::findIntermodalRoute(from, to, modes, depart, routingMode, speed, walkFactor, departPos, arrivalPos, departPosLat, ptype, vtype, destStop);
271 std::string paramName =
"";
280 std::string paramName =
"";
307 std::string warning =
"";
328 libsumo::Simulation::clearPending(route);
337 libsumo::Simulation::saveState(file);
346 double time = libsumo::Simulation::loadState(file);
355 libsumo::Simulation::writeMessage(msg);
373 outputStorage.
writeInt((
int) ids.size());
439 const int commandId) {
440 std::pair<MSLane*, double> roadPos;
448 switch (srcPosType) {
459 cartesianPos.
set(x, y);
468 const std::string roadID = inputStorage.
readString();
474 z = cartesianPos.
z();
494 if (compoundSize == 3) {
496 const std::string& vClassString = inputStorage.
readString();
504 switch (destPosType) {
508 if (roadPos.first ==
nullptr) {
514 outputStorage.
writeString(roadPos.first->getEdge().getID());
548 std::pair<const MSLane*, double> roadPos1;
549 std::pair<const MSLane*, double> roadPos2;
556 std::string roadID = inputStorage.
readString();
559 pos1 = roadPos1.first->geometryPositionAtOffset(roadPos1.second);
586 std::string roadID = inputStorage.
readString();
589 pos2 = roadPos2.first->geometryPositionAtOffset(roadPos2.second);
614 double distance = 0.0;
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
std::string toHex(const T i, std::streamsize numDigits=0)
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
VehicleState
Definition of a vehicle state.
@ VEHICLE_STATE_ENDING_TELEPORT
The vehicle ended being teleported.
@ VEHICLE_STATE_DEPARTED
The vehicle has departed (was inserted into the network)
@ VEHICLE_STATE_STARTING_PARKING
The vehicles starts to park.
@ VEHICLE_STATE_MANEUVERING
Vehicle maneuvering either entering or exiting a parking space.
@ VEHICLE_STATE_ENDING_STOP
The vehicle ends to stop.
@ VEHICLE_STATE_ARRIVED
The vehicle arrived at his destination (is deleted)
@ VEHICLE_STATE_COLLISION
The vehicle is involved in a collision.
@ VEHICLE_STATE_EMERGENCYSTOP
The vehicle had to brake harder than permitted.
@ VEHICLE_STATE_STARTING_TELEPORT
The vehicle started to teleport.
@ VEHICLE_STATE_STARTING_STOP
The vehicles starts to stop.
@ VEHICLE_STATE_ENDING_PARKING
The vehicle ends to park.
@ VEHICLE_STATE_BUILT
The vehicle was built, but has not yet departed.
A point in 2D or 3D with translation and scaling methods.
void set(double x, double y)
set positions x and y
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
double x() const
Returns the x-position.
double z() const
Returns the z-position.
double y() const
Returns the y-position.
static libsumo::TraCIStage * readStage(TraCIServer &server, tcpip::Storage &inputStorage)
static bool commandPositionConversion(TraCIServer &server, tcpip::Storage &inputStorage, const int compoundSize, tcpip::Storage &outputStorage, const int commandId)
static bool commandDistanceRequest(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcb: Set Simulation Variable)
static void writeVehicleStateIDs(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
static void writeVehicleStateNumber(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
static void writeStage(tcpip::Storage &outputStorage, const libsumo::TraCIStage &stage)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xab: Get Simulation Variable)
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.
void stateLoaded(SUMOTime targetTime)
updates myTargetTime and resets vehicle state changes after loading a simulation state
tcpip::Storage & getWrapperStorage()
bool readTypeCheckingUnsignedByte(tcpip::Storage &inputStorage, int &into)
Reads the value type and an unsigned byte, verifying the type.
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 readTypeCheckingInt(tcpip::Storage &inputStorage, int &into)
Reads the value type and an int, verifying the type.
static TraCIServer * getInstance()
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)
const std::map< MSNet::VehicleState, std::vector< std::string > > & getVehicleStateChanges() const
bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)
static double getDrivingDistance(std::pair< const MSLane *, double > &roadPos1, std::pair< const MSLane *, double > &roadPos2)
static std::pair< MSLane *, double > convertCartesianToRoadMap(const Position &pos, const SUMOVehicleClass vClass)
static const MSLane * getLaneChecking(const std::string &edgeID, int laneIndex, double pos)
std::string intended
id of the intended vehicle for public transport ride
int type
The type of stage (walking, driving, ...)
std::string destStop
The id of the destination stop.
double travelTime
duration of the stage in seconds
double departPos
position on the lane when starting the stage
std::string description
arbitrary description string
std::string line
The line or the id of the vehicle type.
double depart
intended depart time for public transport ride or INVALID_DOUBLE_VALUE
std::vector< std::string > edges
The sequence of edges to travel.
double arrivalPos
position on the lane when ending the stage
std::string vType
The vehicle type when using a private car or bike.
virtual std::string readString()
virtual void writeString(const std::string &s)
virtual void writeInt(int)
virtual void writeDouble(double)
virtual int readUnsignedByte()
virtual void writeStringList(const std::vector< std::string > &s)
virtual void writeUnsignedByte(int)
virtual void writeByte(int)
virtual double readDouble()
TRACI_CONST int VAR_MIN_EXPECTED_VEHICLES
TRACI_CONST int CMD_SAVE_SIMSTATE
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_IDS
TRACI_CONST int POSITION_3D
TRACI_CONST int POSITION_ROADMAP
TRACI_CONST int VAR_ARRIVED_VEHICLES_NUMBER
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_DEPARTED_VEHICLES_NUMBER
TRACI_CONST int CMD_LOAD_SIMSTATE
TRACI_CONST int VAR_COLLIDING_VEHICLES_NUMBER
TRACI_CONST int CMD_CLEAR_PENDING_VEHICLES
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_IDS
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_IDS
TRACI_CONST int TYPE_COMPOUND
TRACI_CONST int VAR_PARKING_MANEUVERING_VEHICLES_IDS
std::vector< TraCIPosition > TraCIPositionVector
TRACI_CONST int FIND_INTERMODAL_ROUTE
TRACI_CONST int VAR_PARKING_MANEUVERING_VEHICLES_NUMBER
TRACI_CONST int POSITION_2D
TRACI_CONST int TYPE_POLYGON
TRACI_CONST int VAR_NET_BOUNDING_BOX
TRACI_CONST int TYPE_STRINGLIST
TRACI_CONST int CMD_SET_SIM_VARIABLE
TRACI_CONST int TYPE_INTEGER
TRACI_CONST int VAR_BUS_STOP_ID_LIST
TRACI_CONST int POSITION_LON_LAT
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_IDS
TRACI_CONST int VAR_BUS_STOP_WAITING_IDS
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_DEPARTED_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_NUMBER
TRACI_CONST int CMD_GET_SIM_VARIABLE
TRACI_CONST int CMD_MESSAGE
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_LOADED_VEHICLES_IDS
TRACI_CONST int VAR_DELTA_T
TRACI_CONST int REQUEST_DRIVINGDIST
TRACI_CONST int VAR_PARAMETER_WITH_KEY
TRACI_CONST int RESPONSE_GET_SIM_VARIABLE
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_IDS
TRACI_CONST int FIND_ROUTE
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_NUMBER
TRACI_CONST int POSITION_CONVERSION
TRACI_CONST int TYPE_DOUBLE
TRACI_CONST int DISTANCE_REQUEST
TRACI_CONST int VAR_LOADED_VEHICLES_NUMBER
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_IDS
TRACI_CONST int VAR_COLLIDING_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_IDS
TRACI_CONST int VAR_BUS_STOP_WAITING
TRACI_CONST int RTYPE_ERR
TRACI_CONST int VAR_TIME_STEP
TRACI_CONST int VAR_ARRIVED_VEHICLES_IDS
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_NUMBER
TRACI_CONST int POSITION_LON_LAT_ALT
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER
TRACI_CONST int TYPE_STRING