50 #ifdef CHECK_MEMORY_LEAKS 52 #endif // CHECK_MEMORY_LEAKS 82 std::vector<std::string> ids;
87 std::vector<std::string> ids;
105 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingTravelTime(e, time, value)) {
120 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingEffort(e, time, value)) {
133 const std::vector<MSLane*>& lanes = e->
getLanes();
134 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
135 wtime += (*i)->getWaitingSeconds();
142 std::vector<std::string> personIDs;
144 for (std::vector<MSTransportable*>::iterator it = persons.begin(); it != persons.end(); ++it) {
145 personIDs.push_back((*it)->getID());
152 std::vector<std::string> vehIDs;
153 const std::vector<MSLane*>& lanes = e->
getLanes();
154 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
156 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
157 vehIDs.push_back((*j)->getID());
159 (*i)->releaseVehicles();
167 const std::vector<MSLane*>& lanes = e->
getLanes();
168 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
169 sum += (*i)->getCO2Emissions();
177 const std::vector<MSLane*>& lanes = e->
getLanes();
178 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
179 sum += (*i)->getCOEmissions();
187 const std::vector<MSLane*>& lanes = e->
getLanes();
188 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
189 sum += (*i)->getHCEmissions();
197 const std::vector<MSLane*>& lanes = e->
getLanes();
198 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
199 sum += (*i)->getPMxEmissions();
207 const std::vector<MSLane*>& lanes = e->
getLanes();
208 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
209 sum += (*i)->getNOxEmissions();
217 const std::vector<MSLane*>& lanes = e->
getLanes();
218 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
219 sum += (*i)->getFuelConsumption();
227 const std::vector<MSLane*>& lanes = e->
getLanes();
228 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
229 sum += (
SUMOReal) pow(10., ((*i)->getHarmonoise_NoiseEmissions() / 10.));
241 const std::vector<MSLane*>& lanes = e->
getLanes();
242 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
243 sum += (*i)->getVehicleNumber();
251 const std::vector<MSLane*>& lanes = e->
getLanes();
252 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
253 sum += (*i)->getMeanSpeed();
261 const std::vector<MSLane*>& lanes = e->
getLanes();
262 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
263 sum += (*i)->getNettoOccupancy();
271 const std::vector<MSLane*>& lanes = e->
getLanes();
272 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
274 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
279 (*i)->releaseVehicles();
288 const std::vector<MSLane*>& lanes = e->
getLanes();
289 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
291 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
292 lengthSum += (*j)->getVehicleType().getLength();
294 noVehicles += (int) vehs.size();
295 (*i)->releaseVehicles();
298 if (noVehicles == 0) {
306 std::string paramName =
"";
327 std::string warning =
"";
343 std::vector<std::string> classes;
348 const std::vector<MSLane*>& lanes = e->
getLanes();
349 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
350 (*i)->setPermissions(permissions);
357 std::vector<std::string> classes;
362 const std::vector<MSLane*>& lanes = e->
getLanes();
363 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
364 (*i)->setPermissions(permissions);
374 int parameterCount = inputStorage.
readInt();
375 if (parameterCount == 3) {
377 int begTime = 0, endTime = 0;
389 }
else if (parameterCount == 1) {
406 int parameterCount = inputStorage.
readInt();
407 if (parameterCount == 3) {
409 int begTime = 0, endTime = 0;
421 }
else if (parameterCount == 1) {
439 const std::vector<MSLane*>& lanes = e->
getLanes();
440 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
441 (*i)->setMaxSpeed(value);
476 const std::vector<MSLane*>& lanes = e->
getLanes();
477 shape = lanes.front()->getShape();
478 if (lanes.size() > 1) {
479 copy(lanes.back()->getShape().begin(), lanes.back()->getShape().end(), back_inserter(shape));
#define LAST_STEP_MEAN_SPEED
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
#define VAR_CURRENT_TRAVELTIME
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
std::vector< MSVehicle * > VehCont
Container for vehicles.
bool readTypeCheckingInt(tcpip::Storage &inputStorage, int &into)
Reads the value type and an int, verifying the type.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
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 bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xca: Change Edge State)
virtual void writeUnsignedByte(int)
#define CMD_SET_EDGE_VARIABLE
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
#define VAR_NOISEEMISSION
#define VAR_FUELCONSUMPTION
void addEffort(const MSEdge *const e, SUMOReal begin, SUMOReal end, SUMOReal value)
Adds an effort information for an edge and a time span.
virtual void writeInt(int)
virtual int readUnsignedByte()
void addTravelTime(const MSEdge *const e, SUMOReal begin, SUMOReal end, SUMOReal value)
Adds a travel time information for an edge and a time span.
A road/street connecting two junctions.
void rebuildAllowedLanes()
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
virtual void writeStringList(const std::vector< std::string > &s)
#define CMD_SET_VEHICLE_VARIABLE
virtual std::string readString()
#define CMD_GET_EDGE_VARIABLE
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
TraCI server used to control sumo by a remote TraCI client.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
#define LAST_STEP_VEHICLE_NUMBER
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
#define VAR_EDGE_TRAVELTIME
static bool getShape(const std::string &id, PositionVector &shape)
Returns the named edge's shape.
virtual void writeString(const std::string &s)
#define LAST_STEP_VEHICLE_ID_LIST
std::string toHex(const T i, std::streamsize numDigits=0)
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
static SUMOReal sum(SUMOReal val)
Computes the resulting noise.
virtual void writeDouble(double)
#define LAST_STEP_PERSON_ID_LIST
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
#define LAST_STEP_OCCUPANCY
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xaa: Get Edge Variable)
SUMOReal getCurrentTravelTime(const SUMOReal minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
#define LAST_STEP_VEHICLE_HALTING_NUMBER
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep) const
Returns this edge's persons sorted by pos.
#define RESPONSE_GET_EDGE_VARIABLE
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.