The original design of my CFS program used the notion of a Shipment, which implemented the basic idea of a shipper sending a load of something to a receiver, much as one would expect. The starting and ending tracks could be either in the modelled network (on the layout) or at virtual tracks in the unmodelled space. With this approach, only the loaded segment of a cars journey is defined, regardless of if it is heading in to or out of the modelled layout. As part of each car’s assignment, there is always at least one segment that is done empty, either to supply a car to a shipper, or to return a car back home. With the Shipment having only information for the loaded segment, the other segments must be generated in some way. This has led to some unfortunate side effects in terms of being able to shape car movements in desirable ways.
A good example of this problem is when a car is supplied to a modelled shipper. The car will usually come from one of the staging tracks, but which one? The shipment is silent about where a car comes from, or where it returns to. We may not want the selection process when restaging a car to consider all staging tracks equally, as that may have ramifications on car interchanges, flow through yards, etc. It would be better if there was a way to influence this selection process by having relative weights on the different choices, so that some are more likely to be selected than others. This allows for some oddball routing for variety, but the bulk of the selections will be want we want.
The choice of where to route an empty car towards home has this problem also. While there are lots of prototype rules around this, the reality on a model railroad is that we may have to influence this behaviour so that parts of the layout do not get overloaded. Again, having a weighting scheme would work.
The simple solution is to define a complete life cycle for each shipment, including supply of the car, freight movement, and return of the empty car. Each role is given a weigting that can be used when selecting from otherwise suitable choices.
This new notion is called a “Role” for now, but the name may get changed back to just “Shipment” after the original Shipment concept has been completely removed from the code.
One major additional advantage to this concept is that car life cycles that are more complicated than just simple supply, freight, and return become very easy to implement, as the role will simply have more segments to be followed. In this way, it becomes very easy to include some unusual shipments that get selected only very infrequently.
To be continued….