{"id":21383779,"url":"https://github.com/anjadj/border-crossing-simulator","last_synced_at":"2025-03-16T11:27:36.059Z","repository":{"id":251423308,"uuid":"676563753","full_name":"AnjaDj/Border-crossing-simulator","owner":"AnjaDj","description":"Multi-thread Java application simulating one sided border crossing with multiple terminals","archived":false,"fork":false,"pushed_at":"2024-11-02T17:50:37.000Z","size":20314,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T20:24:05.137Z","etag":null,"topics":["concurent","java","multithreading","object-oriented-programming","threads"],"latest_commit_sha":null,"homepage":"","language":"Java","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/AnjaDj.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":"2023-08-09T13:42:22.000Z","updated_at":"2024-11-02T17:51:49.000Z","dependencies_parsed_at":"2024-11-02T18:28:08.272Z","dependency_job_id":"b3afb1c7-635d-4e24-9908-d5fe458ae109","html_url":"https://github.com/AnjaDj/Border-crossing-simulator","commit_stats":null,"previous_names":["anjadj/programski_jezici_2","anjadj/border-crossing-simulator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnjaDj%2FBorder-crossing-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnjaDj%2FBorder-crossing-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnjaDj%2FBorder-crossing-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnjaDj%2FBorder-crossing-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnjaDj","download_url":"https://codeload.github.com/AnjaDj/Border-crossing-simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243860121,"owners_count":20359668,"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":["concurent","java","multithreading","object-oriented-programming","threads"],"created_at":"2024-11-22T11:33:15.531Z","updated_at":"2025-03-16T11:27:36.036Z","avatar_url":"https://github.com/AnjaDj.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Border Crossing Simulation 🚛🚗🚌🚐\n\nThis project simulates a border crossing with multiple terminals for police and customs control. The system includes various types of vehicles, passengers, and procedural rules to mimic a real-world border crossing scenario.\n\n## Simulation Overview\n\nThe border crossing operates with:\n- **3 Police Terminals**\n- **2 Customs Terminals**\n\nOnly one side of the border is simulated, with vehicles proceeding through police control first, followed by customs.\n\n### Vehicle Types\n1. **Personal Vehicles**: Up to 5 passengers (including the driver).\n2. **Buses**: Capacity for up to 52 passengers (including the driver).\n3. **Trucks**: Up to 3 passengers (including the driver), with potential cargo requiring customs documentation.\n\n### Passenger and Cargo Details\n- **Trucks**: \n  - 50% chance of requiring customs documentation.\n  - Declared vs. Actual Cargo Weight: In 20% of trucks, the actual weight is up to 30% more than declared.\n  \n- **Buses**: \n  - 70% chance each passenger has a suitcase in the luggage compartment.\n  - 10% of suitcases may contain prohibited items.\n  \n- **Passenger Identification**: Each passenger has an ID document.\n  - 3% of all documents are invalid, preventing those passengers from crossing.\n\n### Initial Setup\n- **Queue Initialization**:\n  - A queue of 50 vehicles is created: 5 buses, 10 trucks, and 35 personal vehicles, all in random positions.\n\n## Processing Flow\n\n1. **Police Check**:\n   - Vehicles are processed in parallel across three police terminals.\n   - One police terminal (far right in the graphical view) is exclusively reserved for trucks.\n   - Other vehicles are processed at the remaining two terminals.\n   \n2. **Customs Check**:\n   - Processed vehicles wait for the shared customs terminal if the police terminals finish earlier.\n   - **Processing Times**:\n     - **Personal Vehicles \u0026 Trucks**: 0.5 seconds per passenger at each terminal.\n     - **Buses**: 0.1 seconds per passenger.\n     \n3. **Incident Handling**:\n   - Invalid documents: Recorded in a binary serialized format for sanctioned individuals.\n   - Vehicles continue processing without sanctioned passengers unless the driver is affected.\n   - Customs Rejections:\n     - Overloaded trucks and prohibited items in suitcases prevent crossing.\n     - Rejections are logged in a text format.\n\n## User Interface and Display\n\n- **Queue Visualization**: Shows the next five vehicles in line to cross. The remaining queue is displayed in a separate UI.\n- **Incident Overview**: Displays vehicles involved in incidents, with exact details.\n- **Vehicle Data**: Provides details on vehicles and passengers, accessible by clicking the vehicle or entering the vehicle ID.\n- **Simulation Events**: All events are logged and displayed in real-time.\n\n## Additional Features\n\n- **Terminal Availability**: Terminals can be blocked or re-enabled based on a shared file.\n- **Simulation Control**: Start, stop, and reset options available, with a timer displaying the simulation duration.\n- **Exception Handling**: Uses a `Logger` class for error handling across all classes.\n\n### Color Coding and Icons\nEach vehicle type is represented with specific colors or icons for easy identification.\n\n---\n\n## Implementation Details\n\n- Vehicle movement logic is implemented within the vehicle classes.\n- The simulation uses a graphical interface to show all relevant events.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanjadj%2Fborder-crossing-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanjadj%2Fborder-crossing-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanjadj%2Fborder-crossing-simulator/lists"}