For now, I am going to concentrate on freight trains. I will address passenger trains later in the course (if there is time).
There are two main types of train that we need to manage:
- Trains that originate on the model railroad and
- Trains that originate of scene.
There are two main differences:
- To create a train “on scene” only cars that are currently “spotted” (either at an industry or in a storage yard) can be included in the process whilst “off scene” trains can only be created from cars currently held on storage tracks (known as staging).
- Trains both on and off scene can take cars and drop them on staging (i.e. without a specific destination) provided that their final destination is staging.
So, what do we do:
On the Railroad origination
- Collection of loads at industries for onward delivery;
- Collection of available empties;
- Requests for empties by industries.
The train length is defined in its database description. The process should randomly decide in which order to carry out the above three processes so that each train has a slightly different emphasis. The actual train length will be adjusted to a random length(within the defined maximum). The decisions are as follows:
- Loaded cars (empty status = true)* – time on site >= location load time;
- Empties (loaded = true)* – time on site >= location load time;
- Assess all locations for space/requirement for empties – add to train up to random length.
- If number of cars exceeds random length, each of the three elements is adjusted down as required.
Off Railroad origination
- Assess available space along the route for space for new cars
- Assess the available cars in the train originating staging location and match cars to spaces up to the random length of the train (see above).
Train Type Analysis
There are two main types of train that can run and this type affects the choice of cars and locations.
- The archetypal “Way Freight”. This will stop at all towns between A and B so all car allocations should take this into account. These, when originating on or off railroad will use the process discussed above;
- Through freights. These run through between division points and stop, if at all, at a limited number of towns. When run off railroad, they will either finish on railroad, in which case they will use the complete process discussed above. When run end to end;i.e. staging to staging, only the second process is applicable.
- Manifest/Symbol freights. When run on the railroad, these shift cars in blocks between these division points. Currently, as this is only applicable to large model railroads, this option will be omitted from the specification.
Note re: database design
Location records must be amended to define whether that location accepts loads only, empties only or both. (edited 11/6/17)
Location records must be amended to add an extra field (whenLoaded)to indicate where loads should be shipped to. (added 11/6/17)
Car records must be amended to add an extra field (whenEmpty) to indicate where the car should be shipped when empty. (added 11/6/17)