Skip to content

[Domain] model hazard detection delay before reaction#273

Open
SilverSupplier wants to merge 2 commits into
mainfrom
domain/hazard-detection-delay
Open

[Domain] model hazard detection delay before reaction#273
SilverSupplier wants to merge 2 commits into
mainfrom
domain/hazard-detection-delay

Conversation

@SilverSupplier
Copy link
Copy Markdown
Collaborator

Summary

  • Model a hazard detection delay distinct from the existing reaction delay (report section 4.3). An agent now senses a hazard on entering its range, detects it only after Agent::detectionDelaySeconds, and then becomes aware after reactionDelaySeconds.
  • The environment reaction state tracks when sensing began (hazardSensedSinceSeconds); with a zero detection delay the behavior is identical to before, so existing hazard tests are unaffected.
  • Populate detectionDelaySeconds per agent at spawn with a deterministic, seed-derived value (independent beta22 draw, so existing random draws are unchanged).
  • Add ScenarioEnvironmentHazardSystem_DelaysDetectionUntilDetectionDelayElapses covering sensed-but-not-detected and detected-then-aware.

Area

  • Engine
  • Domain
  • Application

Architecture Check

  • I kept the dependency direction application -> domain -> engine.
  • I did not add Qt UI code to src/domain.
  • I did not add domain or application dependencies to src/engine.
  • I used src/ as the include root.

Verification

  • cmake --preset windows-debug
  • cmake --build --preset build-debug
  • ctest --preset test-debug
  • Not run (reason below)

Ran the release / no-app equivalents: cmake --build --preset build-no-app-release, ctest --preset test-no-app-release -> 100% pass (includes the new detection-delay test). Full Qt app build (cmake --build --preset build-release --target safecrowd_app) also succeeds.

Risks / Follow-up

  • With a zero detection delay the detect/react pipeline is equivalent to the previous immediate-detection behavior, so existing hazard reaction tests keep passing.
  • reactionDelaySeconds remains unpopulated at spawn (a pre-existing condition); only detectionDelaySeconds is now seeded.

@SilverSupplier SilverSupplier requested a review from learncold as a code owner June 2, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant