42 #define DEFAULT_VIEW "View #0"
99 TraCILogic(
const std::string& _subID,
int _type,
const std::map<std::string, SUMOReal>& _subParameter,
unsigned int _currentPhaseIndex,
const std::vector<TraCIPhase>& _phases)
112 TraCILink(
const std::string& _from,
const std::string& _via,
const std::string& _to)
142 void connect(
const std::string& host,
int port);
212 std::vector<std::string>
getIDList()
const;
256 std::vector<std::string>
getIDList()
const;
263 void setSchema(
const std::string& viewID,
const std::string& schemeName)
const;
265 void screenshot(
const std::string& viewID,
const std::string& filename)
const;
266 void trackVehicle(
const std::string& viewID,
const std::string& vehID)
const;
289 std::vector<std::string>
getIDList()
const;
291 std::string
getLaneID(
const std::string& loopID)
const;
321 std::vector<std::string>
getIDList()
const;
345 std::vector<std::string>
getIDList()
const;
349 std::vector<std::string>
getAllowed(
const std::string& laneID)
const;
350 std::vector<std::string>
getDisallowed(
const std::string& laneID)
const;
353 std::string
getEdgeID(
const std::string& laneID)
const;
369 void setAllowed(
const std::string& laneID,
const std::vector<std::string>& allowedClasses)
const;
370 void setDisallowed(
const std::string& laneID,
const std::vector<std::string>& disallowedClasses)
const;
395 std::vector<std::string>
getIDList()
const;
422 std::vector<std::string>
getIDList()
const;
423 std::string
getType(
const std::string& poiID)
const;
427 void setType(
const std::string& poiID,
const std::string&
setType)
const;
431 void remove(
const std::string& poiID,
int layer = 0)
const;
454 std::vector<std::string>
getIDList()
const;
455 std::string
getType(
const std::string& polygonID)
const;
458 void setType(
const std::string& polygonID,
const std::string&
setType)
const;
462 void remove(
const std::string& polygonID,
int layer = 0)
const;
485 std::vector<std::string>
getIDList()
const;
486 std::vector<std::string>
getEdges(
const std::string& routeID)
const;
488 void add(
const std::string& routeID,
const std::vector<std::string>& edges)
const;
547 std::vector<std::string>
getIDList()
const;
552 std::string
getProgram(
const std::string& tlsID)
const;
553 unsigned int getPhase(
const std::string& tlsID)
const;
557 void setPhase(
const std::string& tlsID,
unsigned int index)
const;
558 void setProgram(
const std::string& tlsID,
const std::string& programID)
const;
559 void setPhaseDuration(
const std::string& tlsID,
unsigned int phaseDuration)
const;
583 std::vector<std::string>
getIDList()
const;
601 void setVehicleClass(
const std::string& typeID,
const std::string& clazz)
const;
604 void setEmissionClass(
const std::string& typeID,
const std::string& clazz)
const;
607 void setShapeClass(
const std::string& typeID,
const std::string& clazz)
const;
702 int domain,
SUMOReal range,
const std::vector<int>& vars)
const;
std::vector< std::string > getIDList() const
SUMOReal getImperfection(const std::string &typeID) const
EdgeScope edge
Scope for interaction with edges.
TraCIPosition getPosition(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
LaneScope(TraCIAPI &parent)
std::vector< std::string > getIDList() const
SUMOReal getMaxSpeed(const std::string &typeID) const
TraCIPosition getOffset(const std::string &viewID=DEFAULT_VIEW) const
LaneScope & operator=(const LaneScope &src)
invalidated assignment operator
void setLength(const std::string &typeID, SUMOReal length) const
void setMaxSpeed(const std::string &edgeID, SUMOReal speed) const
SUMOReal getNoiseEmission(const std::string &laneID) const
tcpip::Socket * mySocket
The socket.
std::vector< std::string > getIDList() const
std::vector< std::string > getLoadedIDList() const
unsigned int getLastStepVehicleNumber(const std::string &loopID) const
C++ TraCI client API implementation.
void close()
Closes the connection.
Scope for interaction with edges.
void connect(const std::string &host, int port)
Connects to the specified SUMO server.
std::vector< std::string > getArrivedIDList() const
TraCILogic(const std::string &_subID, int _type, const std::map< std::string, SUMOReal > &_subParameter, unsigned int _currentPhaseIndex, const std::vector< TraCIPhase > &_phases)
MeMeScope(TraCIAPI &parent)
std::vector< std::string > getIDList() const
unsigned int getLastStepVehicleNumber(const std::string &edgeID) const
TraCIColor getColor(const std::string &poiID) const
TraCILink(const std::string &_from, const std::string &_via, const std::string &_to)
TrafficLightScope & operator=(const TrafficLightScope &src)
invalidated assignment operator
POIScope & operator=(const POIScope &src)
invalidated assignment operator
void add(const std::string &poiID, SUMOReal x, SUMOReal y, const TraCIColor &c, const std::string &type, int layer) const
SUMOReal getLastStepMeanSpeed(const std::string &edgeID) const
InductionLoopScope & operator=(const InductionLoopScope &src)
invalidated assignment operator
std::vector< std::string > getDisallowed(const std::string &laneID) const
SUMOReal getCOEmission(const std::string &edgeID) const
void setShapeClass(const std::string &typeID, const std::string &clazz) const
void setPhase(const std::string &tlsID, unsigned int index) const
void setProgram(const std::string &tlsID, const std::string &programID) const
void setVehicleClass(const std::string &typeID, const std::string &clazz) const
std::string getVehicleClass(const std::string &typeID) const
void setColor(const std::string &polygonID, const TraCIColor &c) const
GUIScope(TraCIAPI &parent)
SUMOReal getDouble(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
virtual ~TrafficLightScope()
void send_commandClose() const
Sends a Close command.
TraCIScopeWrapper & operator=(const TraCIScopeWrapper &src)
invalidated assignment operator
JunctionScope junction
Scope for interaction with junctions.
PolygonScope & operator=(const PolygonScope &src)
invalidated assignment operator
TraCIPhase(const SUMOTime _duration, const SUMOTime _duration1, const SUMOTime _duration2, const std::string &_phase)
void send_commandSubscribeObjectContext(int domID, const std::string &objID, int beginTime, int endTime, int domain, SUMOReal range, const std::vector< int > &vars) const
Sends a SubscribeContext request.
LaneScope lane
Scope for interaction with lanes.
void setMaxSpeed(const std::string &typeID, SUMOReal speed) const
void setCompleteRedYellowGreenDefinition(const std::string &tlsID, const TraCIAPI::TraCILogic &logic) const
unsigned int currentPhaseIndex
std::string getEmissionClass(const std::string &typeID) const
void add(const std::string &polygonID, const TraCIPositionVector &shape, const TraCIColor &c, bool fill, const std::string &type, int layer) const
SUMOReal getLastStepMeanSpeed(const std::string &detID) const
void processGET(tcpip::Storage &inMsg, int command, int expectedType, bool ignoreCommandId=false) const
SUMOReal getPMxEmission(const std::string &laneID) const
SUMOReal getLastStepOccupancy(const std::string &edgeID) const
unsigned int getLastStepHaltingNumber(const std::string &detID) const
std::vector< std::string > getLastStepVehicleIDs(const std::string &loopID) const
EdgeScope & operator=(const EdgeScope &src)
invalidated assignment operator
TraCIPosition getPosition(const std::string &junctionID) const
void trackVehicle(const std::string &viewID, const std::string &vehID) const
std::vector< std::string > getIDList() const
JunctionScope & operator=(const JunctionScope &src)
invalidated assignment operator
SUMOTime getCurrentTime() const
SUMOReal getLength(const std::string &laneID) const
SUMOReal getLastStepMeanSpeed(const std::string &laneID) const
std::vector< std::string > getIDList() const
Scope for interaction with traffic lights.
SUMOReal getMinGap(const std::string &typeID) const
Scope for interaction with the gui.
std::vector< std::string > getControlledLanes(const std::string &tlsID) const
SUMOReal getLastStepMeanLength(const std::string &loopID) const
void setAllowed(const std::string &laneID, const std::vector< std::string > &allowedClasses) const
TrafficLightScope trafficlights
Scope for interaction with traffic lights.
SUMOReal getWidth(const std::string &typeID) const
TraCIPositionVector getPolygon(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
SUMOReal getLastStepOccupancy(const std::string &laneID) const
std::string getProgram(const std::string &tlsID) const
Scope for interaction with routes.
std::vector< std::string > getIDList() const
TraCIBoundary getBoundingBox(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
InductionLoopScope inductionloop
Scope for interaction with inductive loops.
void setDisallowed(const std::string &laneID, const std::vector< std::string > &disallowedClasses) const
void setTau(const std::string &typeID, SUMOReal tau) const
SUMOReal getCO2Emission(const std::string &laneID) const
std::vector< std::string > getAllowed(const std::string &laneID) const
void setBoundary(const std::string &viewID, SUMOReal xmin, SUMOReal ymin, SUMOReal xmax, SUMOReal ymax) const
void setMaxSpeed(const std::string &laneID, SUMOReal speed) const
Scope for interaction with inductive loops.
unsigned int getIDCount() const
RouteScope & operator=(const RouteScope &src)
invalidated assignment operator
POIScope(TraCIAPI &parent)
Scope for interaction with POIs.
Scope for interaction with the simulation.
Scope for interaction with multi entry/-exit detectors.
void send_commandSimulationStep(SUMOTime time) const
Sends a SimulationStep command.
std::string getRedYellowGreenState(const std::string &tlsID) const
void adaptTraveltime(const std::string &edgeID, SUMOReal time) const
InductionLoopScope(TraCIAPI &parent)
MeMeScope multientryexit
Scope for interaction with multi-entry/-exit detectors.
void setDecel(const std::string &typeID, SUMOReal decel) const
void setLength(const std::string &laneID, SUMOReal length) const
SUMOTime getDeltaT() const
void setSchema(const std::string &viewID, const std::string &schemeName) const
Scope for interaction with vehicle types.
TraCIColor getColor(const std::string &typeID) const
std::string getType(const std::string &polygonID) const
SUMOReal getTraveltime(const std::string &laneID) const
void setType(const std::string &poiID, const std::string &setType) const
PolygonScope(TraCIAPI &parent)
SUMOReal getNOxEmission(const std::string &laneID) const
void send_commandGetVariable(int domID, int varID, const std::string &objID, tcpip::Storage *add=0) const
Sends a GetVariable request.
TraCIColor getColor(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
std::vector< std::string > getIDList() const
void screenshot(const std::string &viewID, const std::string &filename) const
std::vector< std::string > getDepartedIDList() const
unsigned int getLastStepHaltingNumber(const std::string &laneID) const
std::vector< TraCIAPI::TraCILink > getControlledLinks(const std::string &tlsID) const
RouteScope route
Scope for interaction with routes.
unsigned int getArrivedNumber() const
virtual ~InductionLoopScope()
SUMOReal getHCEmission(const std::string &laneID) const
void setWidth(const std::string &typeID, SUMOReal width) const
Scope for interaction with polygons.
void setEmissionClass(const std::string &typeID, const std::string &clazz) const
unsigned int getNextSwitch(const std::string &tlsID) const
TraCIPositionVector getShape(const std::string &polygonID) const
void setSpeedFactor(const std::string &typeID, SUMOReal factor) const
std::vector< TraCIPhase > phases
int getInt(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
SUMOReal getSpeedFactor(const std::string &typeID) const
std::vector< std::string > getIDList() const
SUMOReal getLastStepLength(const std::string &edgeID) const
void setRedYellowGreenState(const std::string &tlsID, const std::string &state) const
std::string getShapeClass(const std::string &typeID) const
int getByte(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
std::string getSchema(const std::string &viewID=DEFAULT_VIEW) const
SUMOReal getLastStepOccupancy(const std::string &loopID) const
int getUnsignedByte(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
void setMinGap(const std::string &typeID, SUMOReal minGap) const
TraCIColor getColor(const std::string &polygonID) const
SUMOReal getDecel(const std::string &typeID) const
void setPhaseDuration(const std::string &tlsID, unsigned int phaseDuration) const
std::vector< std::string > getEndingTeleportIDList() const
SUMOReal getPosition(const std::string &loopID) const
Scope for interaction with junctions.
TraCIBoundary getBoundary(const std::string &viewID=DEFAULT_VIEW) const
SUMOReal getTimeSinceDetection(const std::string &loopID) const
void setOffset(const std::string &viewID, SUMOReal x, SUMOReal y) const
std::string getEdgeID(const std::string &laneID) const
TrafficLightScope(TraCIAPI &parent)
unsigned int getEndingTeleportNumber() const
SUMOReal getMaxSpeed(const std::string &laneID) const
unsigned int getLastStepVehicleNumber(const std::string &laneID) const
virtual ~SimulationScope()
SUMOReal getLastStepMeanSpeed(const std::string &loopID) const
void setAccel(const std::string &typeID, SUMOReal accel) const
void setImperfection(const std::string &typeID, SUMOReal imperfection) const
std::vector< std::string > getStringVector(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
SUMOReal getCOEmission(const std::string &laneID) const
EdgeScope(TraCIAPI &parent)
TraCIPosition getPosition(const std::string &poiID) const
SUMOReal getFuelConsumption(const std::string &edgeID) const
POIScope poi
Scope for interaction with POIs.
SUMOReal getZoom(const std::string &viewID=DEFAULT_VIEW) const
SUMOReal getWidth(const std::string &laneID) const
void send_commandSubscribeObjectVariable(int domID, const std::string &objID, int beginTime, int endTime, const std::vector< int > &vars) const
Sends a SubscribeVariable request.
SimulationScope simulation
Scope for interaction with the simulation.
std::vector< TraCIAPI::TraCILogic > getCompleteRedYellowGreenDefinition(const std::string &tlsID) const
void setType(const std::string &polygonID, const std::string &setType) const
TraCIPositionVector getShape(const std::string &laneID) const
Scope for interaction with lanes.
void setEffort(const std::string &edgeID, SUMOReal effort) const
TraCIScopeWrapper(TraCIAPI &parent)
Constructor.
RouteScope(TraCIAPI &parent)
SUMOReal getEffort(const std::string &edgeID, SUMOTime time) const
SUMOTime getSUMOTime(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
SUMOReal getHCEmission(const std::string &edgeID) const
std::vector< std::string > getLastStepVehicleIDs(const std::string &detID) const
unsigned int getDepartedNumber() const
VehicleTypeScope & operator=(const VehicleTypeScope &src)
invalidated assignment operator
std::string getType(const std::string &poiID) const
std::string getLaneID(const std::string &loopID) const
PolygonScope polygon
Scope for interaction with polygons.
virtual ~TraCIScopeWrapper()
Destructor.
std::vector< std::string > getIDList() const
void check_resultState(tcpip::Storage &inMsg, int command, bool ignoreCommandId=false, std::string *acknowledgement=0) const
Validates the result state of a command.
unsigned int getLinkNumber(const std::string &laneID) const
VehicleTypeScope(TraCIAPI &parent)
SUMOReal getNoiseEmission(const std::string &edgeID) const
SUMOReal getAccel(const std::string &typeID) const
SUMOReal getTraveltime(const std::string &edgeID) const
void setZoom(const std::string &viewID, SUMOReal zoom) const
std::map< std::string, SUMOReal > subParameter
TraCIAPI & myParent
The parent TraCI client which offers the connection.
std::vector< std::string > getLastStepVehicleIDs(const std::string &laneID) const
GUIScope gui
Scope for interaction with the gui.
SUMOReal getLastStepLength(const std::string &laneID) const
void setShape(const std::string &polygonID, const TraCIPositionVector &shape) const
void setColor(const std::string &typeID, const TraCIColor &c) const
void send_commandSetValue(int domID, int varID, const std::string &objID, tcpip::Storage &content) const
Sends a SetVariable request.
unsigned int getStartingTeleportNumber() const
SUMOReal getPMxEmission(const std::string &edgeID) const
void setPosition(const std::string &poiID, SUMOReal x, SUMOReal y) const
SUMOReal getSpeedDeviation(const std::string &typeID) const
SUMOReal getCO2Emission(const std::string &edgeID) const
unsigned int getLoadedNumber() const
void check_commandGetResult(tcpip::Storage &inMsg, int command, int expectedType=-1, bool ignoreCommandId=false) const
std::string getString(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
void setSpeedDeviation(const std::string &typeID, SUMOReal deviation) const
SimulationScope(TraCIAPI &parent)
SUMOReal getNOxEmission(const std::string &edgeID) const
An abstract interface for accessing type-dependent values.
GUIScope & operator=(const GUIScope &src)
invalidated assignment operator
SimulationScope & operator=(const SimulationScope &src)
invalidated assignment operator
MeMeScope & operator=(const MeMeScope &src)
invalidated assignment operator
TraCIBoundary getNetBoundary() const
std::vector< TraCIPosition > TraCIPositionVector
unsigned int getMinExpectedNumber() const
SUMOReal getAdaptedTraveltime(const std::string &edgeID, SUMOTime time) const
std::vector< std::string > getEdges(const std::string &routeID) const
virtual ~VehicleTypeScope()
SUMOReal getFloat(int cmd, int var, const std::string &id, tcpip::Storage *add=0)
unsigned int getVehicleData(const std::string &loopID) const
unsigned int getPhase(const std::string &tlsID) const
SUMOReal getLength(const std::string &typeID) const
SUMOReal getTau(const std::string &typeID) const
unsigned int getLastStepVehicleNumber(const std::string &detID) const
std::vector< std::string > getLastStepVehicleIDs(const std::string &edgeID) const
JunctionScope(TraCIAPI &parent)
SUMOReal getFuelConsumption(const std::string &laneID) const
void setColor(const std::string &poiID, const TraCIColor &c) const
void add(const std::string &routeID, const std::vector< std::string > &edges) const
std::vector< std::string > getIDList() const
SUMOReal getLastStepHaltingNumber(const std::string &edgeID) const
std::vector< std::string > getStartingTeleportIDList() const
VehicleTypeScope vehicletype
Scope for interaction with vehicle types.