{"id":25928116,"url":"https://github.com/liubomyr123/gas-station-simulation","last_synced_at":"2026-04-16T09:38:22.394Z","repository":{"id":275800275,"uuid":"926939498","full_name":"liubomyr123/gas-station-simulation","owner":"liubomyr123","description":"A multi-threaded gas station simulation for Linux, featuring dynamic vehicle queues, fuel tracking, priority management, and JSON-based configuration. 🚗⛽🚛","archived":false,"fork":false,"pushed_at":"2025-02-17T23:11:03.000Z","size":295,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T21:11:42.531Z","etag":null,"topics":["c","concurrent-programming","linux","makefile","multithreading","queuing-system","scheduling-algorithms","semaphore","simulation","threading","threading-synchronization"],"latest_commit_sha":null,"homepage":"","language":"C","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/liubomyr123.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}},"created_at":"2025-02-04T05:47:17.000Z","updated_at":"2025-02-17T23:11:06.000Z","dependencies_parsed_at":"2025-02-04T17:37:30.205Z","dependency_job_id":null,"html_url":"https://github.com/liubomyr123/gas-station-simulation","commit_stats":null,"previous_names":["liubomyr123/gas-station-simulation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liubomyr123/gas-station-simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liubomyr123%2Fgas-station-simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liubomyr123%2Fgas-station-simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liubomyr123%2Fgas-station-simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liubomyr123%2Fgas-station-simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liubomyr123","download_url":"https://codeload.github.com/liubomyr123/gas-station-simulation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liubomyr123%2Fgas-station-simulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31880846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["c","concurrent-programming","linux","makefile","multithreading","queuing-system","scheduling-algorithms","semaphore","simulation","threading","threading-synchronization"],"created_at":"2025-03-03T21:11:45.398Z","updated_at":"2026-04-16T09:38:22.361Z","avatar_url":"https://github.com/liubomyr123.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gas Station Simulation\n## Project description is outdated, documentation in progress. More details in description.txt files.\n\n## Overview\nThis project simulates a gas station where different types of vehicles arrive to refuel. The simulation includes queue management, fuel consumption tracking, and various optimization strategies for prioritizing vehicles. The project is designed to run on Linux-based systems.\n\n## Features\n- Supports multiple vehicle types with different fuel consumption rates:\n  - 🚗 Auto: 10L/100km\n  - 🚙 Van: 15L/100km\n  - 🚛 Truck: 30L/100km\n- User-defined number of vehicles per type.\n- Dynamic queue system where vehicles wait for available fuel points.\n- Separate fuel points exclusively for trucks.\n- Vehicles leave the station if fuel is insufficient.\n- Logging system that tracks refueling events and waiting times.\n- Results are saved to a file.\n\n## Requirements\n- Linux OS (a warning is displayed if a different OS is detected).\n- A multi-threaded environment (number of threads is auto-detected).\n- JSON file support for structured input.\n\n## Setup \u0026 Compilation\nTo compile the project, use:\n```sh\nmake\n```\n\nTo build and run the simulation in one step:\n```sh\nmake start\n```\n\nTo run the simulation after building:\n```sh\nmake run\n```\n\nFor debugging purposes:\n```sh\nmake start_debug\n```\n\n## Input Configuration\nThe user can either enter the number of cars manually or use a JSON file to specify details. Example JSON format:\n```json\n{\n  \"total_fuel\": 999999999,\n  \"vehicles\": [\n    {\n      \"type\": \"auto\",\n      \"fuel_by_car\": 10,\n      \"waiting_time_sec\": 2,\n      \"count\": 5\n    },\n    {\n      \"type\": \"van\",\n      \"fuel_by_car\": 15,\n      \"waiting_list\": [\n        { \"waiting_time_sec\": 2, \"count\": 3 },\n        { \"waiting_time_sec\": 5, \"count\": 7 }\n      ]\n    },\n    {\n      \"type\": \"truck\",\n      \"fuel_by_car\": 30,\n      \"waiting_list\": [\n        { \"waiting_time_sec\": 15, \"count\": 10 },\n        { \"waiting_time_sec\": 9, \"count\": 2 }\n      ]\n    }\n  ]\n}\n```\n\n## Simulation Logic\n1. **Step 1**: Ask the user for the number of cars and the total available fuel.\n2. **Step 2**: Introduce different car types and allow the user to specify how many of each type to include.\n3. **Step 3**: Store all results into a file.\n4. **Step 4**: Implement a queue where each vehicle has a waiting time. If a car exceeds this waiting time, it leaves the station.\n\n## Output Example\n```plaintext\n[00:00:00] 🚗 Auto #1 is refueling...\n[00:00:02] 🚙 Van #2 arrived at the station. Waiting...\n[00:00:05] 🚛 Truck #3 left due to long waiting (timeout).\n[00:00:07] 🚗 Auto #1 left the station. Fuel used: 10L\n[00:00:10] 🚚 Tanker #1 arrived at the station to deliver fuel.\n```\n\n## Future Improvements\n- Implement more advanced priority handling.\n- Add support for real-time monitoring via a graphical interface.\n- Optimize queue management using different scheduling algorithms.\n\n## License\nThis project is open-source and available under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliubomyr123%2Fgas-station-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliubomyr123%2Fgas-station-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliubomyr123%2Fgas-station-simulation/lists"}