{"id":21295209,"url":"https://github.com/vaquierm/elevatorsimulator","last_synced_at":"2025-03-15T17:12:55.271Z","repository":{"id":67006513,"uuid":"230788573","full_name":"vaquierm/ElevatorSimulator","owner":"vaquierm","description":"🏢 Modular simulation of multiple elevators in building. Different strategies to optimize waiting time, travel time, and energy","archived":false,"fork":false,"pushed_at":"2020-03-10T02:47:20.000Z","size":4961,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T06:48:09.728Z","etag":null,"topics":["csharp","elevator","elevator-simulation","optimization"],"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/vaquierm.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":"2019-12-29T18:32:36.000Z","updated_at":"2024-11-19T11:15:08.000Z","dependencies_parsed_at":"2023-05-20T08:45:32.667Z","dependency_job_id":null,"html_url":"https://github.com/vaquierm/ElevatorSimulator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaquierm%2FElevatorSimulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaquierm%2FElevatorSimulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaquierm%2FElevatorSimulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaquierm%2FElevatorSimulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaquierm","download_url":"https://codeload.github.com/vaquierm/ElevatorSimulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243762267,"owners_count":20343979,"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":["csharp","elevator","elevator-simulation","optimization"],"created_at":"2024-11-21T14:01:11.563Z","updated_at":"2025-03-15T17:12:55.250Z","avatar_url":"https://github.com/vaquierm.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elevator Simulator 🏢\n\nThis project is a modular simulation of an elevator system inside of a building.\nThe configuration of the building can be changed freely to run the simulation in different types of buildings with different number of elevators etc...\n\nThis project intends on exploring different strategies for the elevators to pick up and drop off requests and tracks three metrics to judge their performances.\n\nA smart relocation that relocates idle elevator dynamically to the give maximum coverage of the building based on requests of the last half hour.\nThis is a trade-off that can reduce the waiting time of passengers but increase the energy used by the elevator system.\n\nAnother strategy used is to give the elevator information about where the destination floor of a request is before the passenger is even picked up. This way, the elevator system can make more complicated decisions since it knows where everyone is going before they even get in the elevator.\n\n## Metrics tracked\n\n**1. Waiting time** ⌚\n\nThis is the average time that someone waits from the moment they press the button to request the elevator to the moment the elevator doors open.\n\n**2. Travel time** ✈\n\nThis is the average time that someone spends inside the elevator from the moment they step in to the moment the doors open allowing them to leave.\n\n**3. Floors traveled** 📏\n\nThis is the average number of floors that the elevator travels to complete one request.\n\nThis number will therefore account for the floors traveled while the elevator could be empty on its way to service a request. And if multiple people are in the same elevator, this \"cost\" is distributed amongst them.\n\n## How accurate is the simulation\n\nThe good! 👍\n\n- Takes into account the time that a passenger enters/exists the elevator \n- Distribution of residents per floor is taken into account (Less people live on penthouse floors)\n- Request source and destinations are weighted by the floor \"interest\" (There is a much higher chance that requests come from or go to the ground floor or floors with amenities)\n- Day cycles are taken into account (In the morning, people are going to work so requests tend to down to the ground floor and around 5 there is a spike of requests from the ground floor to the apartments after work)\n\nThe bad... 👎\n- Acceleration of elevators is not taken into account\n- Assumption that when a request is made, it is always just one person\n- Capacity of elevators is not taken into account (They can accommodate as many passengers as needed)\n- Assumption that nobody accidently presses more than their destination floor\n\n## Different AIs\n\nTwo different elevator AI's have been implemented: a baseline, and an optimized version\n\n### Regular AI\n\nA standard elevator AI from my observations in my apartment building.\n\nThe logic is simple:\n - If there are some idle elevators, the closest one is assigned to go service the request.\n - If there are no idle elevators, check if any busy elevator could service the request on its way. If there exist any of these elevators, the closest one should service the request.\n - If neither of the above conditions are true, continue the simulation until the request can be serviced.\n \n### Optimized AI\n\nThe optimized AI is given information about where the destination floor of the requests are without having to pick up the passenger.\n\nThe decision making follows this penalty minimization logic:\n\n````\nfor each elevator\n  if elevator idle\n    penalty = wait time\n  else if request on the way\n    penalty = wait time + loading time (number of people waiting for and in this elevator)\n  else\n    penalty = time the elevator will take to service its current requests and come back\n  \nchose the option with the least penalty\n````\n\n## Smart relocation\n\nThe smart relocation is a plugin system that can be plugged to any elevator AI. It tracks the distribution of requests that were made in the last half hour.\nWhen an elevator is done servicing all its requests and becomes idle, it calculates its most optimal positioning in the building relative to the other elevators such that the waiting time for any new request is minimized (weighted by floor based on probability).\nThe probability distribution for new requests is approximated by the distribution that was tracked over the last half hour.\n\n## Results\n\nThe below results were ran with the following configuration:\n\n\nSimulation days : ````25````\n\nTicks per day: ````86400\t````\n\nNumber of elevators: ````3\t````\n\nNumber of building floors: ````34\t````\n\nElevator speed per tick: ````1\t````\n\nLoading time in ticks: ````5\t````\n\nResidents per floor: ````[24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 21, 21, 21, 21, 21, 19, 19, 19, 19, 19, 19, 19, 16, 16, 14, 14, 14, 14, 12, 10]````\n\nInterest per floor: ````[7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1]````\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"img/results_raw.png\" width=\"700\" /\u003e\n\u003c/p\u003e\n\nWhen the elevator has knowledge of the destination of the requests without having to pick them up, it can make more optimized decisions to minimize the target metrics. As we can see, the optimized AI is able to shave off a bit of waiting time and even reduce the floors traveled for the elevator which reduces the energy usage.\n\nOn the other hand, the smart relocation reduces the waiting time by a significant amount. We can see that as the number of requests per person per day increases, the elevators are much busier and dont get to relocate. The curve with the smart relocation then slowly converges towards the curve without the relocation.\n\nFurthermore, we see that both strategies do not have a large impact on the travel time at all.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"img/results_percent.PNG\" width=\"900\" /\u003e\n\u003c/p\u003e\n\nThe above graph shows the same results as a percentage change relative to the baseline regular AI. We can see that the optimized AI is able to reduce both the waiting time and the floors traveled by a small amount.\n\nThe relocation is very interesting. There is a small increase in floors traveled (energy used) but there is also a significant decrease in the waiting time. For example, when using the Optimized algorithm with the smart relocation, for the points at an average requests per person per day of 4 which is fairly realistic. There is an increase in floors traveled (energy used) of only about 13% for a decrease in average waiting time of 53%. Compared to the baseline, we can cut the waiting time in half with a 13% increase in floors traveled (energy used)\n\nThis is quite awesome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaquierm%2Felevatorsimulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaquierm%2Felevatorsimulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaquierm%2Felevatorsimulator/lists"}