51 const std::string
id = inputStorage.
readString();
161 const int compoundSize = inputStorage.
readInt();
162 if (compoundSize < 2 || compoundSize > 3) {
174 if (inputStorage.
readInt() != 3) {
185 if (inputStorage.
readInt() != 5) {
188 std::string from, to, vtype;
213 if (inputStorage.
readInt() != 13) {
216 std::string from, to, modes, ptype, vtype, destStop;
217 double depart, speed, walkFactor, departPos, arrivalPos, departPosLat;
258 const std::vector<libsumo::TraCIStage>& result =
libsumo::Simulation::findIntermodalRoute(from, to, modes, depart, routingMode, speed, walkFactor, departPos, arrivalPos, departPosLat, ptype, vtype, destStop);
267 std::string paramName =
"";
290 std::string warning =
"";
335 outputStorage.
writeInt((
int) ids.size());
401 const int commandId) {
402 std::pair<MSLane*, double> roadPos;
410 switch (srcPosType) {
421 cartesianPos.
set(x, y);
430 const std::string roadID = inputStorage.
readString();
436 z = cartesianPos.
z();
456 if (compoundSize == 3) {
458 const std::string& vClassString = inputStorage.
readString();
466 switch (destPosType) {
470 if (roadPos.first ==
nullptr) {
476 outputStorage.
writeString(roadPos.first->getEdge().getID());
510 std::pair<const MSLane*, double> roadPos1;
511 std::pair<const MSLane*, double> roadPos2;
518 std::string roadID = inputStorage.
readString();
521 pos1 = roadPos1.first->geometryPositionAtOffset(roadPos1.second);
548 std::string roadID = inputStorage.
readString();
551 pos2 = roadPos2.first->geometryPositionAtOffset(roadPos2.second);
576 double distance = 0.0;
579 if ((roadPos1.first == roadPos2.first) && (roadPos1.second <= roadPos2.second)) {
581 distance = roadPos2.second - roadPos1.second;
584 while (roadPos2.first->isInternal() && roadPos2.first != roadPos1.first) {
585 distance += roadPos2.second;
586 roadPos2.first = roadPos2.first->getLogicalPredecessorLane();
587 roadPos2.second = roadPos2.first->getLength();
591 if (newRoute.size() == 0) {
594 MSRoute route(
"", newRoute,
false,
nullptr, std::vector<SUMOVehicleParameter::Stop>());
595 distance += route.
getDistanceBetween(roadPos1.second, roadPos2.second, &roadPos1.first->getEdge(), &roadPos2.first->getEdge());
TRACI_CONST int CMD_SAVE_SIMSTATE
The vehicle has departed (was inserted into the network)
TRACI_CONST int VAR_MIN_EXPECTED_VEHICLES
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_NUMBER
int type
The type of stage (walking, driving, ...)
TRACI_CONST int POSITION_3D
static void writeVehicleStateIDs(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
std::string line
The line or the id of the vehicle type.
double z() const
Returns the z-position.
TRACI_CONST int VAR_TIME_STEP
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_NUMBER
static std::vector< TraCIStage > findIntermodalRoute(const std::string &fromEdge, const std::string &toEdge, const std::string &modes="", double depart=-1., const int routingMode=0, double speed=-1., double walkFactor=-1., double departPos=0, double arrivalPos=INVALID_DOUBLE_VALUE, const double departPosLat=0, const std::string &pType="", const std::string &vType="", const std::string &destStop="")
static double getDeltaT()
double arrivalPos
position on the lane when ending the stage
static void writeStage(tcpip::Storage &outputStorage, const libsumo::TraCIStage &stage)
TRACI_CONST int CMD_CLEAR_PENDING_VEHICLES
TRACI_CONST int VAR_LOADED_VEHICLES_NUMBER
std::string destStop
The id of the destination stop.
double y() const
Returns the y-position.
virtual double readDouble()
TRACI_CONST int VAR_PARAMETER
double x() const
Returns the x-position.
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xab: Get Simulation Variable)
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 std::string getParameter(const std::string &objectID, const std::string &key)
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER
TRACI_CONST int RESPONSE_GET_SIM_VARIABLE
static const MSLane * getLaneChecking(const std::string &edgeID, int laneIndex, double pos)
TRACI_CONST int CMD_SET_SIM_VARIABLE
static libsumo::TraCIStage * readStage(TraCIServer &server, tcpip::Storage &inputStorage)
std::vector< const MSEdge * > ConstMSEdgeVector
virtual void writeUnsignedByte(int)
TRACI_CONST int VAR_DEPARTED_VEHICLES_IDS
void set(double x, double y)
set positions x and y
TRACI_CONST int POSITION_LON_LAT
double depart
intended depart time for public transport ride or INVALID_DOUBLE_VALUE
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
double departPos
position on the lane when starting the stage
std::string description
arbitrary description string
TRACI_CONST int RTYPE_ERR
static void writeVehicleStateNumber(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
virtual void writeInt(int)
TRACI_CONST int VAR_BUS_STOP_WAITING
virtual int readUnsignedByte()
TRACI_CONST int VAR_BUS_STOP_WAITING_IDS
The vehicles starts to stop.
TRACI_CONST int TYPE_INTEGER
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
TRACI_CONST int CMD_GET_SIM_VARIABLE
TRACI_CONST int VAR_ARRIVED_VEHICLES_NUMBER
static TraCIStage findRoute(const std::string &fromEdge, const std::string &toEdge, const std::string &vType="", const double depart=-1., const int routingMode=0)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcb: Set Simulation Variable)
The vehicle arrived at his destination (is deleted)
TRACI_CONST int FIND_ROUTE
The vehicles starts to park.
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_NUMBER
The vehicle is involved in a collision.
TRACI_CONST int TYPE_POLYGON
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_IDS
The vehicle had to brake harder than permitted.
A point in 2D or 3D with translation and scaling methods.
static TraCIPositionVector getNetBoundary()
std::vector< std::string > edges
The sequence of edges to travel.
virtual void writeByte(int)
bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)
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)
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E *> &into, bool silent=false)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
TRACI_CONST int VAR_DELTA_T
TRACI_CONST int TYPE_DOUBLE
The vehicle started to teleport.
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_IDS
tcpip::Storage & getWrapperStorage()
TRACI_CONST int TYPE_STRINGLIST
virtual std::string readString()
TRACI_CONST int TYPE_STRING
TRACI_CONST int VAR_NET_BOUNDING_BOX
static std::pair< MSLane *, double > convertCartesianToRoadMap(const Position &pos, const SUMOVehicleClass vClass)
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
The vehicle ends to park.
static void saveState(const std::string &fileName)
bool readTypeCheckingUnsignedByte(tcpip::Storage &inputStorage, int &into)
Reads the value type and an unsigned byte, verifying the type.
TraCI server used to control sumo by a remote TraCI client.
static std::vector< std::string > getBusStopIDList()
TRACI_CONST int VAR_DEPARTED_VEHICLES_NUMBER
TRACI_CONST int DISTANCE_REQUEST
TRACI_CONST int POSITION_LON_LAT_ALT
std::string vType
The vehicle type when using a private car or bike.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
VehicleState
Definition of a vehicle state.
static bool commandDistanceRequest(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_IDS
The vehicle was built, but has not yet departed.
TRACI_CONST int VAR_COLLIDING_VEHICLES_IDS
static int getBusStopWaiting(const std::string &id)
virtual void writeString(const std::string &s)
TRACI_CONST int POSITION_ROADMAP
std::string toHex(const T i, std::streamsize numDigits=0)
std::vector< TraCIPosition > TraCIPositionVector
TRACI_CONST int FIND_INTERMODAL_ROUTE
static std::vector< std::string > getBusStopWaitingIDList(const std::string &id)
Returns the IDs of the transportables on a given bus stop.
TRACI_CONST int VAR_LOADED_VEHICLES_IDS
const std::map< MSNet::VehicleState, std::vector< std::string > > & getVehicleStateChanges() const
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_IDS
TRACI_CONST int VAR_COLLIDING_VEHICLES_NUMBER
double travelTime
duration of the stage in seconds
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_NUMBER
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
The vehicle ends to stop.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
TRACI_CONST int REQUEST_DRIVINGDIST
virtual void writeDouble(double)
TRACI_CONST int POSITION_CONVERSION
static int getMinExpectedNumber()
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation. ...
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
TRACI_CONST int POSITION_2D
std::string intended
id of the intended vehicle for public transport ride
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const MSEdgeVector &prohibited=MSEdgeVector()) const
void initWrapper(const int domainID, const int variable, const std::string &objID)
static void clearPending(const std::string &routeID="")
TRACI_CONST int VAR_ARRIVED_VEHICLES_IDS
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_IDS
TRACI_CONST int VAR_BUS_STOP_ID_LIST
TRACI_CONST double INVALID_DOUBLE_VALUE
static int getCurrentTime()
The vehicle ended being teleported.
TRACI_CONST int TYPE_COMPOUND
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_IDS
vehicles ignoring classes
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_NUMBER
static bool commandPositionConversion(TraCIServer &server, tcpip::Storage &inputStorage, const int compoundSize, tcpip::Storage &outputStorage, const int commandId)
double getDistanceBetween(double fromPos, double toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true, int routePosition=0) const
Compute the distance between 2 given edges on this route, including the length of internal lanes...