Skip to content

typesafe-jev-traffic-demo

Simulation where Jev picks which of two conflicting signal phases gets green at a real Hong Kong junction from live open sensor data.

Serviceprototype

Overview

Jev at the Junction is a local proof of concept using real Hong Kong open data. It polls a free, keyless near real-time feed for speed, occupancy and volume at four sensors on two sides of a conflicting junction (Kwun Tong Bypass and Kai Fuk Road). About every 30 seconds it asks Jev five questions: how congested each side is, which needs priority, whether the gap between them is large enough to act on, and how reliable the data looks.

A phase-timing state machine with minimum and maximum green, amber and all-red clearance enforces safety-critical timing around Jev's proposal, and the minimum-green wait adapts when one side is clearly worse. A dashboard shows the live decision, a plain-English readout and controls to inject traffic or trigger emergency preemption. It is explicitly a simulation and cannot control real signals.

What the decision model decides

TypeQuestionAnswers
ScoreHow congested is each side of the junction?—
ChoiceWhich side needs priority?north-south · east-west
Yes / noIs the gap between the two sides large enough to act on?yes · no
ScoreHow reliable does the sensor data look?—

How it works

  1. Poll four open-data traffic sensors.
  2. Every ~30 s ask Jev five questions.
  3. The state machine applies safe phase timing around Jev's proposal.
  4. Dashboard shows decisions; manual controls inject traffic or preemption.

Strengths

  • Uses real open traffic data.
  • Safety timing enforced in code, not by the model.
  • Adaptive minimum green based on Jev's judgments.

Caveats

  • Simulation only; no control of real signals.
  • Requires a Jev API key.

Getting started

pip install -r requirements.txt, set JEV_API_KEY in .env, python junction.py, then open http://localhost:8790

At a glance

Type
Service
Status
prototype
Language
Python
Runtime
local service + dashboard
Has code
yes

Use cases and integrations

How curated lists describe it

  • This is a \*\*simulation\*\*. It is not connected to, and cannot control, any real traffic signal — Hong Kong's Transport Department publishes no write API for that, only a read-only feed of sensor data. Everything downstream of that feed (the phase timing, the amber/all-red clearance, the safety limits) runs entirely in this process's own memory.

    logicrw/awesome-jev-projects

Frequently asked questions

Does it control real traffic lights?

No, it is a simulation using a read-only data feed.

What does Jev decide?

Congestion per side, which side gets priority, whether to act, and data reliability.

Who enforces safety?

A phase-timing state machine in code.

Related projects

  • Three.js box steered by plain-language instructions: an LLM plans steps, Jev decides move, turn and jump in real time.

    ProjectprototypeTypeScript
  • Three.js driving simulator with a fast reflex layer, a TTC safety brake and an optional Jev API strategy layer.

    ProjectprototypeJavaScript
  • Three.js driving simulator where Jev picks among locally sampled steering-and-speed paths while code handles geometry and safety.

    ProjectprototypeTypeScript
  • Traffic signal controller where Jev picks each intersection's next phase from a SUMO snapshot, with local fallbacks.

    ProjectresearchPython
  • Fixed-wing landing simulator and benchmark where Jev maps four Choice decisions to aircraft controls against humans, baselines and LLMs.

    DemoprototypePython
  • Simulated Franka arm that follows plain-English goals by having Jev chain about 30 hardcoded motion primitives, one per step.

    Agent skillprototypePython