51 const std::string
id = inputStorage.
readString();
155 if (inputStorage.
readInt() != 2) {
166 if (inputStorage.
readInt() != 3) {
177 if (inputStorage.
readInt() != 5) {
180 std::string from, to, vtype;
205 if (inputStorage.
readInt() != 13) {
208 std::string from, to, modes, ptype, vtype, destStop;
209 double depart, speed, walkFactor, departPos, arrivalPos, departPosLat;
250 const std::vector<libsumo::TraCIStage> result =
libsumo::Simulation::findIntermodalRoute(from, to, modes, depart, routingMode, speed, walkFactor, departPos, arrivalPos, departPosLat, ptype, vtype, destStop);
259 std::string paramName =
"";
282 std::string warning =
"";
327 outputStorage.
writeInt((
int) ids.size());
365 std::pair<MSLane*, double> roadPos;
373 switch (srcPosType) {
384 cartesianPos.
set(x, y);
393 std::string roadID = inputStorage.
readString();
399 z = cartesianPos.
z();
418 switch (destPosType) {
424 outputStorage.
writeString(roadPos.first->getEdge().getID());
426 const std::vector<MSLane*> lanes = roadPos.first->getEdge().getLanes();
427 outputStorage.
writeUnsignedByte((
int)distance(lanes.begin(), find(lanes.begin(), lanes.end(), roadPos.first)));
460 std::pair<const MSLane*, double> roadPos1;
461 std::pair<const MSLane*, double> roadPos2;
468 std::string roadID = inputStorage.
readString();
471 pos1 = roadPos1.first->getShape().positionAtOffset(roadPos1.second);
498 std::string roadID = inputStorage.
readString();
501 pos2 = roadPos2.first->getShape().positionAtOffset(roadPos2.second);
526 double distance = 0.0;
529 if ((roadPos1.first == roadPos2.first) && (roadPos1.second <= roadPos2.second)) {
531 distance = roadPos2.second - roadPos1.second;
534 if (roadPos2.first->isInternal()) {
535 distance = roadPos2.second;
536 roadPos2.first = roadPos2.first->getLogicalPredecessorLane();
537 roadPos2.second = roadPos2.first->getLength();
541 MSRoute route(
"", newRoute,
false,
nullptr, std::vector<SUMOVehicleParameter::Stop>());
542 distance += route.
getDistanceBetween(roadPos1.second, roadPos2.second, &roadPos1.first->getEdge(), &roadPos2.first->getEdge());
#define VAR_COLLIDING_VEHICLES_NUMBER
The vehicle has departed (was inserted into the network)
#define CMD_CLEAR_PENDING_VEHICLES
int type
The type of stage (walking, driving, ...)
#define REQUEST_DRIVINGDIST
static void writeVehicleStateIDs(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
static std::pair< MSLane *, double > convertCartesianToRoadMap(Position pos)
std::string line
The line or the id of the vehicle type.
double z() const
Returns the z-position.
#define VAR_PARKING_STARTING_VEHICLES_IDS
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()
#define VAR_STOP_ENDING_VEHICLES_IDS
#define VAR_PARKING_ENDING_VEHICLES_NUMBER
static void writeStage(tcpip::Storage &outputStorage, const libsumo::TraCIStage &stage)
#define POSITION_LON_LAT_ALT
std::string destStop
The id of the destination stop.
double y() const
Returns the y-position.
virtual double readDouble()
double x() const
Returns the x-position.
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E *> &into)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
#define VAR_LOADED_VEHICLES_IDS
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.
const PositionVector & getShape() const
Returns this lane's shape.
#define RESPONSE_GET_SIM_VARIABLE
static const MSLane * getLaneChecking(const std::string &edgeID, int laneIndex, double pos)
#define VAR_TELEPORT_STARTING_VEHICLES_IDS
std::vector< const MSEdge * > ConstMSEdgeVector
virtual void writeUnsignedByte(int)
void set(double x, double y)
set positions x and y
double depart
intended depart time for public transport ride or -1
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
#define VAR_LOADED_VEHICLES_NUMBER
#define VAR_STOP_STARTING_VEHICLES_NUMBER
static void writeVehicleStateNumber(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
virtual void writeInt(int)
#define VAR_EMERGENCYSTOPPING_VEHICLES_IDS
virtual int readUnsignedByte()
The vehicles starts to stop.
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
#define POSITION_CONVERSION
static TraCIStage findRoute(const std::string &fromEdge, const std::string &toEdge, const std::string &vType="", const double depart=-1., const int routingMode=0)
#define CMD_SAVE_SIMSTATE
#define VAR_DEPARTED_VEHICLES_NUMBER
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcb: Set Simulation Variable)
#define VAR_MIN_EXPECTED_VEHICLES
The vehicle arrived at his destination (is deleted)
The vehicles starts to park.
The vehicle is involved in a collision.
The vehicle had to brake harder than permitted.
#define VAR_STOP_STARTING_VEHICLES_IDS
#define VAR_NET_BOUNDING_BOX
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.
#define VAR_TELEPORT_STARTING_VEHICLES_NUMBER
virtual void writeByte(int)
virtual void writeStringList(const std::vector< std::string > &s)
static bool commandPositionConversion(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
#define VAR_TELEPORT_ENDING_VEHICLES_IDS
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
The vehicle started to teleport.
tcpip::Storage & getWrapperStorage()
#define CMD_GET_SIM_VARIABLE
virtual std::string readString()
#define VAR_DEPARTED_VEHICLES_IDS
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.
#define CMD_SET_SIM_VARIABLE
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)
The vehicle was built, but has not yet departed.
#define VAR_ARRIVED_VEHICLES_NUMBER
static int getBusStopWaiting(const std::string &id)
virtual void writeString(const std::string &s)
#define VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER
std::string toHex(const T i, std::streamsize numDigits=0)
std::vector< TraCIPosition > TraCIPositionVector
#define VAR_STOP_ENDING_VEHICLES_NUMBER
const std::map< MSNet::VehicleState, std::vector< std::string > > & getVehicleStateChanges() const
double travelTime
duration of the stage in seconds
#define VAR_PARKING_ENDING_VEHICLES_IDS
The vehicle ends to stop.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
virtual void writeDouble(double)
#define VAR_TELEPORT_ENDING_VEHICLES_NUMBER
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.
#define VAR_PARKING_STARTING_VEHICLES_NUMBER
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="")
#define VAR_COLLIDING_VEHICLES_IDS
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
#define VAR_ARRIVED_VEHICLES_IDS
static int getCurrentTime()
The vehicle ended being teleported.
#define FIND_INTERMODAL_ROUTE
#define VAR_BUS_STOP_WAITING
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...