Stations with same name: Avoiding orphan trains

Post all other topics which do not belong to any other category.
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Stations with same name: Avoiding orphan trains

Post by zOldBulldog »

I like using the same name for mines of a given ore and closing stations when they are not ready to load. Works great so long as you have the same or more open stations than trains assigned to that name.

The problem is that when mines start running out stations close for longer periods of time, often without you noticing, and trains end up orphaned and going in circles waiting for an open station. If it gets bad enough trains run out of fuel and clog your rail lines. I looked for solutions but all seemed to have other problems.

I think I found a simple solution (concept only, not yet tried):

- Modify the mine load station blueprint to emit the signal ore=1 when the stop is enabled.
- At base create a display that shows a visual bar for each ore of how many stations are open.
- Connect an alarm (audio and text) that goes off when there is only one(or zero) mines open for the ore.

I figure that with a visual display and alarm it should be easy enough to go and add mines as needed... eliminating the problem.

To experienced train-oriented players I ask:. Does that approach make sense? Or do you know of a better no-mods solution?
BenSeidel
Filter Inserter
Filter Inserter
Posts: 591
Joined: Tue Jun 28, 2016 1:44 am
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by BenSeidel »

Couple of suggestions:
1) add a minimum 5 second wait to each timetable stop so that your trains can get re-filled
2) ensure that there is always one station with each name active at all times (unless you only have one or two trains, eg a refueling train).
3) assign trains to specific outposts with generic base unloaders, this prevents trains from running between stops.
4) have a single locomotive at each outpost to make it easier to assign trains to that outpost as needed (copy from the locomotive and paste onto a train waiting for a dying outpost).

This should set you right.
As for a visual indicator, just look at your stackers. If they are full, then the mine is dying. If you want a more in-your-face solution, then hook up a speaker to some signals & blast a warning over the map.
LaRone
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Sep 04, 2016 8:22 pm
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by LaRone »

I use a similar system for my Outpost; for clearance for all of you new to this concept this enables you to just hook up another Station with the Recurring name like "Iron - Mines" and the Trains start to automatically drive to that station without you having to deploy more Trains and it reduce the amount of time Trains by quite a Lot (they spand more Time driving around and less time Waiting to fill up)

A somewhat feasible solution to your Problem could be to do a Detection System for the number of "Open Stations" and add a "Dummy" Station that opens when no other Station is available and gives Trains a Option to refuel.

Maybe build it Logically in the way that you add a Useless item like Waterbarrels for every Open station and when the Amount of Waterbarrels is 0 for longer than 30 Seconds Open the Dummy Station (Still namend "Iron - Mines")

And to Ben, i think you misunderstood the concept
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by zOldBulldog »

Although I didn't give the details I am already doing most of that, and thank you guys... Your r 8-) ecommending it unprompted tells me I am roughly in the righrt track.

----

@ben:
1) I have not added a delay but by using stack inserters I seem able to keep my rains fueled. I use 1-2 trains for local traffic and plan to have trasboarding stations to separate the big trains I will use for long distances, my hope is that I can avoid the fueling delays by not going too far for local traffic. Long distance trains will almost certainly need the delay you suggest, so good recommendation! Also, all of my fueling happens at the main base unload.

3,4) My mine stations handle 2 trains, one loading and one queued up behind it. Details:
- Stations for the same ore use the same names. As LaRone said, it makes it very easy to replace or add stations, as the trains reroute automatically. The key here (and reason for the post) is to maintain (mines * 2 >= trains).
- The stations get disabled when occupied... but that happens when 2 trains are in them, so it wastes out.
- The mine stations also get disabled when they don't have enough ore for a full load. This is the real problem I am trying g to solve... and the displays and alarm look to be the best solution, as they will also let me keep ore volume at the desired levels. For a partial solution (or a quick band-aid to silence the aldms) see my reply to your point (2).

2) You read my mind. I recently added a constant combinator to my mine station blueprint that controls whether the stop gets disabled when it doesn't have enough ore for a full load. So now I set one station with the combinator on, and the rest off. In a pinch I can turn on the combinator for underperforming mines until I can setup more mines.

