49 #ifdef CHECK_MEMORY_LEAKS
51 #endif // CHECK_MEMORY_LEAKS
80 std::vector<std::string> ids;
85 std::vector<std::string> ids;
103 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingTravelTime(e, time, value)) {
118 if (!
MSNet::getInstance()->getWeightsStorage().retrieveExistingEffort(e, time, value)) {
131 const std::vector<MSLane*>& lanes = e->
getLanes();
132 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
133 wtime += (*i)->getWaitingSeconds();
140 std::vector<std::string> vehIDs;
141 const std::vector<MSLane*>& lanes = e->
getLanes();
142 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
144 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
145 vehIDs.push_back((*j)->getID());
147 (*i)->releaseVehicles();
155 const std::vector<MSLane*>& lanes = e->
getLanes();
156 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
157 sum += (*i)->getCO2Emissions();
165 const std::vector<MSLane*>& lanes = e->
getLanes();
166 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
167 sum += (*i)->getCOEmissions();
175 const std::vector<MSLane*>& lanes = e->
getLanes();
176 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
177 sum += (*i)->getHCEmissions();
185 const std::vector<MSLane*>& lanes = e->
getLanes();
186 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
187 sum += (*i)->getPMxEmissions();
195 const std::vector<MSLane*>& lanes = e->
getLanes();
196 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
197 sum += (*i)->getNOxEmissions();
205 const std::vector<MSLane*>& lanes = e->
getLanes();
206 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
207 sum += (*i)->getFuelConsumption();
215 const std::vector<MSLane*>& lanes = e->
getLanes();
216 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
217 sum += (
SUMOReal) pow(10., ((*i)->getHarmonoise_NoiseEmissions() / 10.));
229 const std::vector<MSLane*>& lanes = e->
getLanes();
230 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
231 sum += (*i)->getVehicleNumber();
239 const std::vector<MSLane*>& lanes = e->
getLanes();
240 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
241 sum += (*i)->getMeanSpeed();
249 const std::vector<MSLane*>& lanes = e->
getLanes();
250 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
251 sum += (*i)->getNettoOccupancy();
259 const std::vector<MSLane*>& lanes = e->
getLanes();
260 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
262 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
267 (*i)->releaseVehicles();
276 const std::vector<MSLane*>& lanes = e->
getLanes();
277 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
279 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
280 lengthSum += (*j)->getVehicleType().getLength();
282 noVehicles += (
int) vehs.size();
283 (*i)->releaseVehicles();
286 if (noVehicles == 0) {
306 std::string warning =
"";
322 std::vector<std::string> classes;
327 const std::vector<MSLane*>& lanes = e->
getLanes();
328 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
329 (*i)->setPermissions(permissions);
336 std::vector<std::string> classes;
341 const std::vector<MSLane*>& lanes = e->
getLanes();
342 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
343 (*i)->setPermissions(permissions);
353 int parameterCount = inputStorage.
readInt();
354 if (parameterCount == 3) {
368 }
else if (parameterCount == 1) {
385 int parameterCount = inputStorage.
readInt();
386 if (parameterCount == 3) {
400 }
else if (parameterCount == 1) {
418 const std::vector<MSLane*>& lanes = e->
getLanes();
419 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
420 (*i)->setMaxSpeed(value);
438 const std::vector<MSLane*>& lanes = e->
getLanes();
439 shape.
push_back(lanes.front()->getShape());
440 if (lanes.size() > 1) {
441 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 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
#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.