36#define DEFAULT_VIEW "View #0"
65 void connect(
const std::string& host,
int port);
78 void load(
const std::vector<std::string>& args);
104 std::vector<std::string>
getIDList()
const;
108 std::string
getParameter(
const std::string& objectID,
const std::string& key)
const;
111 std::pair<std::string, std::string>
getParameterWithKey(
const std::string& objectID,
const std::string& key)
const;
114 void setParameter(
const std::string& objectID,
const std::string& key,
const std::string& value)
const;
116 void subscribe(
const std::string& objID,
const std::vector<int>& vars,
double beginTime,
double endTime)
const;
117 void subscribeContext(
const std::string& objID,
int domain,
double range,
const std::vector<int>& vars,
double beginTime,
double endTime)
const;
144 void setInt(
int var,
const std::string&
id,
int value)
const;
145 void setDouble(
int var,
const std::string&
id,
double value)
const;
146 void setString(
int var,
const std::string&
id,
const std::string& value)
const;
147 void setStringVector(
int var,
const std::string&
id,
const std::vector<std::string>& value)
const;
177 double getEffort(
const std::string& edgeID,
double time)
const;
196 void adaptTraveltime(
const std::string& edgeID,
double time,
double beginSeconds = 0.,
double endSeconds = std::numeric_limits<double>::max())
const;
197 void setEffort(
const std::string& edgeID,
double effort,
double beginSeconds = 0.,
double endSeconds = std::numeric_limits<double>::max())
const;
198 void setMaxSpeed(
const std::string& edgeID,
double speed)
const;
214 void setZoom(
const std::string& viewID,
double zoom)
const;
215 void setOffset(
const std::string& viewID,
double x,
double y)
const;
216 void setSchema(
const std::string& viewID,
const std::string& schemeName)
const;
217 void setBoundary(
const std::string& viewID,
double xmin,
double ymin,
double xmax,
double ymax)
const;
218 void screenshot(
const std::string& viewID,
const std::string& filename,
const int width = -1,
const int height = -1)
const;
219 void trackVehicle(
const std::string& viewID,
const std::string& vehID)
const;
236 double getPosition(
const std::string& loopID)
const;
237 std::string
getLaneID(
const std::string& loopID)
const;
244 std::vector<libsumo::TraCIVehicleData>
getVehicleData(
const std::string& loopID)
const;
269 double getLength(
const std::string& laneID)
const;
270 double getMaxSpeed(
const std::string& laneID)
const;
271 double getWidth(
const std::string& laneID)
const;
272 std::vector<std::string>
getAllowed(
const std::string& laneID)
const;
273 std::vector<std::string>
getDisallowed(
const std::string& laneID)
const;
275 std::vector<libsumo::TraCIConnection>
getLinks(
const std::string& laneID)
const;
277 std::string
getEdgeID(
const std::string& laneID)
const;
293 std::vector<std::string>
getFoes(
const std::string& laneID,
const std::string& toLaneID)
const;
294 std::vector<std::string>
getInternalFoes(
const std::string& laneID)
const;
296 void setAllowed(
const std::string& laneID,
const std::vector<std::string>& allowedClasses)
const;
297 void setDisallowed(
const std::string& laneID,
const std::vector<std::string>& disallowedClasses)
const;
298 void setMaxSpeed(
const std::string& laneID,
double speed)
const;
299 void setLength(
const std::string& laneID,
double length)
const;
325 std::vector<std::string>
getEntryLanes(
const std::string& detID)
const;
326 std::vector<std::string>
getExitLanes(
const std::string& detID)
const;
340 std::string
getType(
const std::string& poiID)
const;
343 double getWidth(
const std::string& poiID)
const;
344 double getHeight(
const std::string& poiID)
const;
345 double getAngle(
const std::string& poiID)
const;
346 std::string
getImageFile(
const std::string& poiID)
const;
348 void setType(
const std::string& poiID,
const std::string&
setType)
const;
349 void setPosition(
const std::string& poiID,
double x,
double y)
const;
351 void setWidth(
const std::string& poiID,
double width)
const;
352 void setHeight(
const std::string& poiID,
double height)
const;
353 void setAngle(
const std::string& poiID,
double angle)
const;
354 void setImageFile(
const std::string& poiID,
const std::string& imageFile)
const;
355 void add(
const std::string& poiID,
double x,
double y,
const libsumo::TraCIColor& c,
const std::string& type,
int layer,
const std::string& imgFile,
double width,
double height,
double angle)
const;
356 void remove(
const std::string& poiID,
int layer = 0)
const;
368 double getLineWidth(
const std::string& polygonID)
const;
369 bool getFilled(
const std::string& polygonID)
const;
370 std::string
getType(
const std::string& polygonID)
const;
373 void setType(
const std::string& polygonID,
const std::string&
setType)
const;
376 void setLineWidth(
const std::string& polygonID,
const double lineWidth)
const;
378 void remove(
const std::string& polygonID,
int layer = 0)
const;
400 std::vector<std::string>
getEdges(
const std::string& routeID)
const;
402 void add(
const std::string& routeID,
const std::vector<std::string>& edges)
const;
439 std::string
getOption(
const std::string& option)
const;
454 double getDistance2D(
double x1,
double y1,
double x2,
double y2,
bool isGeo =
false,
bool isDriving =
false);
455 double getDistanceRoad(
const std::string& edgeID1,
double pos1,
const std::string& edgeID2,
double pos2,
bool isDriving =
false);
456 libsumo::TraCIStage findRoute(
const std::string& fromEdge,
const std::string& toEdge,
const std::string& vType =
"",
double pos = -1.,
int routingMode = 0)
const;
457 void loadState(
const std::string& path)
const;
458 void saveState(
const std::string& destination)
const;
474 std::vector<std::vector<libsumo::TraCILink> >
getControlledLinks(
const std::string& tlsID)
const;
475 std::string
getProgram(
const std::string& tlsID)
const;
476 int getPhase(
const std::string& tlsID)
const;
480 std::string
getPhaseName(
const std::string& tlsID)
const;
483 void setPhase(
const std::string& tlsID,
int index)
const;
484 void setPhaseName(
const std::string& tlsID,
const std::string& name)
const;
485 void setProgram(
const std::string& tlsID,
const std::string& programID)
const;
486 void setPhaseDuration(
const std::string& tlsID,
double phaseDuration)
const;
507 double getLength(
const std::string& typeID)
const;
508 double getMaxSpeed(
const std::string& typeID)
const;
511 double getAccel(
const std::string& typeID)
const;
512 double getDecel(
const std::string& typeID)
const;
516 double getTau(
const std::string& typeID)
const;
520 double getMinGap(
const std::string& typeID)
const;
521 double getWidth(
const std::string& typeID)
const;
522 double getHeight(
const std::string& typeID)
const;
529 void setLength(
const std::string& typeID,
double length)
const;
530 void setMaxSpeed(
const std::string& typeID,
double speed)
const;
531 void setVehicleClass(
const std::string& typeID,
const std::string& clazz)
const;
532 void setSpeedFactor(
const std::string& typeID,
double factor)
const;
534 void setEmissionClass(
const std::string& typeID,
const std::string& clazz)
const;
535 void setShapeClass(
const std::string& typeID,
const std::string& shapeClass)
const;
536 void setWidth(
const std::string& typeID,
double width)
const;
537 void setHeight(
const std::string& typeID,
double height)
const;
538 void setMinGap(
const std::string& typeID,
double minGap)
const;
539 void setAccel(
const std::string& typeID,
double accel)
const;
540 void setDecel(
const std::string& typeID,
double decel)
const;
543 void setImperfection(
const std::string& typeID,
double imperfection)
const;
544 void setTau(
const std::string& typeID,
double tau)
const;
546 void setMinGapLat(
const std::string& typeID,
double minGapLat)
const;
547 void setMaxSpeedLat(
const std::string& typeID,
double speed)
const;
548 void setLateralAlignment(
const std::string& typeID,
const std::string& latAlignment)
const;
549 void copy(
const std::string& origTypeID,
const std::string& newTypeID)
const;
581 double getSpeed(
const std::string& vehicleID)
const;
584 double getFollowSpeed(
const std::string& vehicleID,
double speed,
double gap,
double leaderSpeed,
double leaderMaxDecel,
const std::string& leaderID =
"")
const;
585 double getSecureGap(
const std::string& vehicleID,
double speed,
double leaderSpeed,
double leaderMaxDecel,
const std::string& leaderID =
"")
const;
586 double getStopSpeed(
const std::string& vehicleID,
double speed,
double gap)
const;
589 double getAngle(
const std::string& vehicleID)
const;
590 std::string
getRoadID(
const std::string& vehicleID)
const;
591 std::string
getLaneID(
const std::string& vehicleID)
const;
593 std::string
getTypeID(
const std::string& vehicleID)
const;
594 std::string
getRouteID(
const std::string& vehicleID)
const;
596 std::vector<std::string>
getRoute(
const std::string& vehicleID)
const;
599 double getDistance(
const std::string& vehicleID)
const;
600 int getSignals(
const std::string& vehicleID)
const;
614 double getSlope(
const std::string& vehicleID)
const;
617 std::vector<std::string>
getPersonIDList(
const std::string& vehicleID)
const;
622 std::string
getLine(
const std::string& vehicleID)
const;
623 std::vector<std::string>
getVia(
const std::string& vehicleID)
const;
624 std::vector<libsumo::TraCINextTLSData>
getNextTLS(
const std::string& vehID)
const;
625 std::vector<libsumo::TraCIBestLanesData>
getBestLanes(
const std::string& vehicleID)
const;
626 std::pair<std::string, double>
getLeader(
const std::string& vehicleID,
double dist)
const;
627 std::pair<std::string, double>
getFollower(
const std::string& vehicleID,
double dist)
const;
629 double getStopDelay(
const std::string& vehicleID)
const;
631 std::pair<int, int>
getLaneChangeState(
const std::string& vehicleID,
int direction)
const;
636 double getLength(
const std::string& vehicleID)
const;
637 double getMaxSpeed(
const std::string& vehicleID)
const;
638 double getAccel(
const std::string& vehicleID)
const;
639 double getDecel(
const std::string& vehicleID)
const;
642 double getTau(
const std::string& vehicleID)
const;
645 double getMinGap(
const std::string& vehicleID)
const;
646 double getWidth(
const std::string& vehicleID)
const;
647 double getHeight(
const std::string& veihcleID)
const;
649 double getMinGapLat(
const std::string& vehicleID)
const;
653 std::string
getShapeClass(
const std::string& vehicleID)
const;
659 void add(
const std::string& vehicleID,
660 const std::string& routeID,
661 const std::string& typeID =
"DEFAULT_VEHTYPE",
662 std::string depart =
"-1",
663 const std::string& departLane =
"first",
664 const std::string& departPos =
"base",
665 const std::string& departSpeed =
"0",
666 const std::string& arrivalLane =
"current",
667 const std::string& arrivalPos =
"max",
668 const std::string& arrivalSpeed =
"current",
669 const std::string& fromTaz =
"",
670 const std::string& toTaz =
"",
671 const std::string& line =
"",
672 int personCapacity = 0,
673 int personNumber = 0)
const;
675 void changeTarget(
const std::string& vehicleID,
const std::string& edgeID)
const;
676 void changeLane(
const std::string& vehicleID,
int laneIndex,
double duration)
const;
677 void changeLaneRelative(
const std::string& vehicleID,
int laneChange,
double duration)
const;
678 void changeSublane(
const std::string& vehicleID,
double latDist)
const;
679 void setRouteID(
const std::string& vehicleID,
const std::string& routeID)
const;
680 void setRoute(
const std::string& vehicleID,
const std::vector<std::string>&
edge)
const;
681 void rerouteTraveltime(
const std::string& vehicleID,
bool currentTravelTimes =
true)
const;
683 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;
684 void slowDown(
const std::string& vehicleID,
double speed,
double duration)
const;
685 void openGap(
const std::string& vehicleID,
double newTau,
double duration,
double changeRate,
double maxDecel)
const;
686 void setSpeed(
const std::string& vehicleID,
double speed)
const;
687 void setAcceleration(
const std::string& vehicleID,
double accel,
double duration)
const;
688 void setPreviousSpeed(
const std::string& vehicleID,
double prevSpeed,
double prevAcceleration = std::numeric_limits<int>::min())
const;
690 void setSpeedMode(
const std::string& vehicleID,
int mode)
const;
691 void setStop(
const std::string vehicleID,
const std::string edgeID,
const double endPos = 1.,
692 const int laneIndex = 0,
const double duration = std::numeric_limits<double>::max(),
693 const int flags = 0,
const double startPos = std::numeric_limits<int>::min(),
694 const double until = -1)
const;
695 void setType(
const std::string& vehicleID,
const std::string& typeID)
const;
698 void setLine(
const std::string& vehicleID,
const std::string& line)
const;
699 void setVia(
const std::string& vehicleID,
const std::vector<std::string>& via)
const;
700 void setSignals(
const std::string& vehicleID,
int signals)
const;
701 void setRoutingMode(
const std::string& vehicleID,
int routingMode)
const;
706 void setShapeClass(
const std::string& vehicleID,
const std::string& clazz)
const;
707 void setEmissionClass(
const std::string& vehicleID,
const std::string& clazz)
const;
708 void setSpeedFactor(
const std::string& vehicleID,
double factor)
const;
709 void setMinGap(
const std::string& vehicleID,
double minGap)
const;
710 void setMaxSpeed(
const std::string& vehicleID,
double speed)
const;
722 bool noOpposite =
false,
double downstreamDist = -1,
double upstreamDist = -1)
const;
781 double getSpeed(
const std::string& personID)
const;
784 std::string
getRoadID(
const std::string& personID)
const;
785 std::string
getLaneID(
const std::string& personID)
const;
786 std::string
getTypeID(
const std::string& personID)
const;
789 std::string
getNextEdge(
const std::string& personID)
const;
790 std::string
getVehicle(
const std::string& personID)
const;
793 std::vector<std::string>
getEdges(
const std::string& personID,
int nextStageIndex = 0)
const;
794 double getAngle(
const std::string& personID)
const;
795 double getSlope(
const std::string& personID)
const;
801 double getLength(
const std::string& personID)
const;
806 void add(
const std::string& personID,
const std::string& edgeID,
double pos,
double depart =
libsumo::DEPARTFLAG_NOW,
const std::string typeID =
"DEFAULT_PEDTYPE");
808 void appendWaitingStage(
const std::string& personID,
double duration,
const std::string& description =
"waiting",
const std::string& stopID =
"");
809 void appendWalkingStage(
const std::string& personID,
const std::vector<std::string>& edges,
double arrivalPos,
double duration = -1,
double speed = -1,
const std::string& stopID =
"");
810 void appendDrivingStage(
const std::string& personID,
const std::string& toEdge,
const std::string& lines,
const std::string& stopID =
"");
811 void removeStage(
const std::string& personID,
int nextStageIndex)
const;
813 void moveTo(
const std::string& personID,
const std::string& edgeID,
double position)
const;
814 void moveToXY(
const std::string& personID,
const std::string& edgeID,
const double x,
const double y,
double angle,
const int keepRoute)
const;
815 void setSpeed(
const std::string& personID,
double speed)
const;
816 void setType(
const std::string& personID,
const std::string& typeID)
const;
817 void setSpeedFactor(
const std::string& personID,
double factor)
const;
818 void setLength(
const std::string& personID,
double length)
const;
819 void setWidth(
const std::string& personID,
double width)
const;
820 void setHeight(
const std::string& personID,
double height)
const;
821 void setMinGap(
const std::string& personID,
double minGap)
const;
913 int domain,
double range,
const std::vector<int>& vars)
const;
933 bool processGet(
int command,
int expectedType,
bool ignoreCommandId =
false);
943 std::ostringstream oss;
944 oss.setf(std::ios::fixed, std::ios::floatfield);
945 oss << std::setprecision(accuracy);
Scope for interaction with edges.
double getElectricityConsumption(const std::string &edgeID) const
double getLastStepHaltingNumber(const std::string &edgeID) const
double getHCEmission(const std::string &edgeID) const
void adaptTraveltime(const std::string &edgeID, double time, double beginSeconds=0., double endSeconds=std::numeric_limits< double >::max()) const
double getLastStepOccupancy(const std::string &edgeID) const
double getLastStepLength(const std::string &edgeID) const
std::vector< std::string > getLastStepVehicleIDs(const std::string &edgeID) const
double getNOxEmission(const std::string &edgeID) const
void setMaxSpeed(const std::string &edgeID, double speed) const
double getCO2Emission(const std::string &edgeID) const
double getCOEmission(const std::string &edgeID) const
int getLaneNumber(const std::string &edgeID) const
void setEffort(const std::string &edgeID, double effort, double beginSeconds=0., double endSeconds=std::numeric_limits< double >::max()) const
double getNoiseEmission(const std::string &edgeID) const
double getFuelConsumption(const std::string &edgeID) const
double getTraveltime(const std::string &edgeID) const
EdgeScope(TraCIAPI &parent)
int getLastStepVehicleNumber(const std::string &edgeID) const
std::string getStreetName(const std::string &id) const
double getLastStepMeanSpeed(const std::string &edgeID) const
double getPMxEmission(const std::string &edgeID) const
double getAdaptedTraveltime(const std::string &edgeID, double time) const
double getEffort(const std::string &edgeID, double time) const
Scope for interaction with the gui.
void setOffset(const std::string &viewID, double x, double y) const
libsumo::TraCIPositionVector getBoundary(const std::string &viewID=DEFAULT_VIEW) const
std::string getSchema(const std::string &viewID=DEFAULT_VIEW) const
void setBoundary(const std::string &viewID, double xmin, double ymin, double xmax, double ymax) const
void setZoom(const std::string &viewID, double zoom) const
void trackVehicle(const std::string &viewID, const std::string &vehID) const
void setSchema(const std::string &viewID, const std::string &schemeName) const
libsumo::TraCIPosition getOffset(const std::string &viewID=DEFAULT_VIEW) const
GUIScope(TraCIAPI &parent)
double getZoom(const std::string &viewID=DEFAULT_VIEW) const
void screenshot(const std::string &viewID, const std::string &filename, const int width=-1, const int height=-1) const
Scope for interaction with inductive loops.
std::vector< libsumo::TraCIVehicleData > getVehicleData(const std::string &loopID) const
int getIntervalVehicleNumber(const std::string &loopID) const
double getPosition(const std::string &loopID) const
double getLastStepMeanSpeed(const std::string &loopID) const
double getTimeSinceDetection(const std::string &loopID) const
double getLastStepMeanLength(const std::string &loopID) const
virtual ~InductionLoopScope()
std::vector< std::string > getLastStepVehicleIDs(const std::string &loopID) const
double getLastStepOccupancy(const std::string &loopID) const
InductionLoopScope(TraCIAPI &parent)
int getLastStepVehicleNumber(const std::string &loopID) const
std::string getLaneID(const std::string &loopID) const
Scope for interaction with junctions.
JunctionScope(TraCIAPI &parent)
libsumo::TraCIPosition getPosition(const std::string &junctionID) const
libsumo::TraCIPositionVector getShape(const std::string &junctionID) const
Scope for interaction with lane area detectors.
LaneAreaScope(TraCIAPI &parent)
Scope for interaction with lanes.
int getLastStepVehicleNumber(const std::string &laneID) const
double getPMxEmission(const std::string &laneID) const
int getLastStepHaltingNumber(const std::string &laneID) const
std::string getEdgeID(const std::string &laneID) const
void setDisallowed(const std::string &laneID, const std::vector< std::string > &disallowedClasses) const
libsumo::TraCIPositionVector getShape(const std::string &laneID) const
double getLastStepLength(const std::string &laneID) const
void setLength(const std::string &laneID, double length) const
double getLength(const std::string &laneID) const
int getLinkNumber(const std::string &laneID) const
double getTraveltime(const std::string &laneID) const
double getCOEmission(const std::string &laneID) const
void setMaxSpeed(const std::string &laneID, double speed) const
LaneScope(TraCIAPI &parent)
std::vector< std::string > getInternalFoes(const std::string &laneID) const
void setAllowed(const std::string &laneID, const std::vector< std::string > &allowedClasses) const
std::vector< std::string > getDisallowed(const std::string &laneID) const
double getNoiseEmission(const std::string &laneID) const
std::vector< std::string > getAllowed(const std::string &laneID) const
double getFuelConsumption(const std::string &laneID) const
double getWidth(const std::string &laneID) const
double getCO2Emission(const std::string &laneID) const
double getHCEmission(const std::string &laneID) const
std::vector< libsumo::TraCIConnection > getLinks(const std::string &laneID) const
double getMaxSpeed(const std::string &laneID) const
std::vector< std::string > getLastStepVehicleIDs(const std::string &laneID) const
double getElectricityConsumption(const std::string &laneID) const
std::vector< std::string > getFoes(const std::string &laneID, const std::string &toLaneID) const
double getLastStepMeanSpeed(const std::string &laneID) const
double getNOxEmission(const std::string &laneID) const
double getLastStepOccupancy(const std::string &laneID) const
Scope for interaction with multi entry/-exit detectors.
std::vector< std::string > getLastStepVehicleIDs(const std::string &detID) const
int getLastStepVehicleNumber(const std::string &detID) const
std::vector< std::string > getExitLanes(const std::string &detID) const
std::vector< double > getExitPositions(const std::string &detID) const
double getLastStepMeanSpeed(const std::string &detID) const
MeMeScope(TraCIAPI &parent)
int getLastStepHaltingNumber(const std::string &detID) const
std::vector< std::string > getEntryLanes(const std::string &detID) const
std::vector< double > getEntryPositions(const std::string &detID) const
Scope for interaction with POIs.
libsumo::TraCIColor getColor(const std::string &poiID) const
void add(const std::string &poiID, double x, double y, const libsumo::TraCIColor &c, const std::string &type, int layer, const std::string &imgFile, double width, double height, double angle) const
std::string getImageFile(const std::string &poiID) const
void setWidth(const std::string &poiID, double width) const
libsumo::TraCIPosition getPosition(const std::string &poiID) const
void setImageFile(const std::string &poiID, const std::string &imageFile) const
void setHeight(const std::string &poiID, double height) const
void setAngle(const std::string &poiID, double angle) const
double getHeight(const std::string &poiID) const
double getAngle(const std::string &poiID) const
void remove(const std::string &poiID, int layer=0) const
void setColor(const std::string &poiID, const libsumo::TraCIColor &c) const
void setPosition(const std::string &poiID, double x, double y) const
POIScope(TraCIAPI &parent)
double getWidth(const std::string &poiID) const
void setType(const std::string &poiID, const std::string &setType) const
std::string getType(const std::string &poiID) const
Scope for interaction with vehicles.
std::string getNextEdge(const std::string &personID) const
void setLength(const std::string &personID, double length) const
libsumo::TraCIColor getColor(const std::string &personID) const
double getSlope(const std::string &personID) const
int getRemainingStages(const std::string &personID) const
double getWaitingTime(const std::string &personID) const
void setSpeedFactor(const std::string &personID, double factor) const
libsumo::TraCIStage getStage(const std::string &personID, int nextStageIndex=0) const
void removeStage(const std::string &personID, int nextStageIndex) const
void add(const std::string &personID, const std::string &edgeID, double pos, double depart=libsumo::DEPARTFLAG_NOW, const std::string typeID="DEFAULT_PEDTYPE")
PersonScope(TraCIAPI &parent)
void appendWalkingStage(const std::string &personID, const std::vector< std::string > &edges, double arrivalPos, double duration=-1, double speed=-1, const std::string &stopID="")
void setSpeed(const std::string &personID, double speed) const
double getLength(const std::string &personID) const
void moveToXY(const std::string &personID, const std::string &edgeID, const double x, const double y, double angle, const int keepRoute) const
void setHeight(const std::string &personID, double height) const
void setType(const std::string &personID, const std::string &typeID) const
void setMinGap(const std::string &personID, double minGap) const
void moveTo(const std::string &personID, const std::string &edgeID, double position) const
libsumo::TraCIPosition getPosition(const std::string &personID) const
double getSpeedFactor(const std::string &personID) const
void removeStages(const std::string &personID) const
void setColor(const std::string &personID, const libsumo::TraCIColor &c) const
std::string getRoadID(const std::string &personID) const
double getSpeed(const std::string &personID) const
std::string getVehicle(const std::string &personID) const
void appendDrivingStage(const std::string &personID, const std::string &toEdge, const std::string &lines, const std::string &stopID="")
std::string getTypeID(const std::string &personID) const
void appendStage(const std::string &personID, const libsumo::TraCIStage &stage)
double getAngle(const std::string &personID) const
std::string getLaneID(const std::string &personID) const
libsumo::TraCIPosition getPosition3D(const std::string &personID) const
std::vector< std::string > getEdges(const std::string &personID, int nextStageIndex=0) const
void appendWaitingStage(const std::string &personID, double duration, const std::string &description="waiting", const std::string &stopID="")
double getLanePosition(const std::string &personID) const
void setWidth(const std::string &personID, double width) const
void rerouteTraveltime(const std::string &personID) const
Scope for interaction with polygons.
libsumo::TraCIColor getColor(const std::string &polygonID) const
void setType(const std::string &polygonID, const std::string &setType) const
bool getFilled(const std::string &polygonID) const
void add(const std::string &polygonID, const libsumo::TraCIPositionVector &shape, const libsumo::TraCIColor &c, bool fill, const std::string &type, int layer) const
libsumo::TraCIPositionVector getShape(const std::string &polygonID) const
std::string getType(const std::string &polygonID) const
void remove(const std::string &polygonID, int layer=0) const
double getLineWidth(const std::string &polygonID) const
PolygonScope(TraCIAPI &parent)
void setColor(const std::string &polygonID, const libsumo::TraCIColor &c) const
void setLineWidth(const std::string &polygonID, const double lineWidth) const
void setShape(const std::string &polygonID, const libsumo::TraCIPositionVector &shape) const
Scope for interaction with rerouters.
RerouterScope(TraCIAPI &parent)
Scope for interaction with route probes.
RouteProbeScope(TraCIAPI &parent)
virtual ~RouteProbeScope()
Scope for interaction with routes.
RouteScope(TraCIAPI &parent)
std::vector< std::string > getEdges(const std::string &routeID) const
void add(const std::string &routeID, const std::vector< std::string > &edges) const
Scope for interaction with the simulation.
int getDepartedNumber() const
SimulationScope(TraCIAPI &parent)
double getDistance2D(double x1, double y1, double x2, double y2, bool isGeo=false, bool isDriving=false)
libsumo::TraCIPosition convert2D(const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false) const
std::vector< std::string > getStartingTeleportIDList() const
int getStartingTeleportNumber() const
int getEndingTeleportNumber() const
int getBusStopWaiting(const std::string &stopID) const
libsumo::TraCIStage findRoute(const std::string &fromEdge, const std::string &toEdge, const std::string &vType="", double pos=-1., int routingMode=0) const
libsumo::TraCIRoadPosition convertRoad(double x, double y, bool isGeo=false, const std::string &vClass="ignoring") const
void loadState(const std::string &path) const
int getCurrentTime() const
std::vector< std::string > getBusStopWaitingIDList(const std::string &stopID) const
int getDepartedPersonNumber() const
double getDistanceRoad(const std::string &edgeID1, double pos1, const std::string &edgeID2, double pos2, bool isDriving=false)
std::vector< std::string > getArrivedPersonIDList() const
void saveState(const std::string &destination) const
std::vector< std::string > getEndingTeleportIDList() const
int getMinExpectedNumber() const
std::vector< std::string > getDepartedPersonIDList() const
std::vector< std::string > getDepartedIDList() const
int getArrivedPersonNumber() const
std::vector< std::string > getLoadedIDList() const
int getLoadedNumber() const
std::vector< std::string > getArrivedIDList() const
virtual ~SimulationScope()
int getArrivedNumber() const
std::string getOption(const std::string &option) const
libsumo::TraCIPositionVector getNetBoundary() const
void writeMessage(const std::string msg)
libsumo::TraCIPosition convertGeo(double x, double y, bool fromGeo=false) const
libsumo::TraCIPosition convert3D(const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false) const
An abstract interface for accessing type-dependent values.
int getUnsignedByte(int var, const std::string &id, tcpip::Storage *add=0) const
libsumo::ContextSubscriptionResults myContextSubscriptionResults
const libsumo::SubscriptionResults getContextSubscriptionResults(const std::string &objID) const
virtual ~TraCIScopeWrapper()
Destructor.
int getInt(int var, const std::string &id, tcpip::Storage *add=0) const
std::vector< std::string > getStringVector(int var, const std::string &id, tcpip::Storage *add=0) const
double getDouble(int var, const std::string &id, tcpip::Storage *add=0) const
libsumo::TraCIPosition getPos3D(int var, const std::string &id, tcpip::Storage *add=0) const
std::pair< std::string, std::string > getParameterWithKey(const std::string &objectID, const std::string &key) const
retrieve generic parameter and return (key, value) tuple
libsumo::TraCIColor getCol(int var, const std::string &id, tcpip::Storage *add=0) const
void clearSubscriptionResults()
const libsumo::SubscriptionResults getAllSubscriptionResults() const
libsumo::SubscriptionResults mySubscriptionResults
void setStringVector(int var, const std::string &id, const std::vector< std::string > &value) const
std::vector< std::string > getIDList() const
libsumo::TraCIPositionVector getPolygon(int var, const std::string &id, tcpip::Storage *add=0) const
TraCIScopeWrapper(TraCIAPI &parent, int cmdGetID, int cmdSetID, int subscribeID, int contextSubscribeID)
Constructor.
libsumo::SubscriptionResults & getModifiableSubscriptionResults()
const libsumo::TraCIResults getSubscriptionResults(const std::string &objID) const
void setString(int var, const std::string &id, const std::string &value) const
void subscribeContext(const std::string &objID, int domain, double range, const std::vector< int > &vars, double beginTime, double endTime) const
void setParameter(const std::string &objectID, const std::string &key, const std::string &value) const
set generic paramter
TraCIAPI & myParent
The parent TraCI client which offers the connection.
std::string getParameter(const std::string &objectID, const std::string &key) const
retrieve generic parameter
std::vector< double > getDoubleVector(int var, const std::string &id, tcpip::Storage *add=0) const
void setInt(int var, const std::string &id, int value) const
int getByte(int var, const std::string &id, tcpip::Storage *add=0) const
libsumo::TraCIStage getTraCIStage(int var, const std::string &id, tcpip::Storage *add=0) const
void subscribe(const std::string &objID, const std::vector< int > &vars, double beginTime, double endTime) const
std::string getString(int var, const std::string &id, tcpip::Storage *add=0) const
TraCIScopeWrapper & operator=(const TraCIScopeWrapper &src)=delete
invalidated assignment operator
libsumo::TraCIPosition getPos(int var, const std::string &id, tcpip::Storage *add=0) const
const libsumo::ContextSubscriptionResults getAllContextSubscriptionResults() const
libsumo::SubscriptionResults & getModifiableContextSubscriptionResults(const std::string &objID)
void setDouble(int var, const std::string &id, double value) const
Scope for interaction with traffic lights.
void setCompleteRedYellowGreenDefinition(const std::string &tlsID, const libsumo::TraCILogic &logic) const
int getServedPersonCount(const std::string &tlsID, int index) const
std::string getRedYellowGreenState(const std::string &tlsID) const
TrafficLightScope(TraCIAPI &parent)
int getPhase(const std::string &tlsID) const
std::string getPhaseName(const std::string &tlsID) const
void setRedYellowGreenState(const std::string &tlsID, const std::string &state) const
std::string getProgram(const std::string &tlsID) const
void setPhase(const std::string &tlsID, int index) const
void setPhaseName(const std::string &tlsID, const std::string &name) const
double getNextSwitch(const std::string &tlsID) const
virtual ~TrafficLightScope()
std::vector< std::vector< libsumo::TraCILink > > getControlledLinks(const std::string &tlsID) const
double getPhaseDuration(const std::string &tlsID) const
std::vector< std::string > getControlledLanes(const std::string &tlsID) const
std::vector< libsumo::TraCILogic > getAllProgramLogics(const std::string &tlsID) const
void setPhaseDuration(const std::string &tlsID, double phaseDuration) const
void setProgramLogic(const std::string &tlsID, const libsumo::TraCILogic &logic) const
std::vector< libsumo::TraCILogic > getCompleteRedYellowGreenDefinition(const std::string &tlsID) const
void setProgram(const std::string &tlsID, const std::string &programID) const
Scope for interaction with vehicles.
VehicleScope(TraCIAPI &parent)
std::vector< libsumo::TraCINextTLSData > getNextTLS(const std::string &vehID) const
void changeLane(const std::string &vehicleID, int laneIndex, double duration) const
void setMinGap(const std::string &vehicleID, double minGap) const
double getLateralSpeed(const std::string &vehicleID) const
void setMaxSpeed(const std::string &vehicleID, double speed) const
void setPreviousSpeed(const std::string &vehicleID, double prevSpeed, double prevAcceleration=std::numeric_limits< int >::min()) const
double getSpeed(const std::string &vehicleID) const
int getStopState(const std::string &vehicleID) const
double getWaitingTime(const std::string &vehicleID) const
void addSubscriptionFilterCFManeuver(double downstreamDist=-1, double upstreamDist=-1) const
double getCOEmission(const std::string &vehicleID) const
void addSubscriptionFilterStringList(int filterType, const std::vector< std::string > &vals) const
void changeTarget(const std::string &vehicleID, const std::string &edgeID) const
libsumo::TraCIPosition getPosition(const std::string &vehicleID) const
bool isRouteValid(const std::string &vehicleID) const
void addSubscriptionFilterByteList(int filterType, const std::vector< int > &vals) const
double getSecureGap(const std::string &vehicleID, double speed, double leaderSpeed, double leaderMaxDecel, const std::string &leaderID="") const
void setSpeedFactor(const std::string &vehicleID, double factor) const
void setShapeClass(const std::string &vehicleID, const std::string &clazz) const
void addSubscriptionFilterLateralDistance(double lateralDist, double downstreamDist=-1, double foeDistToJunction=-1) const
void setVia(const std::string &vehicleID, const std::vector< std::string > &via) const
void setEmissionClass(const std::string &vehicleID, const std::string &clazz) const
double getTau(const std::string &vehicleID) const
double getDistance(const std::string &vehicleID) const
void remove(const std::string &vehicleID, char reason=libsumo::REMOVE_VAPORIZED) const
void openGap(const std::string &vehicleID, double newTau, double duration, double changeRate, double maxDecel) const
void moveTo(const std::string &vehicleID, const std::string &laneID, double position, int reason=libsumo::MOVE_TELEPORT) const
void setSpeed(const std::string &vehicleID, double speed) const
double getEmergencyDecel(const std::string &vehicleID) const
std::string getEmissionClass(const std::string &vehicleID) const
void setStop(const std::string vehicleID, const std::string edgeID, const double endPos=1., const int laneIndex=0, const double duration=std::numeric_limits< double >::max(), const int flags=0, const double startPos=std::numeric_limits< int >::min(), const double until=-1) const
void setRouteID(const std::string &vehicleID, const std::string &routeID) const
std::pair< int, int > getLaneChangeState(const std::string &vehicleID, int direction) const
double getNoiseEmission(const std::string &vehicleID) const
std::string getShapeClass(const std::string &vehicleID) const
void addSubscriptionFilterLeadFollow(const std::vector< int > &lanes) const
std::string getLine(const std::string &vehicleID) const
double getElectricityConsumption(const std::string &vehicleID) const
double getSpeedFactor(const std::string &vehicleID) const
double getNOxEmission(const std::string &vehicleID) const
void setRoute(const std::string &vehicleID, const std::vector< std::string > &edge) const
int getSignals(const std::string &vehicleID) const
libsumo::TraCIColor getColor(const std::string &vehicleID) const
int getPersonCapacity(const std::string &vehicleID) const
void setSignals(const std::string &vehicleID, int signals) const
std::string getRoadID(const std::string &vehicleID) const
void addSubscriptionFilterVType(const std::vector< std::string > &vTypes) const
void addSubscriptionFilterUpstreamDistance(double dist) const
void addSubscriptionFilterFloat(int filterType, double val) const
double getAllowedSpeed(const std::string &vehicleID) const
void addSubscriptionFilterLanes(const std::vector< int > &lanes, bool noOpposite=false, double downstreamDist=-1, double upstreamDist=-1) const
double getCO2Emission(const std::string &vehicleID) const
double getFuelConsumption(const std::string &vehicleID) const
double getHCEmission(const std::string &vehicleID) const
void addSubscriptionFilterNoOpposite() const
void addSubscriptionFilterLCManeuver(int direction, bool noOpposite=false, double downstreamDist=-1, double upstreamDist=-1) const
std::pair< std::string, double > getLeader(const std::string &vehicleID, double dist) const
double getAcceleration(const std::string &vehicleID) const
std::vector< std::string > getVia(const std::string &vehicleID) const
void addSubscriptionFilterVClass(const std::vector< std::string > &vClasses) const
double getImperfection(const std::string &vehicleID) const
std::string getLaneID(const std::string &vehicleID) const
double getAngle(const std::string &vehicleID) const
void addSubscriptionFilterDownstreamDistance(double dist) const
double getMinGap(const std::string &vehicleID) const
void addSubscriptionFilterEmpty(int filterType) const
double getStopArrivalDelay(const std::string &vehicleID) const
void setAcceleration(const std::string &vehicleID, double accel, double duration) const
std::vector< std::string > getPersonIDList(const std::string &vehicleID) const
double getStopDelay(const std::string &vehicleID) const
double getMinGapLat(const std::string &vehicleID) const
void setLine(const std::string &vehicleID, const std::string &line) const
double getSlope(const std::string &vehicleID) const
@ SIGNAL_EMERGENCY_YELLOW
@ SIGNAL_BLINKER_EMERGENCY
void setColor(const std::string &vehicleID, const libsumo::TraCIColor &c) 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
libsumo::TraCIPosition getPosition3D(const std::string &vehicleID) const
void setLaneChangeMode(const std::string &vehicleID, int mode) const
void setRoutingMode(const std::string &vehicleID, int routingMode) const
void addSubscriptionFilterTurn(double downstreamDist=-1, double upstreamDist=-1) const
double getDecel(const std::string &vehicleID) const
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
double getHeight(const std::string &veihcleID) const
int getRouteIndex(const std::string &vehicleID) const
double getMaxSpeedLat(const std::string &vehicleID) const
void changeSublane(const std::string &vehicleID, double latDist) const
std::string getLateralAlignment(const std::string &vehicleID) const
std::string getRouteID(const std::string &vehicleID) const
double getLanePosition(const std::string &vehicleID) const
int getLaneChangeMode(const std::string &vehicleID) const
int getSpeedMode(const std::string &vehicleID) const
std::vector< std::string > getRoute(const std::string &vehicleID) const
double getApparentDecel(const std::string &vehicleID) const
double getLateralLanePosition(const std::string &vehicleID) const
std::pair< std::string, double > getFollower(const std::string &vehicleID, double dist) const
double getPMxEmission(const std::string &vehicleID) const
double getLength(const std::string &vehicleID) const
double getMaxSpeed(const std::string &vehicleID) const
std::string getVehicleClass(const std::string &vehicleID) const
double getSpeedWithoutTraCI(const std::string &vehicleID) const
int getRoutingMode(const std::string &vehicleID) const
double getWidth(const std::string &vehicleID) const
double getSpeedDeviation(const std::string &vehicleID) const
int getPersonNumber(const std::string &vehicleID) const
double getFollowSpeed(const std::string &vehicleID, double speed, double gap, double leaderSpeed, double leaderMaxDecel, const std::string &leaderID="") const
void setType(const std::string &vehicleID, const std::string &typeID) const
void addSubscriptionFilterFieldOfVision(double angle) const
std::vector< libsumo::TraCIBestLanesData > getBestLanes(const std::string &vehicleID) const
double getAccel(const std::string &vehicleID) const
void setSpeedMode(const std::string &vehicleID, int mode) const
void slowDown(const std::string &vehicleID, double speed, double duration) const
std::string getTypeID(const std::string &vehicleID) const
double getAccumulatedWaitingTime(const std::string &vehicleID) const
void changeLaneRelative(const std::string &vehicleID, int laneChange, double duration) const
void rerouteTraveltime(const std::string &vehicleID, bool currentTravelTimes=true) const
double getStopSpeed(const std::string &vehicleID, double speed, double gap) const
int getLaneIndex(const std::string &vehicleID) const
Scope for interaction with vehicle types.
double getSpeedDeviation(const std::string &typeID) const
double getSpeedFactor(const std::string &typeID) const
void setImperfection(const std::string &typeID, double imperfection) const
void setApparentDecel(const std::string &typeID, double decel) const
void setHeight(const std::string &typeID, double height) const
std::string getShapeClass(const std::string &typeID) const
double getMinGapLat(const std::string &typeID) const
void copy(const std::string &origTypeID, const std::string &newTypeID) const
int getPersonCapacity(const std::string &typeID) const
VehicleTypeScope(TraCIAPI &parent)
void setVehicleClass(const std::string &typeID, const std::string &clazz) const
void setColor(const std::string &typeID, const libsumo::TraCIColor &c) const
void setDecel(const std::string &typeID, double decel) const
void setWidth(const std::string &typeID, double width) const
double getApparentDecel(const std::string &typeID) const
double getDecel(const std::string &typeID) const
void setLateralAlignment(const std::string &typeID, const std::string &latAlignment) const
void setMaxSpeed(const std::string &typeID, double speed) const
double getMinGap(const std::string &typeID) const
std::string getVehicleClass(const std::string &typeID) const
void setShapeClass(const std::string &typeID, const std::string &shapeClass) const
double getMaxSpeedLat(const std::string &typeID) const
double getEmergencyDecel(const std::string &typeID) const
double getWidth(const std::string &typeID) const
libsumo::TraCIColor getColor(const std::string &typeID) const
double getTau(const std::string &typeID) const
double getMaxSpeed(const std::string &typeID) const
double getLength(const std::string &typeID) const
std::string getEmissionClass(const std::string &typeID) const
double getImperfection(const std::string &typeID) const
void setEmissionClass(const std::string &typeID, const std::string &clazz) const
void setAccel(const std::string &typeID, double accel) const
void setMinGap(const std::string &typeID, double minGap) const
double getAccel(const std::string &typeID) const
void setSpeedFactor(const std::string &typeID, double factor) const
double getHeight(const std::string &typeID) const
void setEmergencyDecel(const std::string &typeID, double decel) const
virtual ~VehicleTypeScope()
void setSpeedDeviation(const std::string &typeID, double deviation) const
void setMaxSpeedLat(const std::string &typeID, double speed) const
std::string getLateralAlignment(const std::string &typeID) const
void setMinGapLat(const std::string &typeID, double minGapLat) const
void setLength(const std::string &typeID, double length) const
void setTau(const std::string &typeID, double tau) const
C++ TraCI client API implementation.
RouteScope route
Scope for interaction with routes.
std::pair< int, std::string > getVersion()
return TraCI API and SUMO version
void setOrder(int order)
set priority (execution order) for the client
void readVariableSubscription(int cmdId, tcpip::Storage &inMsg)
tcpip::Storage myInput
The reusable input storage.
MeMeScope multientryexit
Scope for interaction with multi-entry/-exit detectors.
VehicleTypeScope vehicletype
Scope for interaction with vehicle types.
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_commandSimulationStep(double time) const
Sends a SimulationStep command.
GUIScope gui
Scope for interaction with the gui.
void check_resultState(tcpip::Storage &inMsg, int command, bool ignoreCommandId=false, std::string *acknowledgement=0) const
Validates the result state of a command.
PolygonScope polygon
Scope for interaction with polygons.
static std::string toString(const T &t, std::streamsize accuracy=PRECISION)
void connect(const std::string &host, int port)
Connects to the specified SUMO server.
tcpip::Socket * mySocket
The socket.
void load(const std::vector< std::string > &args)
Let sumo load a simulation using the given command line like options.
LaneAreaScope lanearea
Scope for interaction with lanes.
void simulationStep(double time=0)
Advances by one step (or up to the given time)
void createFilterCommand(int cmdID, int varID, tcpip::Storage *add=nullptr) const
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 close()
ends the simulation and closes the connection
LaneScope lane
Scope for interaction with lanes.
std::map< int, TraCIScopeWrapper * > myDomains
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.
bool processSet(int command)
TrafficLightScope trafficlights
Scope for interaction with traffic lights.
InductionLoopScope inductionloop
Scope for interaction with inductive loops.
tcpip::Storage myOutput
The reusable output storage.
POIScope poi
Scope for interaction with POIs.
void closeSocket()
Closes the connection.
int check_commandGetResult(tcpip::Storage &inMsg, int command, int expectedType=-1, bool ignoreCommandId=false) const
Validates the result state of a command.
VehicleScope vehicle
Scope for interaction with vehicles.
JunctionScope junction
Scope for interaction with junctions.
void send_commandClose() const
Sends a Close command.
void send_commandSetOrder(int order) const
Sends a SetOrder command.
RouteProbeScope routeprobe
Scope for interaction with route probes.
EdgeScope edge
Scope for interaction with edges.
bool processGet(int command, int expectedType, bool ignoreCommandId=false)
SimulationScope simulation
Scope for interaction with the simulation.
void readContextSubscription(int cmdId, tcpip::Storage &inMsg)
void readVariables(tcpip::Storage &inMsg, const std::string &objectID, int variableCount, libsumo::SubscriptionResults &into)
PersonScope person
Scope for interaction with persons.
RerouterScope rerouter
Scope for interaction with rerouters.
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
TRACI_CONST int MOVE_TELEPORT
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int DEPARTFLAG_NOW
TRACI_CONST int REMOVE_VAPORIZED
std::map< int, std::shared_ptr< libsumo::TraCIResult > > TraCIResults
{variable->value}
A 2D or 3D-position, for 2D positions z == INVALID_DOUBLE_VALUE.
An edgeId, position and laneIndex.