 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
40 std::vector<std::string>
42 std::vector<std::string> ids;
58 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingTravelTime(e, time, value)) {
69 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingEffort(e, time, value)) {
96 wtime += lane->getWaitingSeconds();
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;
119 for (
auto veh : vehs) {
120 vehIDs.push_back(veh->getID());
122 lane->releaseVehicles();
132 sum += lane->getCO2Emissions();
142 sum += lane->getCOEmissions();
152 sum += lane->getHCEmissions();
162 sum += lane->getPMxEmissions();
172 sum += lane->getNOxEmissions();
182 sum += lane->getFuelConsumption();
192 sum += pow(10., (lane->getHarmonoise_NoiseEmissions() / 10.));
205 sum += lane->getElectricityConsumption();
215 sum += lane->getVehicleNumber();
231 for (
auto lane : lanes) {
232 sum += lane->getNettoOccupancy();
234 return sum / (double)lanes.size();
243 for (
auto veh : vehs) {
248 lane->releaseVehicles();
256 double lengthSum = 0;
260 for (
auto veh : vehs) {
261 lengthSum += veh->getVehicleType().getLength();
264 lane->releaseVehicles();
313 pred->rebuildAllowedTargets();
325 Edge::setEffort(
const std::string&
id,
double value,
double begTime,
double endTime) {
333 lane->setMaxSpeed(value);
350 const std::vector<MSLane*>& lanes = e->
getLanes();
351 shape = lanes.front()->getShape();
352 if (lanes.size() > 1) {
353 copy(lanes.back()->getShape().begin(), lanes.back()->getShape().end(), back_inserter(shape));
358 std::shared_ptr<VariableWrapper>
static int getLastStepHaltingNumber(const std::string &id)
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
static MSEdge * getEdge(const std::string &id)
static SubscriptionResults mySubscriptionResults
static double getElectricityConsumption(const std::string &id)
TRACI_CONST int LAST_STEP_VEHICLE_HALTING_NUMBER
static double getCO2Emission(const std::string &id)
static const std::vector< std::string > getLastStepPersonIDs(const std::string &id)
static void adaptTraveltime(const std::string &id, double value, double begTime=0., double endTime=std::numeric_limits< double >::max())
const std::string & getStreetName() const
Returns the street name of the edge.
Representation of a lane in the micro simulation.
static double getLastStepOccupancy(const std::string &id)
virtual bool wrapString(const std::string &objID, const int variable, const std::string &value)=0
static void setParameter(const std::string &id, const std::string &name, const std::string &value)
TRACI_CONST int VAR_FUELCONSUMPTION
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's persons sorted by pos.
static void setAllowedSVCPermissions(const std::string &id, int permissions)
static void setMaxSpeed(const std::string &id, double value)
TRACI_CONST int VAR_WAITING_TIME
std::vector< MSVehicle * > VehCont
Container for vehicles.
static LIBSUMO_SUBSCRIPTION_API void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
TRACI_CONST int VAR_COEMISSION
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
TRACI_CONST int LAST_STEP_VEHICLE_ID_LIST
static double getHCEmission(const std::string &id)
TRACI_CONST int VAR_NOISEEMISSION
static double getLastStepLength(const std::string &id)
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.
static int getLastStepVehicleNumber(const std::string &id)
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
static std::vector< std::string > getIDList()
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
TRACI_CONST int VAR_NOXEMISSION
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
TRACI_CONST int VAR_CURRENT_TRAVELTIME
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
static double getTraveltime(const std::string &id)
static const long CHANGE_PERMISSIONS_PERMANENT
double getMeanSpeed() const
get the mean speed
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
static std::string getParameter(const std::string &id, const std::string ¶mName)
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
static void setAllowedVehicleClasses(const std::string &id, std::vector< std::string > vector)
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 double getWaitingTime(const std::string &id)
static double getNOxEmission(const std::string &id)
TRACI_CONST int VAR_PMXEMISSION
static void setDisallowedVehicleClasses(const std::string &id, std::vector< std::string > classes)
TRACI_CONST int TRACI_ID_LIST
A road/street connecting two junctions.
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
static void setEffort(const std::string &id, double value, double begTime=0., double endTime=std::numeric_limits< double >::max())
static double getFuelConsumption(const std::string &id)
static std::string getStreetName(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_CO2EMISSION
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static std::shared_ptr< VariableWrapper > makeWrapper()
TRACI_CONST int LAST_STEP_PERSON_ID_LIST
TRACI_CONST int LAST_STEP_MEAN_SPEED
static double getAdaptedTraveltime(const std::string &id, double time)
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
static ContextSubscriptionResults myContextSubscriptionResults
bool noVehicles(SVCPermissions permissions)
Returns whether an edge with the given permission forbids vehicles.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
static double getNoiseEmission(const std::string &id)
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
TRACI_CONST int VAR_ELECTRICITYCONSUMPTION
static int getLaneNumber(const std::string &id)
TRACI_CONST int VAR_HCEMISSION
static double getLastStepMeanSpeed(const std::string &id)
TRACI_CONST int LAST_STEP_VEHICLE_NUMBER
TRACI_CONST int LAST_STEP_OCCUPANCY
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
static double getCOEmission(const std::string &id)
TRACI_CONST int VAR_LANE_INDEX
TRACI_CONST int LAST_STEP_LENGTH
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
static double getPMxEmission(const std::string &id)
void rebuildAllowedLanes()
static double getEffort(const std::string &id, double time)
static double sum(double val)
Computes the resulting noise.
static const std::vector< std::string > getLastStepVehicleIDs(const std::string &id)
const MSEdgeVector & getPredecessors() const