Simulate elevator's service, given a number of floors X elevators.
Try it online:
- Go to https://replit.com/@jotafeldmann/elevators
- Click the "shell" tab
- Run
make dev
We use elevators everyday. But everytime I think "all this elevator's behaviours can be improved, somehow".
So, as a programmer, I'm thinking how to describe this challenge in a generic model, just for fun.
- Simulate elevator's service, given a number of floors X elevators
- Learn Deno
-
Install Deno 1.0.0
-
Clone
git clone https://github.com/jotafeldmann/elevators
- Install
make install
- Test
make test
- Default/dev (dev mode, watch changes and reload)
make
#or
make dev
- Run (prod env)
make run
- TypeScript setup
- Request elevator at floors
- Add watch changes and reload task
- Add event controller
- Add basic visual interface
- Add continuous flow of requests
- Converted to Deno
- Add
make tests
to basic classes - Add
make fmt
- Add CI (Github Actions)
- Add CLI/dynamic parameters (number of floors, elevators, speed)
- Add metrics (e.g. waiting time, movements)
- Add simulation cases results
- Request floors from elevators (
building.requestElevatorAtFloor().then(e => e.requestFloor(5))
) - Limit and control number of people inside elevators
- Add different rules for elevators (e.g. elevator 2 only receive requests from last floors)
- Prediction (AI?) max efficiency