Exercise idea: Airplane Boarding Simulation

Open
#1,475 3 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Domain
content

Research direction

No files, tests, or implementation entry points are named. Start by reviewing the proposed boarding methods and the linked visualization and research, then resolve how the process, parameters, and outcomes should be modeled and tested. Done means an agreed exercise specification with a defined comparison scope and completion criteria.

Written by the indexing model from the issue text.

Description

new exercise idea

There aren't a lot of modelling or simulation exercises right now. After watching a CGP Grey video 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)
(* Watch the video for an explanation, or if you're more interested, check out Optimal boarding method for airline passengers and Experimental test of airplane boarding methods (paywall warning))

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 :)

Dominant language
Ruby
Stars
362
Forks
566
Avg merge
15h 13m
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/problem-specifications

All issues in exercism/problem-specifications

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.