40 #ifdef CHECK_MEMORY_LEAKS
42 #endif // CHECK_MEMORY_LEAKS
54 myCollector(collector), myPosition(crossSection.myPosition) {}
60 if (newPos < myPosition) {
63 if (newPos >= myPosition && oldPos <= myPosition) {
66 if (myPosition > oldPos) {
67 entryTime += (myPosition - oldPos) / newSpeed;
70 myCollector.enter(veh, entryTime);
72 return myCollector.myEnteredContainer.find(&veh) != myCollector.myEnteredContainer.end();
79 myCollector.myEnteredContainer.erase(&veh);
82 return myCollector.myEnteredContainer.find(&veh) != myCollector.myEnteredContainer.end();
92 myCollector(collector), myPosition(crossSection.myPosition) {}
98 if (newPos <= myPosition) {
102 if (oldPos > myPosition) {
108 if (myPosition > oldPos) {
109 leaveTime += (myPosition - oldPos) / newSpeed;
111 myCollector.leave(veh, leaveTime);
190 SUMOReal leaveTimestepFraction = leaveTimestep - (
SUMOReal)((
int) leaveTimestep);
191 leaveTimestepFraction = fmod(leaveTimestep * 1000., 1000.) / (
SUMOReal)
DELTA_T;
214 dev <<
" <interval begin=\"" <<
time2string(startTime) <<
"\" end=\"" <<
time2string(stopTime) <<
"\" " <<
"id=\"" <<
myID <<
"\" ";
221 meanHaltsPerVehicle += (
SUMOReal)(*i).second.haltings;
222 SUMOReal steps = (*i).second.leaveTime - (*i).second.entryTime;
223 meanTravelTime += steps;
224 meanSpeed += ((*i).second.speedSum / steps);
226 meanTravelTime = vehicleSum != 0 ? meanTravelTime / (
SUMOReal) vehicleSum : -1;
227 meanSpeed = vehicleSum != 0 ? meanSpeed / (
SUMOReal) vehicleSum : -1;
228 meanHaltsPerVehicle = vehicleSum != 0 ? meanHaltsPerVehicle / (
SUMOReal) vehicleSum : -1;
236 SUMOReal meanHaltsPerVehicleWithin = 0.;
237 SUMOReal meanIntervalSpeedWithin = 0.;
238 SUMOReal meanIntervalHaltsPerVehicleWithin = 0.;
239 SUMOReal meanIntervalDurationWithin = 0.;
241 meanHaltsPerVehicleWithin += (
SUMOReal)(*i).second.haltings;
242 meanIntervalHaltsPerVehicleWithin += (
SUMOReal)(*i).second.intervalHaltings;
246 meanSpeedWithin += ((*i).second.speedSum / time);
247 meanIntervalSpeedWithin += ((*i).second.intervalSpeedSum / timeWithin);
248 meanDurationWithin += time;
249 meanIntervalDurationWithin += timeWithin;
251 (*i).second.intervalHaltings = 0;
252 (*i).second.intervalSpeedSum = 0;
255 meanSpeedWithin = vehicleSumWithin != 0 ? meanSpeedWithin / (
SUMOReal) vehicleSumWithin : -1;
256 meanHaltsPerVehicleWithin = vehicleSumWithin != 0 ? meanHaltsPerVehicleWithin / (
SUMOReal) vehicleSumWithin : -1;
257 meanDurationWithin = vehicleSumWithin != 0 ? meanDurationWithin / (
SUMOReal) vehicleSumWithin : -1;
258 meanIntervalSpeedWithin = vehicleSumWithin != 0 ? meanIntervalSpeedWithin / (
SUMOReal) vehicleSumWithin : -1;
259 meanIntervalHaltsPerVehicleWithin = vehicleSumWithin != 0 ? meanIntervalHaltsPerVehicleWithin / (
SUMOReal) vehicleSumWithin : -1;
260 meanIntervalDurationWithin = vehicleSumWithin != 0 ? meanIntervalDurationWithin / (
SUMOReal) vehicleSumWithin : -1;
263 dev <<
"meanTravelTime=\"" << meanTravelTime
264 <<
"\" meanSpeed=\"" << meanSpeed
265 <<
"\" meanHaltsPerVehicle=\"" << meanHaltsPerVehicle
266 <<
"\" vehicleSum=\"" << vehicleSum
267 <<
"\" meanSpeedWithin=\"" << meanSpeedWithin
268 <<
"\" meanHaltsPerVehicleWithin=\"" << meanHaltsPerVehicleWithin
269 <<
"\" meanDurationWithin=\"" << meanDurationWithin
270 <<
"\" vehicleSumWithin=\"" << vehicleSumWithin
271 <<
"\" meanIntervalSpeedWithin=\"" << meanIntervalSpeedWithin
272 <<
"\" meanIntervalHaltsPerVehicleWithin=\"" << meanIntervalHaltsPerVehicleWithin
273 <<
"\" meanIntervalDurationWithin=\"" << meanIntervalDurationWithin
331 ret += (*pair).first->getSpeed();
349 std::vector<std::string>
351 std::vector<std::string> ret;
353 ret.push_back((*pair).first->getID());
355 std::sort(ret.begin(), ret.end());