-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Task Summary
DriverModel_RealSim.cpp and DriverModel_RealSim_v2021.cpp are nearly identical (~1887 and ~1922 lines respectively) with only minor API-level differences. Extract the shared logic into a common base to eliminate code duplication.
Why is this needed?
Currently any bug fix or feature must be applied to both files independently. The two files differ in only ~50 lines out of ~1900 (less than 3%), primarily:
longvsinttype for VISSIM API parameters (v2021 API usesint)- A few global flags added to v2021:
SUB_EGO_ONLY,ENABLE_WARMUP,isInitialTimeFinished - Variable name
simTimevssimTime_g - Default value of
NEED_SPEED_LIMIT(true vs false)
The remaining ~97% of code (message handling, socket communication, data processing, FIXS integration) is identical. Multiple // TODO: add code stubs appear in the same locations in both files.
Scope of Work
1. Analyze and document all differences
- Run a full diff and categorize every difference
- Document API-level differences (VISSIM 2022+ vs 2021 driver model API)
2. Extract shared logic
Option A: Single shared header DriverModel_FIXS_Common.h with inline implementation
Option B: Shared DriverModel_FIXS_Common.cpp compiled into both projects via shared source
3. Create thin version-specific wrappers
DriverModel_RealSim.cpp→ thin wrapper using modern VISSIM API (longparameters)DriverModel_RealSim_v2021.cpp→ thin wrapper using legacy VISSIM API (intparameters)- Both include/link to shared common implementation
4. Resolve TODO stubs
- The
// TODO: add codestubs (at least 8 locations in each file) represent unimplemented message field handlers - Document what each TODO means and either implement or remove with a proper issue reference
5. Add Python auto-test
- Add
tests/Python/test_vissim_driver_parity.pythat:- Parses both
.cppfiles - Verifies that non-API-signature sections are identical (or differ only in known documented ways)
- Alerts if one file has a change that wasn't applied to the other
- Parses both
Files Involved
ProprietaryFiles/VISSIMserver/DriverModel_RealSim/DriverModel_RealSim.cppProprietaryFiles/VISSIMserver/DriverModel_RealSim_v2021/DriverModel_RealSim_v2021.cppProprietaryFiles/VISSIMserver/VISSIMserver.sln- Build scripts in
scripts/dispatch/3_vissim_components.bat
Acceptance Criteria
- Shared common code extracted and not duplicated
- Both DLLs still build and function correctly
-
tests/Python/test_vissim_driver_parity.pypasses - All TODO stubs addressed or converted to tracked issues
- Diff between the two wrapper files is ≤ 100 lines
Branch and PR Target
- All PRs for this issue should target the
devbranch (notmain) - First ensure
mainis merged intodevbefore starting work