Fix false "incomplete entity data" warning on time-varying populations - #16
Closed
chraibi wants to merge 1 commit into
Closed
Fix false "incomplete entity data" warning on time-varying populations#16chraibi wants to merge 1 commit into
chraibi wants to merge 1 commit into
Conversation
RunHdf5SimDataGatheringLoop compared the peak per-timestep entity count against MaxAgents and reported missing data when it was lower: Incomplete entity data: HDF5: peak entity count 386 < MaxAgents 493. Some entities may be missing. Those two numbers measure different things. MaxAgents comes from ConvertJuelichToMobiusFormat as the count of distinct entity IDs across the whole run, while the peak is the busiest single timestep. They are only equal when every agent is present for the entire simulation, so the check fires on any dataset where agents enter and leave. For the file above all 493 entities are present in the data; the busiest frame simply holds 386 of them, and no agent spans the full run. Replace the comparison with one that measures the intended property: count the distinct entity indices that actually have samples and report how many have none. That still catches genuinely truncated data without misfiring on normal pedestrian flow.
There was a problem hiding this comment.
Pull request overview
This PR fixes a false user-facing “Incomplete entity data” warning when loading HDF5 simulations with time-varying populations (agents entering/leaving over time). It replaces an incorrect comparison of peak concurrent agents vs. total distinct entities with a coverage check that verifies each declared entity appears in at least one sample.
Changes:
- Removed the
PeakEntityCountcomputation based on per-timestep sample counts. - Added an “entity coverage” check that tracks which entity IDs appear across all samples using a
TBitArray. - Updated the warning message to report how many declared entities have zero samples.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Collaborator
Author
|
Superseded by #18 — same false 'incomplete entity data' warning, cleaner fix (tracks which entity IDs ever appear instead of comparing peak concurrent count). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Loading a normal pedestrian dataset raises a user-facing error popup claiming data is missing, when nothing is missing:
Cause
The check compares two quantities that measure different things:
MaxAgentscomes fromConvertJuelichToMobiusFormatasSortedIds.Num()— distinct entity IDs across the whole run.PeakEntityCountis the maximum entries inNumOfAgentsPerTimeStep— agents in the busiest single timestep.These are equal only if every agent is present for the entire simulation. In any dataset where agents enter and leave, the peak concurrent count is legitimately lower than the total, and the warning fires.
Verified against the file above by reading the HDF5 directly:
All 493 entities are present in the data. Not one of them spans the full run, so the condition is guaranteed to trigger. It would stay quiet only on a synthetic file where the population never changes.
The spawn path is unaffected —
SpawnMaxPedestriansusesGetMaxAgents(), so 493 MASS entities are created and the ones without samples at a given timestep simply do not render. This is a spurious warning, not a sizing bug.Change
Measure the property the check was actually after: how many declared entities have no samples at all.
That still catches genuinely truncated data — an entity declared in metadata but absent from every timestep — while staying quiet on normal pedestrian flow.
PeakEntityCountand its loop are removed as they now have no other use.One pass over
Hdf5Data.Sampleswith aTBitArraysized toMaxAgents; negligible against the 1.4M samples already being iterated in this function.The neighbouring timestep-truncation check is left untouched — it compares like with like and is correct as written.
Verification
macOS, UE 5.5.4. Compiles clean; the warning no longer fires for the dataset above, whose 493 entities all have samples.