Modelling what might have been in southeast BC and northwest Wasington

Goldilocks and the three metrics

Q Factor formula

How do we measure the “goodness” of an operations scheme for running a model railroad? Well, having a computer program that can easily run studies of a layout over many days with different operating schemes, train timetables, and other parameters, we can generate a lot of statistics from each run and then compare them, but what measures indicate a better or a worse outcome? We have all attended good and not so good operating sessions and can probably list a number of aspects that made one better than the other. The trick is to find a way to quantify at least some of these so that the program can better serve as a planning tool, and we don’t need to impose on our friends while we “try it and see”. There are certainly some aspects that people enjoy about a session that can’t be quantified, but maybe we can find some way to approximate a measure of “goodness”.

Stepping back from calculations for a moment, the main purpose of an operating session is to move cars around a layout to where they should be, through the running of various trains according to some operating scheme. The non train aspects, such as dispatching, train orders, etc., are outside of the scope of this discussion, because they are not simulated by the program. With that in mind, I think that the following characteristics can be accepted as indicative of a good, well run operating session.

  • Industries should have the number of cars they require.
  • A good number of the cars should move at least once.
  • All cars that are ready to move should move.
  • Only specialized cars should be off the layout in storage.
  • Yards, interchange, and other nonrevenue locations should have a minimum number of cars.

In other words, the layout should be well utilized, cars should flow smoothly to where they should be going, and there should be lots of activity to keep the crews busy during the session. Layouts with too few cars in play to provide sufficient interest or those with so many cars plugging up everywhere that hardly anything moves tend to be less satisfying for crews. Some variation is of course desirable, but extremes are not.

So the trick is to find some measures in the program that can capture these ideas so that we can judge if one operating scheme is better than another. The idea is to have a number of metrics about a session that can be combined to produce an overall score. If each one has a maximum value of 1.0, meaning that the aspect is as good as it can be, then we may be able to just multiply them together and still consider 1.0 as the “perfect” result.

Some of these characteristics tend to be at odds with one another. For example, if we add more cars to a layout so that we have a higher fraction of the industries fully served, it may result in cars not flowing through yards as quickly due to congestion and limits. This reduces the overall mobility and can lead to gridlock.

Here are three ideas for what we might measure.

  • Pickup Ratio – The fraction of times when a car is ready to move, and a train should move it, but it does not pick it up due to some limit on length, space ahead, etc. If a car always gets moved when it is ready, then the score would be 1.0.
  • Q Factor – The fraction of cars that are at revenue tracks (industries) and staging, versus those on nonrevenue tracks and in storage. We want the cars to be moving about the layout and not sitting waiting somewhere. Again, 1.0 is best.
  • Revenue Usage – The fraction of the track space at industries that is occupied by cars. Obviously this cannot always be 100 percent, as some industries only receive cars infrequently, but we also don’t want them never more than say half full either.

These three metrics are easy to calculate by the program, and are reported in a summary file for each study run.

To play around with how all of this might look, I plotted these measures for the S&BC for different numbers of cars, and different interchange probabilities. Other posts talk about some of the issues we have had with too many cars clogging up the Grand Forks yard because they are waiting to be interchanged between the two railways. The solution seemed to be to minimize the shipments that require interchange by coercing them to be selected less often, so this was a good test case to see if these metrics would support this idea in a quantifiable way.

The following graph shows the effect of having 40, 60, 70, 80, and 98 cars on the layout, with the train schedules and everything else the same. The probabilities of interchange shipments were not reduced. We would expect that as more cars are added, the revenue track usage would go up, as it is very low with only 40 cars in play, but we might end up with so much congestion that cars start to be unable to move when they should. This in fact is what happens. The green line shows the track usage going up from just over 0.2 to 0.7, meaning that we have a lot more cars delivered to the industries from the additional cars. But, the yellow line shows that there is a price to pay for this, namely congestion, as the rate of car pickup drops from over 0.9 (very good) to about 0.35 (very bad), which means that a lot of the cars that are ready to move are being skipped by trains when they should otherwise be picking them up.

Qfactor graph with interchange at 1.0

