Darinth wrote: Thu Oct 25, 2018 2:09 pm
A single station can generally only serve one purpose. It can be an ore pickup station. It can be a supply dropoff station. But it can't be both.
Generally, that may be true, but it is possible to build such stations. I have a station that serves both as ore pickup and supply dropoff. The downside to it is, throughput is certainly not optimal because I have the loading part on one side of the train, the unloading part on the other.
There are two stops, a pickup for iron/steel, another for coal. Trains are loaded on the outside of the tracks, in between there is an area with some passive provider chests that supplies are unloaded into if a train carries them and if they are needed at the station. (Moreover, fluid trains pass the coal station on their way to my crude oil pickup. They are routed out via a special exit that is not used by cargo trains.)
The ore pickups request a train if they have at least a train load in store and if anything they provide is requested on the network. If they are out of any supplies, a train with the missing supplies is ordered. If a cargo train arrives, I check if the station has anything that is requested on the network and use combinators to set the filters on the loading filter inserters. Likewise, if any supplies are needed, the filters on the unloading filter inserters are set, and I take care to unload only the amount needed at the station.
You could build a station with multiple stops -- some for loading, some for unloading trains, some with inserters for cargo trains, some with pumps for fluid trains, with single or double side loading/unloading -- the following way:
- Set up a bunch of train stops on parallel tracks; the first track should be a bypass (in case a train arrives because of a request that has been cancelled -- perhaps because another train with the same cargo is already being served), the last an emergency exit if a train couldn't be directed to the proper stop for some reason. All the other tracks have a stop that requests a train if there is no train holding at this stop. It also signals what it needs on both the global and a local network, . All these tracks branch off a line at the input side.
- Before that, you put a kind of routing station that reads what the train carries and sends this information down the lane (using memory cells, so the information isn't lost once the train has left the routing station. At each branch, the signal from the loading/unloading train stop (sent via the local network) is compared to the data from the memory cell. If there is any match (meaning the train carries something that is needed at the stop), the signal for this branch is opened. Once the train arrives at its designated stop, a reset signal is pulsed to the memory cells to clear them so the next train can enter.
- Put a signal in front of the routing station that is on green only if no train is in the routing station or on its way to its destination stop (i.e., it is green if no train is waiting at the routing station and the memory cells have been cleared). Otherwise, the second train could open signals for the first train that is still on its way.
In case you have a multi-cargo train and you have two or more stops needing any of this, both branches will open -- but the train will branch off to the first stop only. It may be that a train carrying copper, iron, and coal has gone on its journey because there was a request for iron, but by the time it has arrived, coal and iron may be needed -- and the branch to the coal stop is the first open one the train reaches. In this case, the request for iron would be lost, so take care to re-request any cargo a train carries that is not needed at the stop it has arrived at. (In my example, the train with copper, iron, and coal arrives at the coal stop, so requests for copper and iron are sent again to the global network.)