45std::vector<std::string>
48 std::vector<std::string> ids;
53std::vector<std::string>
56 std::vector<std::string> ids;
57 for (ConstMSEdgeVector::const_iterator i = r->getEdges().begin(); i != r->getEdges().end(); ++i) {
58 ids.push_back((*i)->getID());
66 return (
int)getIDList().size();
71Route::getParameter(
const std::string& routeID,
const std::string& param) {
73 return r->getParameter(param,
"");
81Route::setParameter(
const std::string& routeID,
const std::string& key,
const std::string&
value) {
82 MSRoute* r =
const_cast<MSRoute*
>(getRoute(routeID).get());
88Route::add(
const std::string& routeID,
const std::vector<std::string>& edgeIDs) {
90 if (edgeIDs.size() == 0) {
91 throw TraCIException(
"Cannot add route '" + routeID +
"' without edges.");
93 for (std::vector<std::string>::const_iterator ei = edgeIDs.begin(); ei != edgeIDs.end(); ++ei) {
95 if (edge ==
nullptr) {
96 throw TraCIException(
"Unknown edge '" + *ei +
"' in route.");
98 edges.push_back(edge);
101 ConstMSRoutePtr route = std::make_shared<MSRoute>(routeID, edges,
true,
nullptr, stops);
103 throw TraCIException(
"Could not add route '" + routeID +
"'.");
122 throw TraCIException(
"Route '" +
id +
"' is not known");
128std::shared_ptr<VariableWrapper>
138 return wrapper->wrapStringList(objID, variable, getIDList());
140 return wrapper->wrapInt(objID, variable, getIDCount());
142 return wrapper->wrapStringList(objID, variable,
getEdges(objID));
145 return wrapper->wrapString(objID, variable, getParameter(objID, paramData->
readString()));
148 return wrapper->wrapStringPair(objID, variable, getParameterWithKey(objID, paramData->
readString()));
std::vector< const MSEdge * > ConstMSEdgeVector
std::shared_ptr< const MSRoute > ConstMSRoutePtr
const std::string invalid_return< std::string >::value
std::vector< SUMOVehicleParameter::Stop > StopParVector
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOM)
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
static std::vector< std::string > getEdges(const std::string &routeID)
static ConstMSRoutePtr getRoute(const std::string &id)
static void remove(const std::string &routeID)
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API void add(const std::string &routeID, const std::vector< std::string > &edges)
static SubscriptionResults mySubscriptionResults
static std::shared_ptr< VariableWrapper > makeWrapper()
static ContextSubscriptionResults myContextSubscriptionResults
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper, tcpip::Storage *paramData)
A road/street connecting two junctions.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
void checkRemoval(bool force=false) const
removes the route from the internal dict if it is not marked as permanent
static void insertIDs(std::vector< std::string > &into)
static bool dictionary(const std::string &id, ConstMSRoutePtr route)
Adds a route to the dictionary.
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
virtual std::string readString()
virtual int readUnsignedByte()
TRACI_CONST int VAR_EDGES
TRACI_CONST int TRACI_ID_LIST
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_PARAMETER_WITH_KEY