The blue line is what I am calling the Qfactor, using the formula shown at the start of this post. It is the fraction of cars at revenue and staging tracks, divided by the total number of cars. It simply indicates what portion of the cars are on the “good” parts of the layout, actively participating in the running of trains, versus those that are mostly sitting idle for one reason or another. In this case it is mostly constant and independent of the number of cars in play because there is extra capacity at the industries that can accept more cars, however a roughly proportionate number of additional cars will also end up on the non-revenue tracks such as yards while they wait longer to be delivered. This is a good example of why we need more than one metric, as there are opposing tends at work.

And finally, the red line is just a combination of the other three, in an attempt to provide a single value. I’m not sure yet how much value this may have. Time will tell.

A second set of studies were then run with the same numbers of cars, but with a much lower probability for the interchange shipments. This should result in far fewer cars waiting in the Grand Forks yard to be interchanged from one train to another and more at the industries. All of the shipments that required interchange between trains were set to a very low probability, so that they would be selected only as a “last resort” if there were no other direct shipments available.

Qfactor graph with interchange at 0.01

This time we have a very different set of curves. The car pickup ratio (yellow) is very high throughout, meaning that cars never have to wait long after they are ready to move, which is what was expected. The industry tracks are never very full at only 30% (green) so that is a concern, and the Q factor (blue) starts out very good, but drops rapidly as more cars are added. A closer examination shows that this is because almost all of the extra cars end up getting stuck in storage and never making it on to the layout. This in turn is because none of the shipments will be exchanged in the yard, so there is nowhere for them to accumulate and be in play on the layout. In short, the trains leaving staging quickly get saturated by cars freely going between staging and the industries, with none sitting around waiting. The flat portions of the yellow and green lines shows that the extra cars have no effect on them. This would probably be considered a good operating session with freely flowing cars, so long as it was acceptable to have low utilization of the industries. One conclusion from this is that the “natural” number of cars for this operating scheme is somewhere between 40 and 60 cars. The way to have more cars on the layout is probably to run more trains so that there is more capacity out of staging to feed the layout. This might be worth trying sometime.

So, in summary, I think these three metrics give a good insight into the nature of an operating session simulation. I expect to improve my understanding of their implications as more experience is gained, but for now, they should serve well for planning, comparing, and contrasting different operational schemes. Oh, and what does Goldilocks have to do with this? Nothing at all.

Shipments versus Car Roles

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 (behind staging). With this approach, only the loaded segment of a car’s journey is defined, regardless of if it is heading in to or out from the modelled layout. Every car’s assignment will always include at least one segment that is done empty, either to supply a car to a shipper to be loaded, or to return an unloaded empty car back home, or both. With a Shipment having only information for the loaded segment, the other segment(s) must be generated using some sort of rules. The various rules tried so far have been less than entirely satisfactory, and this has led to some unfortunate side effects in terms of not 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. When restaging a car, we may not want the selection process 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 what we expect.

Similarly, the choice of which way to route an empty car towards home suffers from the same problem. While there are lots of prototype rules around this, the reality on a model railroad is that we may have to coerce the routing so that parts of the layout do not get overloaded. Again, having a weighting scheme would help.

A simple solution to both problems is to define a complete life cycle for each shipment, including car supply, freight movement, and empty return. Each role is given a weighting that can be used when selecting from otherwise equal and suitable choices. For example, car routings that do not involve interchange to other railroads may be given a higher weighting and therefore are more likely to be selected than ones that have interchange, thereby minimizing cars having to be switched through a yard.

This new notion is called a “Role” for now, so that it can coexist with the current Shipments, but the name may get changed back to just “Shipment” after the original Shipment concept has been completely removed from the code.

One major benefit of this approach is that car life cycles that are more complicated than just a simple supply, freight, and return sequence become very easy to implement, as the role will simply have more segments to be followed. Think of a reefer needing to be iced before it is loaded. It really needs to make two stops for “loading”, one for ice, and the other for the actual load. This new simpler scheme eliminates the need for convoluted rules to handle the extra car movements. It now becomes very easy to include some unusual shipments that should get selected only very infrequently, simply by giving them low weights.

In order to implement this change in the program, significant code must be changed, which will be a big job as the results must be checked carefully to make sure that it really is working as expected. Results from early testing look very promising.

Stay tuned….

Still Too Much Congestion

Simulations were run of the revised operating scheme without a dedicated switcher at Grand Forks and having the way freights switch the industries and exchange cars between the railroads. Once again there is a pile up of cars that get “stuck” in the yard at Grand Forks. This is fundamentally no different than when we had the dedicated switcher, just to a different degree. It occurs on fewer tracks, and involves less cars, but it is still an undesirable outcome that will lead to unsatisfactory operations.

