Part 4
Since I posted Part 3 of this blog series on JMRI Operations I have learned that my interpretation of how JMRI selects cars for populating trains was not correct. I had inferred that JMRI was simply selecting the cars to use based on the order it found them in the database. A posting by RSeiler suggested that, in fact, the list was ordered based on the number of moves the car had previously made. The number of moves is shown in a column in the cars form.
I reset all the car moves to zero using the Tools -> Roster -> Reset move count all cars menu option on the cars form and tested this. RSieler is correct. After I had reset the car moves, the red and blue grain hoppers were sent to Bakery alternately.
For the record, I was going to use a solution that involved inserting a Yard between Bakery and Cassette and introducing a Cassette Turn train to move cars between Yard and Cassette and modifying the Bakery Turn train to run between Yard and Bakery. This also gives the desired result of alternating cars from a pool of cars. The only “trick” was that there had to be separate Yard tracks for East and West bound traffic so that a car from Bakery would not be returned to Bakery from the Yard.
Benny and dkramer suggested using an interchange instead of a yard which also has possibilities. I didn’t test this because the spur to spur solution came up and is simpler and, I think, more elegant.
That’s the great thing about doing a worked example in a forum. People suggest alternatives and a better result sometimes emerges. Thanks to everyone who made suggestions.
To recap, I now have a train that runs a Turn job between Cassette and Bakery. Bakery has differentiated spurs so that I don’t get more train cars of a specific type (e.g. grain hoppers) than I have spots at the industry. The Bakery Turn job will also select the cars to include in a train based upon the open spots at Bakery, the type of car allowed in the spot and the number of moves the car has taken relative to all other cars of the same type.
So far, the cars being shunted only have loads of ‘L’ and ‘E’ representing the default cars states of ‘Loaded’ and ‘Empty’ respectively. If I wanted to, I could just increase the list of car types to include all the particular combinations needed.
Let’s take the tank cars for example. Up until now, I have been using the car type ‘Tank Food’ to represent all the tank cars at Bakery. Instead, I could define new tank car types – Tank Fructose, Tank Maltose, Tank Sucrose, Tank Corn Syrup 100, etc. – and use those to create a greater variety of tank cars at Bakery.
In fact, this is the approach Arthur Houston recommends.
I am not such a fan of this approach for a couple of reasons:
- It ties the car and load together forever. Think of boxcars. They may carry many different loads in their lifetimes. If I assign a box car to the ‘Boxcar Cereal’ car type. Then that car cannot carry, say, baked goods.
- It complicates the setting up of locations and spurs in that the number of types of rolling stock that must be managed.
It does, however, mean that I will not have to consider schedules and custom loads at this point.
But, what the heck! This is supposed to be a learning exercise, to Schedules and Custom Loads ahoy!
Any reasonably complex industry will receive and ship a number of different loads. Take the Bakery for example. The following table describes just some of the commodities it could receive and send:
Commodity | Car Type | Receive/Ship |
Vegetable oil | Tank | Receive |
Maltose | Tank | Receive |
Dextrose | Tank | Receive |
Sugar | Box | Receive |
Shortening | Box | Receive |
White Flour | Hopper | Receive |
Brown Flour | Hopper | Receive |
Milk Powder | Box | Receive |
Yeast | Box | Receive |
Pie Fillings | Box | Receive |
Baked Goods | Box | Ship |
As you can see, Bakery has a high demand for many varied commodities and this is by no means a complete list.
So, how can I use JMRI Operations to model this activity? The first thing that comes to mind is that I have not divided the box car spur into receiving and shipping spots. The other spurs, for grain hoppers and tank cars, only receive cars.
I decide that Bakery will use three spots for receiving and two spots for shipping. I also want to change the tank car spur name to receive any Tank Food tank cars.
So, now I am going to restrict my set of available cars to just the box cars while I work on this. I do this by using the ‘Set’ button in the Cars form to set all the other cars to have no location. I also set all the box cars to be located in ‘Cassette’. I’m also going to change the color of the box cars so that I can see what is happening a bit easier. When I am satisfied with the results, I will return them to their true colors.
So, now I want to start to develop the different loads (commodities) that each box car may contain. I look at the table I created above and see that box cars may contain the following loads: sugar, shortening, milk powder, yeast, pie fillings and nothing.
By ‘nothing’, I mean that the box car is empty when it is spotted at Bakery. I will use a load name of ‘MT’ to indicate an empty car. As I understand it, “MT” was railroader’s shorthand of just this.
I use the ‘Edit Boxcar Loads’ form (Cars -> Edit -> Load -> Edit) to add these loads to the selection of box car loads.
The list of available box car loads now looks like this:
Now that I have defined the box car loads, I need to indicate where those loads are to be shipped to in the Bakery. I do this by editing the spur tracks at Bakery (only the box car ones for now) and creating schedules for them.
Schedules add an extra dimension to the operations model because they not only allow me to refine which loads and how many are to be received, they also let me define when or in what order goods are to be received. I will touch upon the when and what order more a bit later.
For now, I add a schedule for the receiving box car spots. I add an entry for each possible inbound box car load. I also set the schedule mode to ‘Match’. This will cause JMRI Operations to try to match as many inbound loads as possible. If I left the mode set to ‘Sequential’, JMRI would only use the load marked by the “Current” indicator "--> ".
I have also set the ‘Ship’ load value to ‘MT’ as opposed to ‘E’. This will help later on.
Now I want to set up the shipping spurs. But wait! What load am I shipping from Bakery? I look at my Bakery commodities table as see that I want to ship “Baked Goods”. I need to add that to my set of loads for box cars.
Now I can finish editing the schedule for box cars shipped from Bakery.
I decide to build a Bakery Turn job to see how it goes...
There is no work to do. What did I miss? What does the Train Build Report tell me?
Aha! The box car schedule cannot find any box cars that match my criteria. I forgot to set the loads for the box cars in Cassette.
I decide to set up the loads as follows:
Car Color | Load |
Green | Sugar |
Orange | Shortening |
Purple | Pie Filling |
Tuscan | MT |
Yellow | MT |
I reset and then build the Bakery Turn job again.
Now that’s more like it! I move and build a few more trains to see what happens.
On the next build, only the box car with the Pie Filling is returned MT to Cassette.
On the build after that, no work is to be done!
The Train Build Report contains this entry:
JMRI could not find a spur that was demanding ‘Baked Goods’, so it could not move the car. This reveals an important point when using custom loads: Commodities shipped from one location must have a corresponding receiving location.
I set up the Cassette location spur to receive the goods from Bakery by adding a schedule to the spur and reset and build the train again.
The Train Manifest looks like this:
When I build and move the train a couple of times, I see that only the MT box cars are being routed to Bakery. Looks like I need to fill in the ship values on the Cassette spur schedule.
I still get only the MT box cars being shipped when I build the Bakery Turn job. Maybe I need to add the Destination too.
Success!
I build and move the Bakery Turn job a couple of times and watch the box cars move between Cassette and Bakery as I would expect.
So, what lessons have I learned?
Well, I would have to say that adding Schedules and Custom Loads adds a whole new complexity to setting up JMRI Operations but I like the fine-grained control it gives me. Also, I have to start thinking in terms of complete shipping cycles: from the creator of a load type to the consumer and back again. I also have to think in terms of the commodities associated with an industry - both inbound and outbound.
In the next part, I want to look at adding more box cars at Cassette to make sure I get a good mix of cars and to look at the effect of setting the hits and wait values in a schedule. I also want to explore some of the other reports JMRI gives me but that may be in a later posting.
As always, your comments and suggestions are most welcome. Together, we can learn so much more.