48 #ifdef CHECK_MEMORY_LEAKS
50 #endif // CHECK_MEMORY_LEAKS
79 std::vector<std::string> ids;
84 std::vector<std::string> ids;
102 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingTravelTime(e, 0, time, value)) {
117 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingEffort(e, 0, time, value)) {
130 const std::vector<MSLane*>& lanes = e->
getLanes();
131 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
132 wtime += (*i)->getWaitingSeconds();
139 std::vector<std::string> vehIDs;
140 const std::vector<MSLane*>& lanes = e->
getLanes();
141 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
143 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
144 vehIDs.push_back((*j)->getID());
146 (*i)->releaseVehicles();
154 const std::vector<MSLane*>& lanes = e->
getLanes();
155 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
156 sum += (*i)->getHBEFA_CO2Emissions();
164 const std::vector<MSLane*>& lanes = e->
getLanes();
165 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
166 sum += (*i)->getHBEFA_COEmissions();
174 const std::vector<MSLane*>& lanes = e->
getLanes();
175 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
176 sum += (*i)->getHBEFA_HCEmissions();
184 const std::vector<MSLane*>& lanes = e->
getLanes();
185 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
186 sum += (*i)->getHBEFA_PMxEmissions();
194 const std::vector<MSLane*>& lanes = e->
getLanes();
195 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
196 sum += (*i)->getHBEFA_NOxEmissions();
204 const std::vector<MSLane*>& lanes = e->
getLanes();
205 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
206 sum += (*i)->getHBEFA_FuelConsumption();
214 const std::vector<MSLane*>& lanes = e->
getLanes();
215 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
216 sum += (
SUMOReal) pow(10., ((*i)->getHarmonoise_NoiseEmissions() / 10.));
228 const std::vector<MSLane*>& lanes = e->
getLanes();
229 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
230 sum += (*i)->getVehicleNumber();
238 const std::vector<MSLane*>& lanes = e->
getLanes();
239 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
240 sum += (*i)->getMeanSpeed();
248 const std::vector<MSLane*>& lanes = e->
getLanes();
249 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
250 sum += (*i)->getNettoOccupancy();
258 const std::vector<MSLane*>& lanes = e->
getLanes();
259 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
261 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
266 (*i)->releaseVehicles();
275 const std::vector<MSLane*>& lanes = e->
getLanes();
276 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
278 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
279 lengthSum += (*j)->getVehicleType().getLength();
281 noVehicles += (
int) vehs.size();
282 (*i)->releaseVehicles();
285 if (noVehicles == 0) {
305 std::string warning =
"";
321 std::vector<std::string> classes;
326 const std::vector<MSLane*>& lanes = e->
getLanes();
327 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
328 (*i)->setPermissions(permissions);
335 std::vector<std::string> classes;
340 const std::vector<MSLane*>& lanes = e->
getLanes();
341 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
342 (*i)->setPermissions(permissions);
352 int parameterCount = inputStorage.
readInt();
353 if (parameterCount == 3) {
367 }
else if (parameterCount == 1) {
384 int parameterCount = inputStorage.
readInt();
385 if (parameterCount == 3) {
399 }
else if (parameterCount == 1) {
417 const std::vector<MSLane*>& lanes = e->
getLanes();
418 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
419 (*i)->setMaxSpeed(value);
437 const std::vector<MSLane*>& lanes = e->
getLanes();
438 shape.
push_back(lanes.front()->getShape());
439 if (lanes.size() > 1) {
440 shape.
push_back(lanes.back()->getShape().reverse());
#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.
SUMOReal getCurrentTravelTime(const SUMOReal minSpeed=0.00001) const
Computes and returns the current travel time for this edge.
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 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
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. ...
TraCI server used to control sumo by a remote TraCI client.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
#define LAST_STEP_VEHICLE_NUMBER
#define VAR_EDGE_TRAVELTIME
void push_back(const PositionVector &p)
Appends all positions from the given vector.
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
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)
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)
#define LAST_STEP_VEHICLE_HALTING_NUMBER
#define RESPONSE_GET_EDGE_VARIABLE
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.