Skip to content

Tighten YouBike eligibility rules - #1

Draft
imytuuu wants to merge 1 commit into
mainfrom
codex/tighten-youbike-eligibility
Draft

imytuuu wants to merge 1 commit into
mainfrom
codex/tighten-youbike-eligibility

Conversation

@imytuuu

@imytuuu imytuuu commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Cap YouBike eligibility at trips of 5 km or less.
  • Require an origin station to retain at least 15% of its dock capacity after a departure.
  • Apply the shared distance and inventory checks to commuter and visitor agents.
  • Preserve the visitor group-size limit of two riders.
  • Add boundary tests for long trips, low inventory, and multi-rider departures.

Why

The previous commuter rule considered YouBike available whenever a station had a single bike, regardless of trip distance or whether the departure would nearly empty the station. Visitor selection had the same distance gap and only checked that enough bikes existed for the group.

These stricter rules prevent the simulation from presenting YouBike as a reliable option for long trips or stations with fragile inventory.

Validation

  • python3 -m unittest tests.test_ubike tests.test_commuter tests.test_visitor -q — 32 tests passed.
  • git diff --check — passed.
  • python3 -m compileall -q simulation tests — passed.
  • Commuter and visitor demo commands completed successfully.

The full test discovery still requires the repository's optional FastAPI dependency and two external data fixtures that are not present in the checkout.

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