One thought was that we should try to minimize the shipments that are selected during restaging to ones that have a clear path from staging to the first delivery point. This is called “congestion” and is a measure of how full the tracks are along the car’s route to its first destination. The restaging logic was changed to consider only those shipments where the path congestion is below a certain level, with the idea that this will help the overall car flow by not overloading the paths that already have lots of cars along them.

Test were run with various levels of congestion threshold, and while the number of cars getting stuck in the interchange tracks was generally less, the effect was far less than hoped for. For example, on a 30 day simulation with 40 cars and a congestion threshold of 0.5, the number of times a car had to be skipped because it there was no room ahead dropped from 187 to 147. With 60 cars and the same 0.5 threshold, the number of skipped cars actually rose from 787 to 948! Not a lot of help there. Next, more thinking.

An examination of the tracks involved showed that the vast majority of the skipped cars were in fact at industries ready to be picked up, and they needed to be exchanged with the other railroad, but there was no space on the interchange track. Clearly the issue is not just with picking shipments for cars being restaged, as that only addresses the first leg of their journey. With shipments able to go in all directions, many cars will get delivered to their first stop without passing through a congested area, but that says nothing about the car’s second leg, which has a high probability of needing to be interchanged, hence the problem.

One simple and obvious solution is to tinker with the shipment mix so that most shipments do not require interchange either coming or going, but that is an artificial solution that is not appealing. Some way needs to be found to minimize the number of shipments needing interchange for a typical layout, without introducing artificial un-prototypical assumptions.

The next thing tried was to segregate shipments by the number of railroads involved, using some form of weighted random selection. The idea is that most of the shipments selected when restaging cars probably should be for the home railroad, so that only some will need to be interchanged. To test this idea, a stricter simplified version was implemented which only selects a home railroad shipment. This works well, but can result in a fair number of restaged cars with no candidate shipments which must then be moved to storage. A better way is to only enforce this when there are in fact shipments that meet the criteria, and revert to an “anywhere” model when there are no same railroad shipments available.

The return track selection for inbound shipments was also constrained to be the originating staging track, otherwise these moves can involve interchange tracks as well.

So, after all of those ideas, the results of the changes did not produce the kind of improvements that were expected, and there were still far too many interchange moves, so more investigation was needed. Confining shipment selection to only one railroad was clearly not working, and a detailed look at the data showed why. In my haste to convert to the newer two railroad operational model, I had neglected to update which tracks were owned by which railroads, as it really did not matter up to that point. Now with a shipment selection based on owner, it did matter greatly and was very wrong, hence the large number of interchange moves that were still happening. It was all essentially still one big happy railroad, with shipments going everywhere and plugging up the interchange tracks. Despite the name, the so-called interchange tracks know nothing about which railroad they belong to or even that they are an interchange between railroads. They are simply part of the car routes from one place to another. By having almost everything owned by one railroad, it meant that all of the shipments were candidates, just as before, so naturally many of the ones selected just happened to be between points on the layout that needed to pass through an interchange track.

After correcting the track ownership problem, shipments that travel exclusively on one railroad’s tracks will be moved only by trains of that railroad, thereby minimizing cars needing to be interchanged. There will still be a few, because sometimes there are no single railroad shipments available during restaging, so the criteria is relaxed to consider any candidate shipment which includes interchanges when necessary. Tests bear out a big reduction in the number of cars passing through the interchange tracks, and they are no longer filling up. The total number of cars picked up has increased about 20% and the number of cars that can’t be moved because there is no space ahead has dropped to about 60%.

This little exercise has shown that various techniques can be used to influence the shipment selection process during car restaging in ways that can improve the overall traffic flow on the layout. More research will probably reveal even better ways to do this without having to resort to un-prototypical assumptions or approximations.

The mechanism to influence restaging shipment selection could be brought out as a user configurable feature. So layouts might want to have lots of interchange traffic and can handle it, so this should not be a fixed feature.

What is the Best Fast Clock Multiplier?

Model railroads are often operated with a “fast clock” that runs some number of times faster than real time, in order to make travel times seem more realistic. Distances on most layouts are so short that the actual travel times between stations end up being very short. Running a clock at a faster rate increases these times to more acceptable values.

