Draft
Add Smart Traffic Light AI agents (Group 1 assignment)#66
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…tive HTML demo Co-authored-by: MrCoolGh <159566068+MrCoolGh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement four types of intelligent agents for smart traffic light
Add Smart Traffic Light AI agents (Group 1 assignment)
Mar 10, 2026
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.
Implements all four required intelligent agent types for the Smart Traffic Light environment in SWI-Prolog, plus a self-contained interactive HTML demo for presentation.
Prolog agents (
agents/)simple_reflex_agent.pl— pure condition-action rules; no state. Priority order: emergency override → pedestrian signal →set_green(Dir)when vehicles present →set_red.model_based_agent.pl— trackscurrent_green/1,phase_timer/1,wait_count/2via dynamic facts. Enforces min (10) / max (30) green phase durations; switches to most-congested waiting direction.goal_based_agent.pl— goal: no direction waits > 20 steps. Builds a sorted action plan each cycle, promoting directions near threshold to the front.utility_based_agent.pl— scores every candidate action and picks the max:Interactive demo (
agents/smart_traffic_light_agents.html)Single-file HTML+JS that mirrors the Prolog logic in the browser: tabbed UI per agent, live percept sliders, intersection visualiser with signal colours, utility bar chart, and a Prolog code reference tab. No build step — open directly in a browser.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.