{"id":15793865,"url":"https://github.com/sueszli/concurrent-elevators","last_synced_at":"2025-03-31T19:25:17.322Z","repository":{"id":134327613,"uuid":"590536699","full_name":"sueszli/concurrent-elevators","owner":"sueszli","description":"elevators concurrency problem in java","archived":false,"fork":false,"pushed_at":"2024-04-25T00:45:42.000Z","size":502,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-05T23:21:30.047Z","etag":null,"topics":["concurrent-programming","modern-java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sueszli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-01-18T16:34:57.000Z","updated_at":"2024-04-25T00:46:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"179924cf-ab76-4d17-92ee-57a950cd7322","html_url":"https://github.com/sueszli/concurrent-elevators","commit_stats":null,"previous_names":["sueszli/concurrent-elevators"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sueszli%2Fconcurrent-elevators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sueszli%2Fconcurrent-elevators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sueszli%2Fconcurrent-elevators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sueszli%2Fconcurrent-elevators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sueszli","download_url":"https://codeload.github.com/sueszli/concurrent-elevators/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246524855,"owners_count":20791631,"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":["concurrent-programming","modern-java"],"created_at":"2024-10-04T23:21:30.717Z","updated_at":"2025-03-31T19:25:17.302Z","avatar_url":"https://github.com/sueszli.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"A super minimal implementation of a thread-pool-executor service / scheduler in Java. The goal is to provide a simple,\neasy to understand implementation. The implementation is not intended to be used in production, but rather to be used as\na learning tool.\n\n## Problem\n\n- There are 7 elevators in a building with 55 floors.\n- Each floor has exactly one button to request an elevator.\n\n- Elevators have the capacity of carrying an arbitrary, given number of people.\n- Elevators don't change direction and don't stop mid-trip.\n\n- People can only choose their destination freely, when they are on the ground-floor:\n    - up: ground-floor [0] − can only travel to ⟶ non-ground-floor [1;54]\n    - down: non-ground-floor [1;54] − can only travel to ⟶ ground-floor [0]\n\n- The requests are handled globally.\n- The elevator-scheduler assigns a chosen request to an elevator based on some arbitrary algorithm.\n- If there are no elevators available, the request is queued up.\n\n## Design decisions\n\n- Decided to use vanilla Java without any non-default libraries for the sake of simplicity.\n- Got rid of the suggested \"up\"/\"down\" directions since they can be inferred from the current floor.\n- Chose a poison-pill approach to terminate the scheduler (also\n  see: [this similar implementation](https://gitlab.com/niklaswimmer/dc-tower-elevator-challange/-/blob/main/app/src/main/java/me/nikx/dctower/TowerController.java))\n- Chose JDK-19 to make use of type inferrence with `var` and other nifty features. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsueszli%2Fconcurrent-elevators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsueszli%2Fconcurrent-elevators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsueszli%2Fconcurrent-elevators/lists"}