Yo, kann_, first of all let me say I still owe you a longer reply to your initial post here regarding your train scheduler that you posted about on Reddit. The short version is that I like it a lot and I don't think it's using too many combinators for what it actually does. You should make more detailed documentation about it, maybe with diagrams. Not only for others to read but also for yourself, in a few months you will need it if you want to continue working on your system.
kann_ wrote:This didn't happen with my version of SmartTrains, but I didn't update for a while. Are you sure it is not due to a signal right next to the station?
I do have signals right next to my stations but that can't be the reason, because the problem only
sometimes occurs; it's kind of random. It also happens even if the stations are completely isolated, with no other train passing the signal behind that station, so I really don't think it has anything to do with the signal.
In any case, even if there is a signal right behind the station, the train should always stop exactly ONCE, then wait for a signal AT THE STATION (not the rail signal, the station signal), then leave. Currently what happens is that the train actually stops TWICE (or more often, can't really say, I assume it's twice).
The problem with that is, if you use any kind of simple edge detection that waits for the "Train-at-Station" signal to go from "1" to "0", then your edge detection will also trigger twice -- and that fools the circuit into believing that the train has left the station, when in fact it is still sitting there waiting for a signal.
Btw. my outposts keep track of the trains that are send to them. Feel free to copy that part.
I have a few more ideas for how to extend my system, but this is the one thing which is absolutely last on my list. Keeping track of trains is only useful in the most extreme cases (when you have cleared a 5000x5000 grid on the map and your ore fields are massive). In 99% of scenarios (even megabases), if your trains are long enough (4 wagons or more), then it does not really improve performance to have "train pipelining" (as I like to call it).
This is NOT to say that the depot won't be bottleneck in megabases, it probably will when you have a lot of trains -- but train pipelining will not help at all in that case.
Train pipelining also complicates a few others matters quite a lot, so I'll probably never add it to my system.
I thought about using barrels for oil, but it seemed a waste to one train to bring barrels and leave empty and a second train to come empty and leave with oil.
Basically I have two main stations now. One for oil trains and one for normal trains. I use oil tankers, but a train with empty barrels is the same thing.
I'm not managing barelled oil at all with the logistic train network. It would require stations that can be requesters and providers at the same time (or modify all your trains to have an extra Rail Tanker wagon, which is really ugly).
I thought about combining both stations and adding a detection mechanism for the type of train, but than they block each other. There is really no way around separated systems for the train types. Unless you accept that there will be two trains moving for every load of oil.
What I want to add after 0.13, because it will be completely awesome, is that the providers can provide more than one type of resource.
For example, an Oil Refinery could provide Plastic Bars and Sulfur.
Or your mining outposts could provide multiple ores (that's useful with certain mod packs).
The problem to solve is that when a train arrives it is not supposed to pick up everything at the provider, but only the resource that was ordered for that particular roundtrip (unless you allow mixed wagons, but that is completely nuts). So the provider needs to be told what type of resource the incoming train wants to load (that's really easy because the information is already on the wire, we only have to use it). Then we also need to program the inserters at the provider to only load that particular resource on the train.
With 0.13 we get those high performance inserters that are also programmable, so it will be perfect to implement this.
The other thing I want to add is resource bookkeeping for the requesters (I think you already have that in your system), so that the requester will discount the resources it's about to receive. This will make the scheduling a bit more "tight", but it's not really super important. It makes it pretty but does not really improve performance by that much.
Many of these "advanced" featured that make the system look awesome (like train counting, resource flow prediction, etc.) really do nothing for the performance of the system; I want to add the stuff first that makes the scheduler more useful and more powerful.