A typical fact clock ratio is somewhere around 4:1 or 6:1, as that makes a session lasting a few hours seem more like a day. But, what is the best ratio to use and why?

It is interesting to note that the actual ratio used has no real bearing on the operating session and when things happen, so long as the clock speed and the printed times in a timetable share the same rate. If it takes one real hour to switch a yard, then it does not matter if the stated time is four hours at 4:1 or six hours at 6:1, the work will still take a person one real hour to complete.

So, let’s examine some examples and how they relate between real minutes and scale minutes.

At 4:1, one real minute is four scale minutes, two becomes eight, and so on, with the scale minutes being in multiples of four minutes, e.g. 4, 8, 12, 16, 20, 24, 28, and so on. If we do the same for 6:1, we get 6, 12, 18, 24, 30, 36, 42, 48, etc. Now if we consider than most people think in terms of 5 minute intervals, e.g. 5, 10, 15, 20, 30 minutes, the scale times produced from both 4:1 and 6:1 do not map well onto the time intervals that people are familiar with.

If on the other hand we choose a ratio of 5:1, then it maps very cleanly at 5, 10, 15, 20, 25, 30, etc.

So based on this analysis, it would seem that a fast clock ratio of 5:1 yields the cleanest times for operations.

Too Much Yard Switching Busy Work

The original scheme for handling cars through the Grand Forks yard was to classify all arriving cars using a local switcher, including those cars destined for the local industries at Grand Forks. A separate switching operation would then deliver them. This seemed to work well when there were only a few trains through the town each day, but with the recent additions of Carson and Curlew and their extra industries wanting more cars, this approach has broken down. More details of the first attempt at operating using that scheme can be found in the post “That Fateful Friday”. Suffice it to say that it did not go well due to the extra traffic to be handled through the Grand Forks yard. So, what to do instead? Time for some serious rethinking of the process, and a bit of detailed analysis.

Continue reading “Too Much Yard Switching Busy Work”

Operating Grand Forks as a Classification Yard is a Mistake

At the start of operations on the S&BC, there was very little main line track to other towns. The entire layout pretty much was the Grand Forks town, plus the upper and lower staging yards. This resulted in some traffic to and from the local industries in Grand Forks, but most of it simply was interchanged between the CPR and the S&BC and went to and from the staging yards. Consequently, it made sense to operate the yard as a classification point in order to best handle the interchange traffic.

Now, with the addition of the new towns of Carson and Curlew that have in combination more industry spots than the entire layout had before, continuing to operate Grand Forks as a classification yard is proving to be a big mistake.

Continue reading “Operating Grand Forks as a Classification Yard is a Mistake”

Selective Compression of Operations

The idea of selectively compressing aspects of a model railroad has been around for a long time, but it has mostly been applied to physical things such as building size, number of windows, bridge length, etc. The motivation is that our model railroad layouts are significantly smaller than the prototype.To help compensate for this, we reduce the size or number of various elements to help make the layout seem bigger. The notion that this same idea can be applied to the operational aspects of running a model railroad has not been popular, but it will be explored here.

Model train sizes and distances are already vastly smaller that on the prototype, so we often operate with a “fast clock” to enhance the notion of time and distance, but there are a few more things that we can do from a timing perspective to enhance layout operations.

Continue reading “Selective Compression of Operations”

That Fateful Friday – or the first attempt at switching Grand Forks after the addition of Carson and Curlew

Following the construction and commissioning of the new towns of Carson and Curlew with their additional industries, a new operating scheme was developed to include service to these new towns. It was a simple extension of the one used to date, whereby trains from all four compass points would exchange cars in Grand Forks as well as service their assigned industries. The local industries at Grand Forks were switched also as part of the classification switcher duties at an appropriate point in time. This proved quite successful, and it was used during VanRail 2017 for two sessions.

With the significant increase in industries wanting cars, the classification role at Grand Forks was expected to become a full time position, leaving the local industries to be switched by a different job.

The Saturday gang bravely agreed to try out these ideas on one Friday evening that will be well remembered for all the wrong reasons. Let’s just say that my ideas didn’t quite work out as planned. If you are interested in the gory details of my analysis, it continues below the following pictures that were taken before everything went wrong.

John happily switching Darestof.
Ken and Colin trying to manage Grand Forks yard.
Continue reading “That Fateful Friday – or the first attempt at switching Grand Forks after the addition of Carson and Curlew”