51 #ifdef CHECK_MEMORY_LEAKS
53 #endif // CHECK_MEMORY_LEAKS
60 SUMOReal positionInMeters,
bool splitByType) :
62 myPosition(positionInMeters), mySplitByType(splitByType),
63 myLastLeaveTime(
STEPS2TIME(
MSNet::getInstance()->getCurrentTimeStep())),
66 assert(
myPosition >= 0 && myPosition <= myLane->getLength());
160 for (std::vector< VehicleData >::const_iterator i = d.begin(); i != d.end(); ++i) {
162 timeOnDetDuringInterval =
MIN2(timeOnDetDuringInterval,
TS);
163 occupancy += timeOnDetDuringInterval;
172 return (
unsigned int) d.size();
176 std::vector<std::string>
179 std::vector<std::string> ret;
180 for (std::vector<VehicleData>::iterator i = d.begin(); i != d.end(); ++i) {
181 ret.push_back((*i).idM);
209 std::map<std::string, std::pair<VehicleDataCont, VehicleMap> > types;
212 if (types.find((*i).typeIDM) == types.end()) {
215 types[(*i).typeIDM].first.push_back(*i);
218 const std::string& type = (*i).first->getVehicleType().getID();
219 if (types.find(type) == types.end()) {
222 types[type].second[(*i).first] = (*i).second;
225 for (std::map<std::string, std::pair<VehicleDataCont, VehicleMap> >::const_iterator i = types.begin(); i != types.end(); ++i) {
226 writeTypedXMLOutput(dev, startTime, stopTime, (*i).first, (*i).second.first, (*i).second.second);
229 dev <<
" </interval>\n";
240 unsigned nVehCrossed = (unsigned) vdc.size();
246 for (std::deque< VehicleData >::const_iterator i = vdc.begin(); i != vdc.end(); ++i) {
248 timeOnDetDuringInterval =
MIN2(timeOnDetDuringInterval, t);
249 occupancy += timeOnDetDuringInterval;
251 for (std::map< SUMOVehicle*, SUMOReal >::const_iterator i = vm.begin(); i != vm.end(); ++i) {
253 occupancy += timeOnDetDuringInterval;
255 occupancy = occupancy / t * (
SUMOReal) 100.;
256 SUMOReal meanSpeed = vdc.size() != 0
259 SUMOReal meanLength = vdc.size() != 0
263 dev <<
" <typedInterval type=\"" + type +
"\" ";
265 dev <<
" <interval ";
267 dev <<
"begin=\"" <<
time2string(startTime) <<
"\" end=\"" <<
269 dev <<
"nVehContrib=\"" << vdc.size() <<
"\" flow=\"" << flow <<
270 "\" occupancy=\"" << occupancy <<
"\" speed=\"" << meanSpeed <<
271 "\" length=\"" << meanLength <<
272 "\" nVehEntered=\"" << nVehCrossed <<
"\"";
288 SUMOReal entryTimestep = it->second;
290 assert(entryTimestep < leaveTimestep);
306 std::vector<MSInductLoop::VehicleData>
309 std::vector<VehicleData> ret;
311 if ((*i).leaveTimeM >= t) {
316 if ((*i).leaveTimeM >= t) {