Hi Jakob,
As i said in the conference, i added some person functions for c++ traci
client.ı sended the changes in the TraCIAPI.h and TraCIAPI.cpp files.I think
you will add them in the related download files.
Regards,caner ipek
Changes in TraCIAPI.h file:
public: /// @brief Scope for interaction with edges EdgeScope edge;
/// @brief Scope for interaction with the gui GUIScope gui; /// @brief
Scope for interaction with inductive loops InductionLoopScope inductionloop;
/// @brief Scope for interaction with junctions JunctionScope junction;
/// @brief Scope for interaction with lanes LaneScope lane; /// @brief
Scope for interaction with multi-entry/-exit detectors MeMeScope
multientryexit; /// @brief Scope for interaction with POIs POIScope poi;
/// @brief Scope for interaction with polygons PolygonScope polygon;
/// @brief Scope for interaction with routes RouteScope route; /// @brief
Scope for interaction with the simulation SimulationScope simulation; ///
@brief Scope for interaction with traffic lights TrafficLightScope
trafficlights; /// @brief Scope for interaction with vehicle types
VehicleTypeScope vehicletype; /// @brief Scope for interaction with vehicles
VehicleScope vehicle; /// @brief Scope for interaction with persons
PersonScope person; ////////////////////////////////////////////////
/** @class PersonScope * @brief Scope for interaction with vehicles
*/ class PersonScope : public TraCIScopeWrapper { public:
PersonScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} virtual
~PersonScope() {}
std::vector<std::string> getIDList() const; unsigned int
getIDCount() const; SUMOReal getSpeed(const std::string& typeID) const;
TraCIPosition getPosition(const std::string& typeID) const; std::string
getRoadID(const std::string& typeID) const; std::string getTypeID(const
std::string& typeID) const; SUMOReal getWaitingTime(const std::string& typeID)
const; // bug in 0.25. std::string getNextEdge(const std::string& typeID)
const;
private: /// @brief invalidated copy constructor
PersonScope(const PersonScope& src);
/// @brief invalidated assignment operator PersonScope&
operator=(const PersonScope& src);
};
/////////////////////////////////////////////////////////////////////////
Changes in TraCIAPI.cpp file:
TraCIAPI::TraCIAPI() : edge(*this), gui(*this), inductionloop(*this),
junction(*this), lane(*this), multientryexit(*this), poi(*this),
polygon(*this), route(*this), simulation(*this), trafficlights(*this),
vehicletype(*this), vehicle(*this), person(*this), mySocket(0) {}
//
---------------------------------------------------------------------------//
TraCIAPI::PersonScope-methods//
---------------------------------------------------------------------------std::vector<std::string>TraCIAPI::PersonScope::getIDList()
const { return myParent.getStringVector(CMD_GET_PERSON_VARIABLE, ID_LIST,
"");}
unsigned intTraCIAPI::PersonScope::getIDCount() const { return
myParent.getInt(CMD_GET_PERSON_VARIABLE, ID_COUNT, "");}
SUMORealTraCIAPI::PersonScope::getSpeed(const std::string& typeID) const {
return myParent.getDouble(CMD_GET_PERSON_VARIABLE, VAR_SPEED, typeID);}
TraCIAPI::TraCIPositionTraCIAPI::PersonScope::getPosition(const std::string&
typeID) const { return myParent.getPosition(CMD_GET_PERSON_VARIABLE,
VAR_POSITION, typeID);}
std::stringTraCIAPI::PersonScope::getRoadID(const std::string& typeID) const {
return myParent.getString(CMD_GET_PERSON_VARIABLE, VAR_ROAD_ID, typeID);}
std::stringTraCIAPI::PersonScope::getTypeID(const std::string& typeID) const {
return myParent.getString(CMD_GET_PERSON_VARIABLE, VAR_TYPE, typeID);}
SUMORealTraCIAPI::PersonScope::getWaitingTime(const std::string& typeID) const
{ return myParent.getDouble(CMD_GET_PERSON_VARIABLE, VAR_WAITING_TIME,
typeID);}
std::stringTraCIAPI::PersonScope::getNextEdge(const std::string& typeID) const
{ return myParent.getString(CMD_GET_PERSON_VARIABLE, VAR_NEXT_EDGE,
typeID);}
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user