{"id":28238704,"url":"https://github.com/willkirkmanm/traffic","last_synced_at":"2025-06-11T02:31:59.301Z","repository":{"id":292429707,"uuid":"980884698","full_name":"WillKirkmanM/traffic","owner":"WillKirkmanM","description":"Four Way Traffic Simulator with Lights \u0026 Vehicles Following Traffic Rules","archived":false,"fork":false,"pushed_at":"2025-05-09T22:26:24.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T01:13:21.071Z","etag":null,"topics":["parsonlabs","simulation","traffix"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WillKirkmanM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-09T22:17:16.000Z","updated_at":"2025-05-09T22:26:28.000Z","dependencies_parsed_at":"2025-05-09T23:37:29.409Z","dependency_job_id":null,"html_url":"https://github.com/WillKirkmanM/traffic","commit_stats":null,"previous_names":["willkirkmanm/traffic"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WillKirkmanM%2Ftraffic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WillKirkmanM%2Ftraffic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WillKirkmanM%2Ftraffic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WillKirkmanM%2Ftraffic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WillKirkmanM","download_url":"https://codeload.github.com/WillKirkmanM/traffic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WillKirkmanM%2Ftraffic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259186391,"owners_count":22818550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parsonlabs","simulation","traffix"],"created_at":"2025-05-19T01:13:19.979Z","updated_at":"2025-06-11T02:31:59.275Z","avatar_url":"https://github.com/WillKirkmanM.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"https://avatars.githubusercontent.com/u/138057124?s=200\u0026v=4\" width=\"150\" /\u003e\r\n\u003c/p\u003e\r\n\u003ch1 align=\"center\"\u003eTraffic\u003c/h1\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"https://github.com/user-attachments/assets/a05c04a0-e8d1-42ab-a717-33235c576842\" /\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003eFour Way Traffic Simulator with Lights \u0026 Vehicles Following Traffic Rules\r\n\u003c/p\u003e\r\n\r\n## Features\r\n\r\n- **Intersection with Traffic Lights**: Four-way intersection with coordinated traffic lights\r\n- **Vehicle AI**: Vehicles that react to traffic lights and avoid collisions\r\n- **Realistic Movement**: Vehicles accelerate, decelerate, and stop based on traffic conditions\r\n- **Visual Feedback**: Color-coded traffic lights and directional vehicles\r\n\r\n## Traffic Light Algorithm\r\n\r\nThe simulation implements a simple time-based traffic light algorithm:\r\n\r\n1. **Coordination**: East-west and north-south lights are coordinated to avoid conflicts\r\n2. **Cycle**: Each light cycles through Red (5s) → Green (5s) → Yellow (2s) → Red\r\n3. **Priority**: When east-west lights are green, north-south lights are red and vice versa\r\n\r\n## Vehicle Behavior\r\n\r\nVehicles in the simulation exhibit several intelligent behaviors:\r\n\r\n- Stop at red and yellow traffic lights\r\n- Maintain safe distances from other vehicles\r\n- Accelerate when the path is clear\r\n- Travel at different speeds (randomized for each vehicle)\r\n- Automatically despawn when out of view\r\n\r\n## Running the Simulation\r\n\r\n### Prerequisites\r\n\r\n- Rust and Cargo (1.39 or newer)\r\n\r\n### Installation\r\n\r\n1. Clone this repository\r\n```bash\r\ngit clone https://github.com/WillKirkmanM/traffic.git\r\n```\r\n\r\n2. Build and run:\r\n\r\n```bash\r\ncargo build --release\r\ncargo run --release\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillkirkmanm%2Ftraffic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillkirkmanm%2Ftraffic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillkirkmanm%2Ftraffic/lists"}