49std::vector<std::string>
52 std::vector<std::string> ids;
60 return (
int)getIDList().size();
88 return getEdge(edgeID)->getCurrentTravelTime();
96 throw TraCIException(
"Edge '" + edgeID +
"' is not known");
104 return getEdge(edgeID)->getWaitingSeconds();
108const std::vector<std::string>
110 std::vector<std::string> personIDs;
111 std::vector<MSTransportable*> persons =
getEdge(edgeID)->getSortedPersons(
MSNet::getInstance()->getCurrentTimeStep(),
true);
112 personIDs.reserve(persons.size());
114 personIDs.push_back(p->getID());
120const std::vector<std::string>
122 std::vector<std::string> vehIDs;
124 vehIDs.push_back(veh->getID());
134 sum += lane->getEmissions<PollutantsInterface::CO2>();
144 sum += lane->getEmissions<PollutantsInterface::CO>();
154 sum += lane->getEmissions<PollutantsInterface::HC>();
164 sum += lane->getEmissions<PollutantsInterface::PM_X>();
174 sum += lane->getEmissions<PollutantsInterface::NO_X>();
184 sum += lane->getEmissions<PollutantsInterface::FUEL>();
194 sum += pow(10., (lane->getHarmonoise_NoiseEmissions() / 10.));
207 sum += lane->getEmissions<PollutantsInterface::ELEC>();
215 return getEdge(edgeID)->getVehicleNumber();
221 return getEdge(edgeID)->getMeanSpeed();
226 return getEdge(edgeID)->getMeanFriction();
232 return getEdge(edgeID)->getOccupancy();
250 double lengthSum = 0;
256 if (numVehicles == 0) {
259 return lengthSum / numVehicles;
265 return (
int)
getEdge(edgeID)->getLanes().size();
271 return getEdge(edgeID)->getStreetName();
275const std::vector<std::string>
278 std::vector<std::string> vehIDs;
280 if (veh->getEdge()->getID() == edgeID) {
281 vehIDs.push_back(veh->getID());
290 const std::vector<MSLane*>& lanes =
getEdge(edgeID)->getLanes();
296 return getEdge(edgeID)->getFromJunction()->getID();
301 return getEdge(edgeID)->getToJunction()->getID();
307 return bidi ==
nullptr ?
"" : bidi->
getID();
311Edge::getParameter(
const std::string& edgeID,
const std::string& param) {
312 return getEdge(edgeID)->getParameter(param,
"");
360Edge::setEffort(
const std::string& edgeID,
double effort,
double beginSeconds,
double endSeconds) {
367 getEdge(edgeID)->setMaxSpeed(speed);
373 lane->setFrictionCoefficient(friction);
378Edge::setParameter(
const std::string& edgeID,
const std::string& name,
const std::string&
value) {
379 getEdge(edgeID)->setParameter(name,
value);
390 copy(lane->getShape().begin(), lane->getShape().end(), back_inserter(shape));
395std::shared_ptr<VariableWrapper>
405 return wrapper->wrapStringList(objID, variable, getIDList());
407 return wrapper->wrapInt(objID, variable, getIDCount());
413 return wrapper->wrapDouble(objID, variable,
getTraveltime(objID));
415 return wrapper->wrapDouble(objID, variable,
getWaitingTime(objID));
421 return wrapper->wrapDouble(objID, variable,
getCO2Emission(objID));
423 return wrapper->wrapDouble(objID, variable,
getCOEmission(objID));
425 return wrapper->wrapDouble(objID, variable,
getHCEmission(objID));
427 return wrapper->wrapDouble(objID, variable,
getPMxEmission(objID));
429 return wrapper->wrapDouble(objID, variable,
getNOxEmission(objID));
449 return wrapper->wrapInt(objID, variable,
getLaneNumber(objID));
451 return wrapper->wrapString(objID, variable,
getStreetName(objID));
459 return wrapper->wrapString(objID, variable,
getToJunction(objID));
461 return wrapper->wrapString(objID, variable,
getBidiEdge(objID));
const std::string invalid_return< std::string >::value
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOM)
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
C++ TraCI client API implementation.
static double sum(double val)
Computes the resulting noise.
static double getCO2Emission(const std::string &edgeID)
static void storeShape(const std::string &edgeID, PositionVector &shape)
Saves the shape of the requested object in the given container.
static double getLastStepLength(const std::string &edgeID)
static double getMeanFriction(const std::string &edgeID)
static double getCOEmission(const std::string &edgeID)
static std::shared_ptr< VariableWrapper > makeWrapper()
static const std::vector< std::string > getLastStepPersonIDs(const std::string &edgeID)
static void adaptTraveltime(const std::string &edgeID, double time, double beginSeconds=0., double endSeconds=std::numeric_limits< double >::max())
static void setDisallowed(const std::string &edgeID, std::string disallowedClasses)
static double getNOxEmission(const std::string &edgeID)
static double getFuelConsumption(const std::string &edgeID)
static int getLastStepHaltingNumber(const std::string &edgeID)
static void setFriction(const std::string &edgeID, double friction)
static void setEffort(const std::string &edgeID, double effort, double beginSeconds=0., double endSeconds=std::numeric_limits< double >::max())
static const std::vector< std::string > getPendingVehicles(const std::string &edgeID)
static ContextSubscriptionResults myContextSubscriptionResults
static double getPMxEmission(const std::string &edgeID)
static double getTraveltime(const std::string &edgeID)
static double getWaitingTime(const std::string &edgeID)
static const std::vector< std::string > getLastStepVehicleIDs(const std::string &edgeID)
static int getLaneNumber(const std::string &edgeID)
static double getHCEmission(const std::string &edgeID)
static std::string getFromJunction(const std::string &edgeID)
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper, tcpip::Storage *paramData)
static MSEdge * getEdge(const std::string &edgeID)
static double getEffort(const std::string &edgeID, double time)
static double getLastStepOccupancy(const std::string &edgeID)
static void setAllowedSVCPermissions(const std::string &edgeID, long long int permissions)
static std::string getStreetName(const std::string &edgeID)
static std::string getBidiEdge(const std::string &edgeID)
static void setMaxSpeed(const std::string &edgeID, double speed)
static int getLastStepVehicleNumber(const std::string &edgeID)
static std::string getToJunction(const std::string &edgeID)
static double getElectricityConsumption(const std::string &edgeID)
static double getAdaptedTraveltime(const std::string &edgeID, double time)
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API void setAllowed(const std::string &edgeID, std::string allowedClasses)
static double getLastStepMeanSpeed(const std::string &edgeID)
static SubscriptionResults mySubscriptionResults
static double getAngle(const std::string &edgeID, double relativePosition=libsumo::INVALID_DOUBLE_VALUE)
static double getNoiseEmission(const std::string &edgeID)
static double getAngle(const std::string &laneID, double relativePosition=libsumo::INVALID_DOUBLE_VALUE)
The base class for microscopic and mesoscopic vehicles.
double getLength() const
Returns the vehicle's length.
A road/street connecting two junctions.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
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 void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
void rebuildAllowedLanes(const bool onInit=false, bool updateVehicles=false)
void addTravelTime(const MSEdge *const e, double begin, double end, double value)
Adds a travel time information for an edge and a time span.
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.
Representation of a lane in the micro simulation.
static const long CHANGE_PERMISSIONS_PERMANENT
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
const std::string & getID() const
Returns the id.
Representation of a vehicle.
static std::string readTypedString(tcpip::Storage &ret, const std::string &error="")
static double readTypedDouble(tcpip::Storage &ret, const std::string &error="")
TRACI_CONST double INVALID_DOUBLE_VALUE
TRACI_CONST int LAST_STEP_VEHICLE_ID_LIST
TRACI_CONST int LAST_STEP_VEHICLE_NUMBER
TRACI_CONST int VAR_NOXEMISSION
TRACI_CONST int LAST_STEP_PERSON_ID_LIST
TRACI_CONST int TRACI_ID_LIST
TRACI_CONST int VAR_WAITING_TIME
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
TRACI_CONST int VAR_EDGE_TRAVELTIME
TRACI_CONST int LAST_STEP_LENGTH
TRACI_CONST int VAR_ANGLE
TRACI_CONST int VAR_EDGE_EFFORT
TRACI_CONST int VAR_LANE_INDEX
TRACI_CONST int VAR_PMXEMISSION
TRACI_CONST int VAR_COEMISSION
TRACI_CONST int LAST_STEP_MEAN_SPEED
TRACI_CONST int VAR_CO2EMISSION
TRACI_CONST int VAR_PENDING_VEHICLES
TRACI_CONST int VAR_FUELCONSUMPTION
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int LAST_STEP_VEHICLE_HALTING_NUMBER
TRACI_CONST int VAR_HCEMISSION
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int LAST_STEP_OCCUPANCY
TRACI_CONST int VAR_NOISEEMISSION
TRACI_CONST int VAR_PARAMETER_WITH_KEY
TRACI_CONST int VAR_FRICTION
TRACI_CONST int FROM_JUNCTION
TRACI_CONST int VAR_CURRENT_TRAVELTIME
TRACI_CONST int VAR_ELECTRICITYCONSUMPTION
TRACI_CONST int TO_JUNCTION