Skip to content

PP5: add AiMTT traffic example (route choice with road works) - #314

Merged
wmkouw merged 1 commit into
bmlip:mainfrom
bvdmitri:pp5-aimtt-traffic-example
Nov 4, 2026
Merged

wmkouw merged 1 commit into
bmlip:mainfrom
bvdmitri:pp5-aimtt-traffic-example

Conversation

@bvdmitri

@bvdmitri bvdmitri commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Adds a short section "Real world example: active inference in traffic and mobility" to PP5, after the Summary and before the Appendix, as discussed. It is a single-commuter version of the route-choice experiment from the AiMTT project (IWAI 2026), built with the same tools as the rewired robot.

The example

  • Routes: a commuter chooses daily between route A (motorway, 22 min) and route B (secondary road, 32 min) for 120 days.
  • What the commuter knows: neither travel time at the start, and each day only the time of the route they drove.
  • The change: road works on A (45 min) on days 31–70.
  • Model: a small RxInfer filter, commute_learning. Travel times may drift from day to day (σ_drift), and the route that wasn't driven is passed as missing, so its uncertainty grows while it isn't visited.
  • Route choice: the same objectives as the rewired robot. Decision-theoretic is J = E[-log p̂(y)]; active inference is G = J - H[q(y|r)].
  • Outcome with the defaults: both commuters switch to B within a few days of the road works starting. The decision-theoretic commuter never returns to A, the same turn-off effect as the robot but triggered mid-run, and loses 526 extra minutes. The active inference commuter returns about a week after the road works end, because its growing uncertainty about A makes a check worthwhile, and loses 269 minutes.
  • Two exercises with hidden solutions:
    • A world that never changes (σ_drift = 0): the static model is slow to detect the road works, never detects that they ended, and loses almost twice as much time.
    • Strict commuters (goal width 10): curiosity can't outweigh the stale memory of a slow route A. This links back to "When does curiosity stop?".
  • Closing paragraph: relates the example to the 2000-traveller population in the AiMTT experiments and links to aimtt.nl and biaslab.github.io/aim-tt.

Notes

  • No new packages; the embedded Project/Manifest is unchanged.
  • All new globals use the commute_*, route_* and tt_* prefixes to avoid clashes. The example reuses entropy_gaussian from Part 2.
  • Tested headless with Pluto on Julia 1.12.7 and 1.13.3: no errored cells.

🤖 Generated with Claude Code

Add a "Real world example: active inference in traffic and mobility"
section after the Summary. A single commuter chooses between two routes
every day, learns the travel times with a small RxInfer filter (the
route not driven is passed as `missing`), and has to adapt when road
works hit the motorway for 40 days. The decision-theoretic commuter
gets locked onto the detour after the road works, while the active
inference commuter returns because its growing uncertainty about the
motorway makes checking it worthwhile.

Includes two exercises (static model with zero drift, strict goal
prior) with hidden solutions, and links to the AiMTT programme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bvdmitri
bvdmitri requested a review from wmkouw November 4, 2026 14:50
@wmkouw

wmkouw commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Really cool work, Dmitry. This is an exciting notebook. Can't wait to show it to the students.

@wmkouw
wmkouw merged commit a28c5f5 into bmlip:main Nov 4, 2026
1 check passed
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.

2 participants