exercism / exercism/problem-specifications

Exercise idea: Airplane Boarding Simulation

未关闭
#1,475 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
new exercise idea
主要语言
Ruby
星标
358
派生
563
平均合并
18 小时 41 分钟
30 天内合并 PR
2

描述

There aren't a lot of modelling or simulation exercises right now. After watching a [CGP Grey video](https://www.youtube.com/watch?v=oAHbLRjF0vo) recently, I thought it would be interesting to simulate the boarding process of an airplane and compare different methods. This could also work well as an exercise. It seems only suitable as a side exercise, though.

_I haven't fully thought this through and I'm not even sure if this kind of exercise fits exercism well, but the responses on Slack were positive, so I decided to post the general idea here regardless._

There are a few methods to board an airplane that are used in practice and also some unpractical, but theoretically more efficient, ones:

- Back to Front & Front to Back
- Random
- Window -> Middle -> Aisle
- Steffen modified*
- Steffen perfect*

([Visualisation of them](https://www.youtube.com/watch?v=3e5Jn2gG8Eg))
(* Watch the video for an explanation, or if you're more interested, check out [Optimal boarding method for airline passengers](https://arxiv.org/abs/0802.0733) and [Experimental test of airplane boarding methods (paywall warning)](https://doi.org/10.1016/j.jairtraman.2011.10.003))

The exercise would be about simulating the process and potentially comparing them in regards to the time it takes to fully board the plane. A bonus task could be a visualisation of the results or the process.

My naïve implementation would be to discretise the process, with a grid representing the aisle and seats and each action taking one time unit to do. The passengers would enter the grid in a specific order based on the used method. There would be multiple actions each passenger can do:

1. Move forward in queue/aisle
2. Store the carry-on in the overhead compartment
3. Take a seat
4. Make room for another passenger that has a seat further on the outside (e.g. aisle is already sitting, next passenger needs to move into window seat)

A few parameters could be changed:

- seat layout
- two entrances instead of one
- the simplification of the simulation (e.g. one could skip 4) from above)

There are a few questions I don't know how to answer yet:
1. Would the exercise say how to model the process or should the student come up with it?
2. Depending on 1), do we solely test for results (this works regardless of the chosen implementation) or also the individual actions/steps (this would likely require the model to be part of the exercise)?
3. Should a comparison be part of the exercise, or should it be enough to implement a single method (which?)?

---

As I said above, I'm really not sure if and how this would work, so please don't hesitate to share your thoughts & ideas on how a general exercise about a simulation of airplane boarding would work, especially if they're completely different to my ideas above :)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。