Changeset 860 for applications/doprava/aimsun_bdm
- Timestamp:
- 03/08/10 19:17:16 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/doprava/aimsun_bdm/aimsun_ds.cpp
r855 r860 22 22 const TCHAR * ControllerList[NUM_CONTROLLERS] = { TEXT("K_5_495"), TEXT("K_5_601") }; 23 23 const TCHAR * WindowStr[NUM_CONTROLLERS] = { TEXT("els3@5.495"), TEXT("els3@5.601") }; 24 const int IntersectionIDs[] = { 495, 601 }; 25 const int NumIntersections = sizeof ( IntersectionIDs ); 24 26 25 27 /* Entrance sections are hardwired for Aimsun scenario `zlicin_495_601.sce` */ … … 43 45 values of all measurements for all intersections in the system). */ 44 46 const int SignalPlanOffsets[] = { 0, 36 }; 45 const int IntensityOffsets[] = { 6, 42 }; 46 const int OccupancyOffsets[] = { 21, 60 }; 47 const int MeasurementOffsets[] = { 6, 42 }; 47 48 48 49 AimsunDS::AimsunDS() : DS() … … 73 74 StringCbCopy ( szBasePath, MAX_PATH_BYTES, BASE_PATH ); 74 75 75 /* Create the path to DLL directory. 76 /* Create the path to DLL directory. The path is defined externally 77 in "CMakeLists.txt". 76 78 The path will be used to inject the appropriate location of 77 79 Getram extensions into the selected Aimsun scenario and also 78 80 to modify PATH variable of executed processes in order to 79 81 provide access to API DLLs. */ 80 StringCbCopy ( szDllPath, MAX_PATH_BYTES, szBasePath ); 81 StringCbCat ( szDllPath, MAX_PATH_BYTES, TEXT("\\dlls") ); 82 StringCbCopy ( szDllPath, MAX_PATH_BYTES, DLL_PATH ); 82 83 83 84 /* Add the DLL directory to the PATH used by this process. … … 360 361 } 361 362 362 /* Loop over all measurement sets (currently we will deliver 363 just the last one, but this will surely change. */ 363 /* Loop over all controllers in the measurement set. */ 364 364 for ( int i = 0; i < p_rsp->count; i++) 365 365 { 366 det_stats * ds_ptr = p_rsp->dets + i;367 sp_stats * sp_ptr = p_rsp->sps + i;366 det_stats * ds_ptr = p_rsp->dets + i; 367 sp_stats * sp_ptr = p_rsp->sps + i; 368 368 369 369 printf ( "\tRealised signal plans:\n" ); 370 370 371 /* Loop over all intersections and fill in signal plan372 data. */371 /* Loop over all measurement sets. We will deliver just 372 the last one. */ 373 373 for ( int j = 0; j < sp_ptr->count ; j++ ) 374 374 { 375 375 sp_stattab * dat_ptr = sp_ptr->splans + j; 376 int offset = SignalPlanOffsets[j]; 376 int pos = _search_index ( IntersectionIDs, NumIntersections, dat_ptr->its_id ); 377 int offset = SignalPlanOffsets[pos]; 377 378 378 379 printf ( "\t[%3d] t=%6ds ", j, dat_ptr->global_time ); 379 380 381 /* Copy particular signals. */ 380 382 for ( int k = 0 ; k < dat_ptr->num_siggroups ; k++ ) 381 383 { … … 388 390 printf ( "\n\tDetector data:\n" ); 389 391 390 /* Loop over all intersections and fill in the391 detector measurements. */392 /* Loop over all mesurement records with intensities and 393 occupancies. */ 392 394 for ( int j = 0 ; j < ds_ptr->count ; j++ ) 393 395 { 394 396 det_aggreg_table * dat_ptr = ds_ptr->stats + j; 395 int ioffset = IntensityOffsets[j];396 int ooffset = OccupancyOffsets[j];397 int pos = _search_index ( IntersectionIDs, NumIntersections, dat_ptr->its_id ); 398 int moffset = MeasurementOffsets[pos]; 397 399 398 400 printf ( "\t[%3d] t=%6ds ", j, dat_ptr->global_time ); … … 400 402 for ( int k = 0 ; k < dat_ptr->num_det ; k++ ) 401 403 { 402 dt[ k+ioffset]= dat_ptr->dt_intensity[k];403 dt[ k+ooffset] = dat_ptr->dt_occupancy[k];404 dt[2*k+moffset] = dat_ptr->dt_intensity[k]; 405 dt[2*k+moffset+1] = dat_ptr->dt_occupancy[k]; 404 406 printf ( "{%2d/%2d} ", 405 407 dat_ptr->dt_intensity[k], dat_ptr->dt_occupancy[k] ); … … 408 410 } 409 411 } 412 410 413 printf ( "\tAimsunDS::getdata() finished\n" ); 414 cout << dt ; 411 415 } 412 416