{"id":17459101,"url":"https://github.com/arjunattam/elevator-simulation","last_synced_at":"2025-03-28T06:10:54.278Z","repository":{"id":71618905,"uuid":"50711360","full_name":"arjunattam/elevator-simulation","owner":"arjunattam","description":null,"archived":false,"fork":false,"pushed_at":"2016-02-01T06:48:28.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T07:17:42.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/arjunattam.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}},"created_at":"2016-01-30T05:53:45.000Z","updated_at":"2021-07-02T19:48:33.000Z","dependencies_parsed_at":"2023-02-23T20:45:44.637Z","dependency_job_id":null,"html_url":"https://github.com/arjunattam/elevator-simulation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunattam%2Felevator-simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunattam%2Felevator-simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunattam%2Felevator-simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunattam%2Felevator-simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arjunattam","download_url":"https://codeload.github.com/arjunattam/elevator-simulation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978274,"owners_count":20703677,"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":[],"created_at":"2024-10-18T04:42:00.242Z","updated_at":"2025-03-28T06:10:54.256Z","avatar_url":"https://github.com/arjunattam.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elevator-simulation\n\n## Problem statement\nSimplified elevator simulation to implement abstract method in object oriented design.\n\n## Solution\n### Summary\nThe solution has been deployed on Github pages, [link](http://arjun27.github.io/elevator-simulation/). Javascript prototypes have been used to define classes, their properties and methods. The solution is generalized, to __n floors__ and __m elevators__.\n\nThe implementation is restricted to floor buttons only, and jobs are given to idle elevators only.\n\n### OOP design\nThere are 4 classes defined in this implementation. Their properties and methods are detailed below.\n\n* __Controller__\n\n  This is the main controller/logic class, responsible for defining _n floors_ and _m elevators_. The Controller class also defines an abstract method _buttonPressed_ which is defined later in the Button class. Job requests are handled with the _handleRequest_ method.\n* __Button__\n\n  This class defines a floor button, which inherits from the Controller class and defines the _buttonPressed_ capability of the abstract method.\n* __Floor__\n\n  This class defines a floor, with characteristics of having 2 buttons (_upButton_ and _downButton_) and an identifier number, _floorNum_.\n* __Elevator__\n\n  This class defines an elevator, with characteristics of current _idleFloor_ and movement of _direction_, which are typically displayed on the elevator status screens. In addition, there is an identifier number, _elevatorNum_.\n\n  The _isEligible_ method checks whether the elevator is fit to take up a job, while the _assignJob_ method takes a job and moves the elevator accordingly.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunattam%2Felevator-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjunattam%2Felevator-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunattam%2Felevator-simulation/lists"}