---

@LaRone:

Yes,the detection system quickly became the obvious answer. Good thing all my rails carry power, red and green wires. It is making it easier to do.

I think I might be able to avoid the edges station with the combination of alarm, not exceeding 2 trains per mine, and keeping one of the mines with the combination off. I'll update the post after I thoroughly test

----

- I just started, reconfiguring one mine station station to send out uranium=1.
- Next step is the display that shows number of open stations for each ore.
- Then will come the alarm that rings when (ore < 2).
mergele
Fast Inserter
Fast Inserter
Posts: 191
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by mergele »

Make a fallback station. An empty station that goes active if no other mine stations for that given ore are active. It collects your orphaned trains, keeps them fueld and off the main network. Give it a direct rail from unloading to there without intercepting the main line and back. Disadvantage is that orphaned trains may end up travelling back and forth needlessly if stations go out/on while they are underway, but I'd say still ways better than going orphaned randomly.
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by zOldBulldog »

I like the idea of the orphan station, but I am having trouble conceiving a mechanism that will release one - and only one - train when a mine opens.

How would you build such a thing?
mergele
Fast Inserter
Fast Inserter
Posts: 191
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by mergele »

Somehow I seem to have missed LaRones comment seems we both are talking about the same idea. Sorry for that.
The way I'd do it is an extention of what you are already doing. When the signal comes that triggers the alarm you also activate a dummy station, named exactly like the mine stations, and put a signal in front of it that you turn red. Then once you get a signal again that one of the other mines is active you close the station and turn the signal red. That way if no mies are actve this station collects all trains and releases them once mines are active again, while the signal holds them in place and prevents them from wasting coal going unload-dummy-unload in cycles. Problem is that once a mine becomes active all the waiting trains rush over to it immediately.
Ironding that out and building a release one train at a time mechanism goes a bit deeper into combinators. Basically you would require a change in amount of available mines before turning the release signal green and switching it back once a train passes it.
Dune
Fast Inserter
Fast Inserter
Posts: 212
Joined: Tue Dec 12, 2017 4:27 am
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by Dune »

1) Make the furthest mine as always enabled. With a stacker if you'd like. Trains will prefer the closer mines. If you use YARM, you'll know when mines get low and in need of adding new mine outposts.

Or

2) Have a mine outpost available for each train.

I prefer number 1, but 2 is another solution.
Image
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by zOldBulldog »

mergele wrote:Problem is that once a mine becomes active all the waiting trains rush over to it immediately.
Ironding that out and building a release one train at a time mechanism goes a bit deeper into combinators. Basically you would require a change in amount of available mines before turning the release signal green and switching it back once a train passes it.
This is the bit that has me stuck.

Bad news:. Although I am reasonably OK at combinators, I don't *yet,* have the level of combinators design skill for this.

Good news:. From your statement I infer two things:. You are saying this kind of combinators logic is doable and normal for skilled combinators designers. You seem to have done something with this level of combinators logic in the past.

So I conclude that it is possible and that all I need is to learn some advanced combinator skills.

Thanks!
mrvn
Smart Inserter
Smart Inserter
Posts: 5924
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by mrvn »

Disable mines when there is a train present or not enough ores. Have an unloading bay for every train at the smelter.

Now as the mines run out the trains will remain at the smelter till one of the remaining mines has enough ores. They will no longer constantly drive around or stop in the middle of the tracks. Drawback is that when a mine opens up all idle trains race for it and all but one return empty. But if that becomes a problem then you should open more mines as you will also run low on ore.

You can also sound an alarm if to many empty trains are sitting at the smelter or simply when the ore gets low because not enough full trains come in.

PS: Don't have one train per mine. One train can easily handle ten mines if you use longer trains.
Durentis
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Jun 27, 2016 3:55 pm
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by Durentis »

This thread really caught my eye because I've noticed orphan trains in much the same setups as described but never dealt with them in an adequate way.

