Station Identifiers

The Pascal simulator numbered stations from 1 to 173 and declared an array of stations accordingly.

const maxnode = 175; type nodenum = 1..maxnode; var stations: array[nodenum] of record ...

Java replaced the station records with a Station class which it held in an array indexed from 0 to 172.

static Station station[]; station = new Station [173];

Javascript dispenses with node numbers in either index origin preferring to use the three digit integer zip codes as keys into an object. This removes a level of indirection in routing tables and throughout the simulator.

const stations = {}; for (let s of data) stations[s.zip] = s

JSON requires keys be strings but the same restriction does not apply to objects. Thus we distribute station data as an array of stations and then transform this into the stations object.