50 #ifdef CHECK_MEMORY_LEAKS
52 #endif // CHECK_MEMORY_LEAKS
67 const std::string& aXMLFilename,
68 const std::string& outputFilename,
73 myEdgeMeanData(0, myEdge->getLength(), false),
74 myOutput(0), myFrequency(freq), myRemoved(0),
75 myInserted(0), myClearedInJam(0),
76 mySpeedIsDefault(true), myDidSpeedAdaption(false), myDidInit(false),
77 myDefaultSpeed(myEdge->getSpeedLimit()),
78 myHaveWarnedAboutClearingJam(false) {
79 if (outputFilename !=
"") {
83 if (aXMLFilename !=
"") {
147 if (state.
begin < lastEnd) {
148 WRITE_ERROR(
"Overlapping or unsorted intervals in calibrator '" +
myID +
"'.");
165 WRITE_ERROR(
"Mandatory attribute missing in definition of calibrator '" +
myID +
"'.");
167 WRITE_ERROR(
"Non-numeric value for numeric attribute in definition of calibrator '" +
myID +
"'.");
169 if (state.
q < 0 && state.
v < 0) {
170 WRITE_ERROR(
"Either 'vehsPerHour' or 'speed' has to be given in flow definition of calibrator '" +
myID +
"'.");
206 "\" id=\"" <<
myID <<
207 "\" nVehContrib=\"" << p <<
208 "\" removed=\"" << myRemoved <<
211 "\" flow=\"" << p * 3600.0 / durationSeconds <<
288 #ifdef MSCalibrator_DEBUG
291 <<
" totalWished=" << totalWishedNum
292 <<
" adapted=" << adaptedNum
312 }
else if (calibrateFlow && adaptedNum < totalWishedNum) {
320 const int insertionSlack =
MAX2(0, adaptedNum + relaxedInsertion - totalWishedNum);
322 #ifdef MSCalibrator_DEBUG
324 <<
" wished:" << wishedNum
325 <<
" slack:" << insertionSlack
326 <<
" before:" << adaptedNum
329 while (wishedNum > adaptedNum + insertionSlack) {
333 while (route == 0 && st.
hasNext()) {
344 const unsigned int routeIndex = (
unsigned int)std::distance(route->
begin(),
347 assert(route != 0 && vtype != 0);
351 newPars->
depart = currentTime;
354 newPars, route, vtype));
355 #ifdef MSCalibrator_DEBUG
356 std::cout <<
" resetting route pos: " << routeIndex <<
"\n";
362 throw ProcessError(
"Emission of vehicle '" + vehicle->
getID() +
"' in calibrator '" +
getID() +
"'failed!");
366 #ifdef MSCalibrator_DEBUG
371 #ifdef MSCalibrator_DEBUG
398 for (
int i = 0; i < numLanes; ++i) {
407 unsigned int vehiclesOnEdge = 0;
409 if (lane->getVehicleNumber() < 4) {
424 for (
int i = 0; i < numLanes; ++i) {
431 MSVehicle* last = lane->getLastVehicle();
459 for (std::vector<MSMeanData_Net::MSLaneMeanDataValues*>::iterator it =
myLaneMeanData.begin();
475 if (calibrateFlow && adaptedNum > totalWishedNum) {
476 #ifdef MSCalibrator_DEBUG
477 std::cout <<
" vaporizing " << vehicle->
getID() <<
" to reduce flow\n";
482 #ifdef MSCalibrator_DEBUG
483 std::cout <<
" vaporizing " << vehicle->
getID() <<
" to clear jam\n";