41 std::vector<std::string>
43 std::vector<std::string> ids;
59 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingTravelTime(e, time, value)) {
70 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingEffort(e, time, value)) {
97 wtime += lane->getWaitingSeconds();
103 const std::vector<std::string>
105 std::vector<std::string> personIDs;
107 personIDs.reserve(persons.size());
109 personIDs.push_back(p->getID());
115 const std::vector<std::string>
117 std::vector<std::string> vehIDs;
120 for (
auto veh : vehs) {
121 vehIDs.push_back(veh->getID());
123 lane->releaseVehicles();
133 sum += lane->getCO2Emissions();
143 sum += lane->getCOEmissions();
153 sum += lane->getHCEmissions();
163 sum += lane->getPMxEmissions();
173 sum += lane->getNOxEmissions();
183 sum += lane->getFuelConsumption();
193 sum += pow(10., (lane->getHarmonoise_NoiseEmissions() / 10.));
206 sum += lane->getElectricityConsumption();
216 sum += lane->getVehicleNumber();
232 for (
auto lane : lanes) {
233 sum += lane->getNettoOccupancy();
235 return sum / (double)lanes.size();
244 for (
auto veh : vehs) {
249 lane->releaseVehicles();
257 double lengthSum = 0;
261 for (
auto veh : vehs) {
262 lengthSum += veh->getVehicleType().getLength();
264 noVehicles += (int)vehs.size();
265 lane->releaseVehicles();
267 if (noVehicles == 0) {
270 return lengthSum / (double)noVehicles;
314 pred->rebuildAllowedTargets();
326 Edge::setEffort(
const std::string&
id,
double value,
double begTime,
double endTime) {
334 lane->setMaxSpeed(value);
351 const std::vector<MSLane*>& lanes = e->
getLanes();
352 shape = lanes.front()->getShape();
353 if (lanes.size() > 1) {
354 copy(lanes.back()->getShape().begin(), lanes.back()->getShape().end(), back_inserter(shape));
359 std::shared_ptr<VariableWrapper>
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
static void setEffort(const std::string &id, double value, double begTime=0., double endTime=std::numeric_limits< double >::max())
static double getNOxEmission(const std::string &id)
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
TRACI_CONST int VAR_COEMISSION
static double getCO2Emission(const std::string &id)
TRACI_CONST int LAST_STEP_LENGTH
TRACI_CONST int VAR_WAITING_TIME
static ContextSubscriptionResults myContextSubscriptionResults
static double getFuelConsumption(const std::string &id)
static double getLastStepMeanSpeed(const std::string &id)
const MSEdgeVector & getPredecessors() const
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
static double getHCEmission(const std::string &id)
static double getAdaptedTraveltime(const std::string &id, double time)
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double getMeanSpeed() const
get the mean speed
TRACI_CONST int VAR_FUELCONSUMPTION
static void setDisallowedVehicleClasses(const std::string &id, std::vector< std::string > classes)
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...
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
virtual bool wrapString(const std::string &objID, const int variable, const std::string &value)=0
TRACI_CONST int VAR_NOXEMISSION
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's persons sorted by pos.
static double getElectricityConsumption(const std::string &id)
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
static std::string getParameter(const std::string &id, const std::string ¶mName)
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
static double getLastStepOccupancy(const std::string &id)
TRACI_CONST int TRACI_ID_LIST
A road/street connecting two junctions.
TRACI_CONST int LAST_STEP_VEHICLE_ID_LIST
TRACI_CONST int VAR_CURRENT_TRAVELTIME
void rebuildAllowedLanes()
TRACI_CONST int VAR_NOISEEMISSION
static SubscriptionResults mySubscriptionResults
static void setAllowedVehicleClasses(const std::string &id, std::vector< std::string > vector)
static std::string getStreetName(const std::string &id)
static double getTraveltime(const std::string &id)
static double getNoiseEmission(const std::string &id)
void addTravelTime(const MSEdge *const e, double begin, double end, double value)
Adds a travel time information for an edge and a time span.
TRACI_CONST int VAR_PMXEMISSION
static double getEffort(const std::string &id, double time)
static double getCOEmission(const std::string &id)
static int getLastStepHaltingNumber(const std::string &id)
static const std::vector< std::string > getLastStepVehicleIDs(const std::string &id)
static void setAllowedSVCPermissions(const std::string &id, int permissions)
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
std::vector< MSVehicle * > VehCont
Container for vehicles.
const std::string & getStreetName() const
Returns the street name of the edge.
static double getWaitingTime(const std::string &id)
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
static void setMaxSpeed(const std::string &id, double value)
static void adaptTraveltime(const std::string &id, double value, double begTime=0., double endTime=std::numeric_limits< double >::max())
TRACI_CONST int LAST_STEP_MEAN_SPEED
static MSEdge * getEdge(const std::string &id)
static std::shared_ptr< VariableWrapper > makeWrapper()
TRACI_CONST int LAST_STEP_OCCUPANCY
TRACI_CONST int LAST_STEP_PERSON_ID_LIST
bool noVehicles(SVCPermissions permissions)
Returns whether an edge with the given permission forbids vehicles.
static double getPMxEmission(const std::string &id)
static int getLaneNumber(const std::string &id)
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
TRACI_CONST int LAST_STEP_VEHICLE_NUMBER
static double getLastStepLength(const std::string &id)
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
static const std::vector< std::string > getLastStepPersonIDs(const std::string &id)
TRACI_CONST int VAR_CO2EMISSION
static std::vector< std::string > getIDList()
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
static LIBSUMO_SUBSCRIPTION_API void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
static int getLastStepVehicleNumber(const std::string &id)
TRACI_CONST int VAR_LANE_INDEX
TRACI_CONST int LAST_STEP_VEHICLE_HALTING_NUMBER
static void setParameter(const std::string &id, const std::string &name, const std::string &value)
TRACI_CONST int VAR_HCEMISSION
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
static const long CHANGE_PERMISSIONS_PERMANENT
static double sum(double val)
Computes the resulting noise.
Representation of a lane in the micro simulation.
TRACI_CONST int VAR_ELECTRICITYCONSUMPTION
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.