Page 1 of 1

Even Stations

Posted: Sun Nov 26, 2017 1:26 am
by leitk
I'm trying to send trains to multiple stations with the same name, but it always goes to the nearest station.
I've set it up to disable the station if it doesn't have enough to fill or if it is currently busy, but since the loading takes only a few seconds, and my current need is less than that, the trains always go to the closest station.

What I'm hoping to have is that I can name n stations the same thing and when a train is available it goes to the next station that has enough to fill it.

Re: Even Stations

Posted: Sun Nov 26, 2017 1:36 am
by impetus maximus
wire train signals to the chests. if the station that fills more often is > than the next, give it a red signal.

Re: Even Stations

Posted: Sun Nov 26, 2017 3:03 pm
by leitk
I don't understand what you're saying.

By greater than the next you mean if it has more in the chests?

I can turn off the stations if there isn't enough in the loading chests, but that doesn't happen often, and even so greatly favors the closest station.

Re: Even Stations

Posted: Sun Nov 26, 2017 9:12 pm
by Jap2.0
Yes - if there isn't enough in the chests for another train, disable the station. If that rarely happens then you need more and bigger trains, and if your base can't use that many resources, increase production.

Re: Even Stations

Posted: Wed Nov 29, 2017 3:20 am
by leitk
Jap2.0 wrote:increase production.
Well in order to do that I'd have to grab some additional territory, and while that would just mean pasting more laser turrets, I've done that a few dozen times and it's gotten old....

Re: Even Stations

Posted: Wed Nov 29, 2017 3:48 pm
by impetus maximus
sorry i haven't given you an example build/save. i've been working on my blueprint library.
i'll try and upload a save today.

Re: Even Stations

Posted: Wed Nov 29, 2017 9:57 pm
by leitk
I'll probably work on a recursive blueprint for expanding territory, then I can expand enough so that hopefully it doesn't matter.

Re: Even Stations

Posted: Thu Nov 30, 2017 7:49 pm
by Avezo
I would suggest instead of disabling/enabling stations, use wired signals cutting acces to said station off.

Re: Even Stations

Posted: Fri Dec 01, 2017 1:03 am
by leitk
I could do that, but I don't understand the difference really. Except that in the pathing discounts red signals that are far away, so it could still send a train to the station that is distant. A red signal where the train can reroute to the other station would still work, but why is that better than just turning off the station?

Re: Even Stations

Posted: Fri Dec 01, 2017 5:23 am
by tuplex
Turning off stations can cause problems sometimes. Like if all of the destination stations are turned off, where are your trains going to stop? Just something to watch out for.

You might try connecting the inventory of all of your like stations together with a circuit network, and then set it up so that the station with the most items is turned on. That way you will get the load balancing that you seem to be looking for.

For example, if you have three iron stations, at each station, use a arithmetic combinator to calculate the average iron content (total / 3). Then check each station's contents against the average. If it is greater than the average, enable that station, otherwise disable it. That way at least one station will always be active, so your trains will always have someplace to go, and it will always be station(s) that have the most material.

Re: Even Stations

Posted: Sun Dec 03, 2017 1:26 pm
by quyxkh
leitk wrote:Except that in the pathing discounts red signals that are far away
I think that's not true:

Code: Select all


        if ((outSignal && outSignal->getReservedByCircuitNetwork())
            || (neighborInSignal && neighborInSignal->getReservedByCircuitNetwork()))
          costFromStart += 1000;

        if (!neighbor->getBlock()->isFree(request.train))
          costFromStart += (2 * neighbor->getLength()) / (currentNode->blockDistanceFromStart + 1);

[/url]

you can see it discounting for distance with the currently-occupied block penalty, but a wired-red signal adds a straight 1000-tile cost.