-
Notifications
You must be signed in to change notification settings - Fork 320
Solutions
00001H edited this page Mar 28, 2022
·
106 revisions
Post your programs for elevator control here! Please create a new page for your solution and link to it from here.
Programs with simple event driven behaviour, typically less than 20 lines long.
- Developer testing solution Used when developing elevatorsaga.
- Twentyliner Complete solution for all 18 challenges in 20 lines of code
- Tribuadore solutions (v 0.9) Minimal solutions for each challenge.
- efouts solution Passes all challenges, some may take a few tries.
- santrancisco solution Result of frustration so I hacked the matrix.
- bschne solution Simple event-driven solution built around a few basic rules, solves challenges one through twelve.
- Basic Solution. Only solves challenges 1..4, but does show use of most of the API, including multiple floors and elevators, and direction indicators, and can be used as a basis of a more complex solution.
More advanced solutions here.
Good but can't beat all levels
- swiss chris' solution Solves all levels 1 thru 18 (struggles with some)
- O(log(n))-competitive solution
- Solution with working lights!|nichampagne's Solution
- Global Scheduler solution (v 1.0)
- DeSjoerd solution (v 0.9)
- toonvr's solution (v 1.2)
- Hacky solution to every "N-elevator moves or less" level (v 0.1)
- kballenegger's solution
- aonsager's solution
- indutny's solution
- Alber70g's solution
- MarkusMattinen's solution (includes benchmarks for all challenges)
- tasuk's solution Worse than Markus Mattinen's solution.
- benjamg's solution for 1 to 16
- yk11's solution for all levels
- marado's solution for 1-12
- Cheng's Solution with balanced benchmarks for level 17
- Bisqwit's solution for all levels
- Dustin's Solution
- Jayswain's solution for 1 - 7
- Filype Pereira's solution for 1 - 7
- jstnlef's solution for most levels
- xoqem's solution for all levels (though not optimized for number of moves)
- AzizHarrington's Solution Levels 1-12
- paulhart's relatively naive solution
- Eric's Solution for levels 1-7
- SKooDA's Solution for ** manualy controlled ** game
- Markavian's Solution for all levels, with a mode switch
- Kaue's Solution for level 17; each elevator is fair (ie no starvation); using direction lights; load balancing using the modulo operator (it is more effective than 'least loaded'); local scheduling.
- jacqt and dvdhsu; for level 17. Basic solution that works surprisingly well on problem 17. Elevators go from 0 to 20 to 0 to 20 repeatedly
- kisPocok's Solution for level 0-12; with Hungarian comments.
- Xavi's solution: working direction lights, trying to model what I think is the right behaviour without going too crazy, works pretty well on most challenges
- Tony's solution: Here's my initial solution it can solve 1 - 11 but struggles on 6 and 10 quite a lot. Basic idea is when a request comes in choose the least busy elevator based on queue. If you're passing a floor that is in the queue, stop at it on the way and remove it.
- akadrac's solution: Solves all levels bar 13
- Bentheax's solution: Solves levels 1-9 and 16+. Dead zone in the middle is due to not optimizing for max wait time. Working towards it.
- ophermit's solution (without direction indicators)
- vibby’s proposal: Does not solve 13 to 15, but best (as far as I have seen) for long term stats ;) Transported: 3006, Elapsed time:2016s, Transported/s:1.49, Avg waiting time:12.0s, Max waiting time:34.4s, Moves:21299
- brunneng’s solution: In Challenge #19, Avg waiting time after 6000 transported people: 10.9s (anybody less?)
- Brandon's solution: Hacked together answer that works for all cases in 85 lines of code
- Brandon's Solution v.2: shorter version of previous implementation
-
onozaty's solution: This code cleared all Challenges.
[Challenge #19 when 10000 people were transported] Transported/s: 1.50, Avg waiting time: 10.9s - Kate Rose Morley’s solution: An educational solution, with a clearly structured algorithm accompanied by extensive documentation. Achieves a long-term average waiting time of 11.8 seconds on the perpetual demo while keeping the maximum waiting time to around 40 seconds.
- Kabosu’s solution: Simple but works on every level (<60 lines).
- Zac Todd Solution: Direction and capcity based queueing.
- wwboy6's Solution. Event Driven. Solve all levels (Require many tries for level 13-15)
- jamy015's solution: can beat levels 1-11, sometimes after trying your luck a few times.
Play it yourself at play.elevatorsaga.com