44 std::vector<std::string>
46 std::vector<std::string> ids;
62 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingTravelTime(e, time, value)) {
73 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingEffort(e, time, value)) {
102 const std::vector<std::string>
104 std::vector<std::string> personIDs;
106 personIDs.reserve(persons.size());
108 personIDs.push_back(p->getID());
114 const std::vector<std::string>
116 std::vector<std::string> vehIDs;
118 vehIDs.push_back(veh->getID());
128 sum += lane->getCO2Emissions();
138 sum += lane->getCOEmissions();
148 sum += lane->getHCEmissions();
158 sum += lane->getPMxEmissions();
168 sum += lane->getNOxEmissions();
178 sum += lane->getFuelConsumption();
188 sum += pow(10., (lane->getHarmonoise_NoiseEmissions() / 10.));
201 sum += lane->getElectricityConsumption();
239 double lengthSum = 0;
245 if (numVehicles == 0) {
248 return lengthSum / numVehicles;
295 pred->rebuildAllowedTargets();
307 Edge::setEffort(
const std::string&
id,
double value,
double begTime,
double endTime) {
315 lane->setMaxSpeed(value);
332 const std::vector<MSLane*>& lanes = e->
getLanes();
333 shape = lanes.front()->getShape();
334 if (lanes.size() > 1) {
335 copy(lanes.back()->getShape().begin(), lanes.back()->getShape().end(), back_inserter(shape));
340 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)
double getLength() const
Returns the vehicle's length.
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
double getWaitingSeconds() const
return accumated waiting time for all vehicles on this edges lanes or segments
static double getCO2Emission(const std::string &id)
TRACI_CONST int LAST_STEP_LENGTH
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
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)
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
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
The base class for microscopic and mesoscopic vehicles.
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 LIBSUMO_GET_PARAMETER_WITH_KEY_API 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)
Representation of a vehicle.
static double getNoiseEmission(const std::string &id)
int getVehicleNumber() const
return total number of vehicles on this edges lanes or segments
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)
virtual 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)
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
static double getPMxEmission(const std::string &id)
static int getLaneNumber(const std::string &id)
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)
double getOccupancy() const
return mean occupancy on this edges lanes or segments
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.