News:

Please read the Forum Code of Conduct   >>Click Here <<

Main Menu

Simplistic Cargo Loading Program

Started by Big Sol, August 13, 2007, 09:43:13 AM

Previous topic - Next topic

Big Sol

As an amatuer programmer, I've decided to create a simple cargo loading delay program for use in model railroading. The program is nothing fancy. All it does is provide load/unloading delay timers so that you can simulate the time taken to load each car with cargo. Here's a screenshot:

http://i88.photobucket.com/albums/k193/bigsol81/CargoLoaderBeta.jpg

Basically, you click the "Load This Cargo" button when your train is stopped at a station that supplies this type of cargo. This will then cause the bar below the buttons to slowly fill up, the speed of which varies from one cargo type to the next. Once it fills, the "Current Carloads" for that cargo type increases by 1.

Once you arrive at a station that can accept that cargo, you click the "Unload this Cargo" button, the bar fills up to indicate the unloading process, and once full the number of carloads decreases by 1. Clicking the unload cargo button when the current carloads is 0, obviously, will result in an error message.

The "Track Operating Costs" box is an experimental feature. Every ten seconds, it increases the total operating cost of your railroad. Eventually, I plan to have that operating cost increase depending on the number of locomotives you currently use, as well as other factors. Currently, the cost of operating the railroad increases by 800 to 1500 units every ten seconds. I use ambiguous 'units' of currency, but the final program will allow the user to select whatever symbol for currency that they desire. In addition to maintaining the railroad, each time a carload of cargo is unloaded, the "revenue" box increases. This amount is determined by the cargo, and the price varies from one type of cargo to the next. For example, a carload of mail generates less revenue than a carload of passengers.

Speaking of carloads, I've currently only got the five types you see, and this is how I've broken them down:

Mail - Obviously, this is envelopes, letters, and other small, light packages. Mail, due to its relative low density per square foot of cargo space, is lightweight. Mail loads faster than any other type of cargo, but also provides the lowest amount of revenue. It only takes 10 seconds of real time to load one car full of mail.

Passengers - Again, this is obvious: People. Passengers provide a very large variance in revenue depending on the type, their ticket reservations, etc. Passengers actually take longer to load than Light Freight due to the added time it takes to load on luggage, have baggage checks, make sure everyone is seated and comfortable, and other 'people' concerns. It takes 18 seconds to load one car of passengers.

Light Freight - Now, for the purposes of keeping things simple for this program, "Light Freight" refers to any perishable goods. This includes not only foodstuffs such as grain, beef, and poultry, but also livestock. Essentially, anything that can't be left sitting on a sidetrack or in a yard for very long. Light freight takes 15 seconds to load one car.

Medium Freight - This refers to any freight which is still somewhat important in terms of delivery time, but not something that will die or go bad while sitting on a side track. This generally includes manufactured goods such as computers and other electronics, furniture, home appliances, automobiles, and other larger cargo items such as those things ordered for shipping delivery Medium freight is often bulky and heavy, thus it takes 20 seconds per car of medium freight.

Bulk Freight - By this definition, "bulk freight" covers anything that is, in essence, 'not a big rush' and can be left on side tracks or in train yards for several days or more without a big hit to profits. Usually, this covers industrial goods such as coal and petroleum, as well as construction materials like lumber or steel. Bulk freight, due to its sheer weight and mass, takes 30 seconds per carload, but often provides the largest revenue per carload.

Those are the basics of the program. Now, my primary reason for posting here, aside from announcing the program itself, is that I'd like some ideas on the cargo system. Mine, as I said, is very generalized. However, I've come up with a more complex system using the following cargo types:

Mail & Passengers - Obvious
Grain - Includes cereals, as well as barley, hops, and other brewing materials. Also includes Salt, Sugar, and other bulk foodstuffs.
Produce - Both fruits and vegetables.
Meat - It's all frozen during shipping anyway, so it's grouped into one type.
Livestock - Both small and large.
Bulk Freight - Groups industrial metals (steel, iron, copper) and fuels (coal, petroleum) into a single category.
Textiles - Wool, felt, yarn, cloth, etc.
Automobiles - Also includes other vehicle shipments.

I can't come up with anything else specific, but this should be more than sufficient I should think. Also, I wanted to note that my program is designed to be a utility, and by no means a 'game' of any sort, so anyone hoping for something like that would be disappointed. Think of it as a very specialized calculator.

Opinions? Suggestions? Criticism?


SteamGene

