This seems as a dilemma that must have come up before, but I wasn't able to find question about it.
The Problem:
How to differentiate between different station types so that I can send the correct train to it.
Summary:
I want my provider stations to send a signal for their resource with a value that indicates the type of train it wants (1-4,1-8-1 or fluid).
The problem being that several p-stations of the same resource will multiply that value thus confusing the trains interrupts.
There may be a need for more types later on.
Context:
So I have my own version of LTN.
- Requester Stations (R-Stations) send a green wire signal to a radar stating resource and how many trains of that resource it needs("iron plate 15" mean it needs 15 trains loaded with iron plates to be satisfied). And only if the following conditions are met:
- There is enough space for at least one full train worth of the resource.
- Provider Stations (P-Stations) send a red wire signal to a radar stating the resource. The value is always one("iron ore 1"). And only if the following conditions are met:
- There is a green wire signal for that resource larger than zero(meaning there is a request for it.)
- There is enough resource in this stations to fill at least one train worth of the resource.
- Train Depot
- Trains are dispatched from here whenever they get a red resource signal(meaning there is both demand and supply available for that resource)
So far so good.
Furthermore I have three types of trains(so far):
- 1-8-1 trains(8-trains) for mining resources(ores)
- 1-4 trains(4-trains) for other solids
- 1-8-1 trains(f-trains) for fluids
The problem is I need to know what kind of train can take what kind of resource.
My first solution was multiply all the resources signals sent by p-stations for 4-trains with 1000 and have their loading interrupt look for signals >= 1000.
It worked for a while until I wanted to incorporate fluids. My genius idea to multiply fluid signals with 2000 failed quickly since several p4-stations for the same resources would send multiples of thousands thus sending f-trains to them.
So I feel I should be able to use prime numbers and mod somehow, but so far don't have a good solution.
I hope this makes sense

Let me know if it needs clarifying somewhere.
Anyway thanks for reading this far
