Skip to content

Input file specification

JoshBraddon edited this page Feb 3, 2024 · 3 revisions

Input File Rules:

The FloorInfoReader class takes in .txt input files and parses them in order to create a queue of requests. For the file to be read properly there are a few rules:

  1. Each line is a new request.
  2. Each request is made up of 4 pieces of data, a time, a starting floor, the direction of the elevator and the service floor
  3. Between each data point there must be AT LEAST 2 spaces, any number above 2 will be work the same
time  serviceFloor  direction  floor

this is ok but

time serviceFloor direction floor

is not. These are equivalent:

time  serviceFloor  direction  floor   vs.     time    serviceFloor    direction    floor
  1. There must be AT LEAST 4 data points per line, any extras will be ignored.

Clone this wiki locally