Apologies for the atrocious rails, as I lack good rail blueprints at the moment and got super lazy with a randomly downloaded book, but I have put a blueprint string for a possible solution that I've been working on today with thanks to the various community members that posted such helpful references for circuit networks. Combinators 101, by GopherAtl, was very helpful, especially the pulse generator - the absence of which was driving me nuts when trying to count trains.

Essentially, you have input stations all named the same (where you mine ore or whatever), output stations (where the train drops off resources) with unique names (preferably) or the same name, and a main stacker where all trains go to be held.

The input and output stations in the example require 1-2-1 trains but if you're putting local stackers in output stations, you may as well be switching to single headed trains, which this should work just as well for. Just make sure that when you make a one-way input station, the counters are on the output line after they are filled so that the trains are counted after the demand is potentially diminished (if that station's capacity drops below a train load).

The input stations convert their current capacity (Signal C) into a demand (Signal D) for their resource - one station accounts for 0 or 1 demand on the rail network. The calculations depend on the stack size and quantity that fit in the trains you're using, so will need to be edited to suit. You can mod the input stations with local stackers to give them increased demand on the rail network if you wish - 1 demand per train that can be loading or waiting in the local stacker and not blocking the main rails.

This example uses output stations with the same name and no local stacker because it simplifies things and helps get rid of resources but you should have unique named output stations with as many trains assigned to it as fit in that station's local stacker. This helps to keep trains off of the main rails no matter what state the trains are in.

The stacker counts how many trains are released and compares it to the number of trains counted at input stations and the current demand in order to decide if it should release a train. It releases if Demand > Released - Input Station Count. The stacker needs enough room to hold all trains in the network as they can all end up at the stacker if the demand reaches 0 and they all finish unloading.

This example is for only one type of resource (iron ore). To expand to copper ore, oil, etc, you just need to stack the stacker and change the D, I, and R signals to another set of three unique to the other resources. The stacker needs to have one output line with its own counter for each resource for which it supports trains. Edit: Also, station names in the main stacker must be unique to a given resource and lead only through that resource's counter. So you'd want something like "= Iron Ore" station names for trains going through the iron ore counter, "= Copper Ore" station names for trains going through the copper ore counter, etc.

There's some setup involved with these blueprints:
For the modded string, you'll need the fixed Creative Mod and the Belt Spawner mod installed. Comes with nuclear power bootstrapped by solar and ready to go (water connections up to you).
For the core string, just drop it wherever you have room - I removed the spawners and you'll have to power/feed it yourself if you care to more than look at the bits.
For both, you need to create 1-2-1 trains in the stacker and set them to the following stations in order:
> Iron Ore until Full Cargo Inventory
< Iron Ore until Empty Cargo Inventory
= Stacker (pick a wait condition and delete it)
Again, create the trains in the stacker and let it release them into the system from the very beginning. Input stations need not be full or even created before finishing the stacker and populating it with trains but things should just work once they are.

If for whatever reason you need to reset the system:
- cut the rail exiting the stacker so the trains have no path to the input stations and let them return to the stacker (none should be in or on route to an input station)
- find the arithmetic combinators with a + and change them all to * and back to + to reset the I and R signals to 0.

Hopefully I have the logic right, or at least right enough to solve the posed problem. Will try to improve on this another day.. perhaps when .17 comes out, or someone points out major problems with it.

Anyway, I hope this is helpful to someone. Thoughts and criticisms?

Core Blueprint String:


Blueprint String with Creative and Belt Spawner Mods
Last edited by Durentis on Wed Mar 06, 2019 9:59 pm, edited 1 time in total.
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Stations with same name: Avoiding orphan trains

Post by adam_bise »

Fast example:

For x mines y trains add y=z wait stops of same name per mine group (e.g: iron wait) in a central location.

Add the common wait station stop prior to mine scheduled to wait on non existent circuit condition on each miner train
combinator y (trains const) - x (enabled mines) output z
Wait station 0 enabled when z>0, 1 when z>=1 and so on.
Alarm when z = x-1 perhaps.

This will cause every train with no enabled mine to wait at the wait station for more enabled mines.

Adjust to your train size and distance etc.
Post Reply

Return to “General discussion”