austinw / elevator
Assessment for LenderHomePage.com
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- monolog/monolog: ^1.23
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-10-26 10:38:22 UTC
README
Instructions
First there is an elevator class.
It has a direction (up, down, stand, maintenance), a current floor and a list of floor requests sorted in the direction.
Each elevator has a set of signals: Alarm, Door open, Door close.
The scheduling will be like:
- If available pick a standing elevator for this floor.
- Else pick an elevator moving to this floor.
- Else pick a standing elevator on another floor.
Sample data:
- Elevator standing in first floor
- Request from 6th floor go down to ground(first floor).
- Request from 5th floor go up to 7th floor
- Request from 3rd floor go down to ground
- Request from ground go up to 7th floor.
- Floor 2 and 4 are in maintenance.
Installation
Install Composer.
Terminal:
$ git clone git@github.com:AustinW/elevator.git
$ cd elevator
$ php composer.phar install
Testing
$ php composer.phar phpunit
Or:
$ phpunit