Interesting concept.  You do seem to have mixed eras.  Mail doesn't go by rail any longer, nor does livestock.  Meat may be shipped fozen now, but it didn't used to be. 
Have you thought of  putting something to mess up loading or unloading - the fat lady with many bags who doesn't want help - the bull who gets cranky?  the flat that slips?
Gene
Chief Brass Hat
Virginia Tidewater and Piedmont Railroad
"Only coal fired steam locomotives"

duker1

Have you taken into consideration the Union thugs who have to load and unload the loads? Time delays for coffee breaks/lunch and then strikes and meetings?  :D
Have you thought about double stacks and piggy backs? Especially at dockside with loading on/off ships.

Just my thoughts to enhance your program.

The Duke....
:D

Big Sol

Implementing those might not be too hard.

I can implement a generic "loading mishap", which you can leave to your imagination depending on the cargo that suffers the mishap, the effect being a random chance that could double loading time.

As for mixed eras, I did that on purpose since I know many model railroaders out there sometimes run their models in earlier eras, while others run later era railroads. And, on that note, I could've sworn that I've very recently seen livestock cars here in California. I may be mistaken...aren't they the boxcars with the thin horizontal slots on the walls?

Conrail Quality

Maybe they were old livestock cars now being used as regular boxcars. Frieght cars last a long time...a few weeks ago I saw a boxcar in full Great Northern paint on a BNSF train. Or look at Amtrak's baggage cars, not a single one younger than 50 years old.
Timothy

Still waiting for an E33 in N-scale

SteamGene

I've heard of stock cars being used to transport ties, (railroad, not the ones Aunt Agatha sends you for Christmas),  some forms of junk, and other items that need support, but not weather protection.  but, AFAIK, stock cars haven't transported live stock in at least 20 years. 
Gene
Chief Brass Hat
Virginia Tidewater and Piedmont Railroad
"Only coal fired steam locomotives"

Big Sol

#6
That would explain it. I've never actually seen COWS or anything in the stock cars I've seen...

There are probably a lot of things on the list that don't get transported by railway anymore. I'm not even sure produce is transported by train. Still, though, I'll leave them in. After all, imagination is nice in this business, and you can mix a fair share of realism with a little imagination for cargo consists.

And, speaking of the program, the new one using all of the cargo types listed on this post is coming along beautifully. Even the mishaps work. Every time you load or unload, there's (currently) a 5% chance that a mishap will occur, which doubles the loading/unloading time.

Eventually, I will make mishap chance, revenue amounts, operating costs, loading/unloading speeds, and all the rest of the variables in the program customizable though a configuration menu. That way, if your railroad has some spiffy new (real or fictional) cargo loading system that loads steel girders 50% faster than usual, you can modify the program accordingly.

Guilford Guy

So, um when do we get the program...
Alex


SteamGene

Sol,
Another thing you might want to look into are unloading variables.  For instance, in the 1950s finished lumber often went by boxcar and was loaded and unloaded by a team of men manually.  It might be 2, 4,6, or even more - but no forklift, no power.   In the same way a coal hopper at your local coal dealership unloaded by the bay doors in the bottom of the car, while cars unloading for water shipment were often picked up, turned over, and dumped, then  placed back on the tracks. 
So you could have variables:
gravity unload
dump unload
manual unload
mechanical/mechanical assisted unload. 

In addition you could have loading at the coal tipple vs loading at a dump truck ramp, where a ramp came over the siding and dump trucks backed up and dumped their coal into the waiting car.  Had to take longer than from a tipple.

Gene
Chief Brass Hat
Virginia Tidewater and Piedmont Railroad
"Only coal fired steam locomotives"

Summertrainz

im impressed...
i am
keep working on it!
it sounds like you know what your talking about
and like is there a way we can download it for our own use?
<a href="http://photobucket.com" target="_blank"><img src="http://i234.photobucket.com/albums/ee255/luciancool/signature.jpg" border="0" alt="Photo Sharing and Video Hosting at Photobucket"></a>

Dr EMD

Freight trains moves freight.
Cargo goes on trucks.
Ships ships shipments.

Shouldn't it be "Simplistic Freight Loading Program"?
Electro-Motive Historical Research
(Never employed by EMD at any time)


RAM

 I have seen stock cars being used to transport watermelons. 

Big Sol

Heh, don't worry, I'll be releasing the program for public use once I've got a stable working version with enough features that I feel it's actually worth using. At this point, it's still pretty slim...

As for unloading variables, adding in each type of loading process for each cargo type would simply take too long and be a huge process at this point. Not saying I couldn't do it, but I think that allowing the user to manually specify the amount of time it'll take for each cargo type would be a little more efficient and open ended.

It shouldn't be too long before I have something ready for release. I just need to learn how to do a few more programming tasks before I can complete the program...maybe in three or four days.