Page 1 of 2
train schedule condition: outer AND support
Posted: Fri Dec 04, 2020 12:06 pm
by oleg4f
Hi.
We have an outer OR in a train schedule condition. But we also need a support for outer AND. If i need something like this in a departure condition - (C1 || C2 || C3) && C4, then i need to transform it to (C1 && C4) || (C2 && C4) || (C3 && C4) which looks ugly and hard to read.
Outer AND feature allow to not to transform a complex condition to an even more complex and ugly to read condition.
Example:
Condition:
(red < 100 OR green < 100 OR blue < 100 OR gray < 100 OR pink < 100 OR yellow < 100 OR white < 100) AND 30s passed
Must be transformed to:
(red < 100 AND 30s passed) OR (green < 100 AND 30s passed) OR (blue < 100 AND 30s passed) OR (gray < 100 AND 30s passed) OR (pink < 100 AND 30s passed) OR (yellow < 100 AND 30s passed) OR (white < 100 AND 30s passed)
Re: train schedule condition: outer AND support
Posted: Sat Dec 05, 2020 8:30 am
by ssilk
And why do you need that?
Re: train schedule condition: outer AND support
Posted: Sat Dec 05, 2020 9:23 am
by jodokus31
ssilk wrote: ↑Sat Dec 05, 2020 8:30 am
And why do you need that?
I think the why is clear, isnt it?
To dont have to transform a complex condition to an even more complex and ugly to read condition.
The question for me is more, do I have to create such complex condition for trains? How would it be possible gui-wise, etc.?
I remember that it was a topic some time ago and was rejected bc too much effort or sth? Cant search properly atm.
Re: train schedule condition: outer AND support
Posted: Sat Dec 05, 2020 10:00 am
by asheiduk
An example from my actual base: A train supplies the science packs to my lab cluster. The train shall fetch new science packs when/if one of the colors is below a certain threshold AND a certain time has passed. The later term prevents immediate departure when the last run did not fetch enough packs i.e. production is blocked or to slow. In that case immediate departure is futile.
The actual condition is:
(red < 100 AND 30s passed) OR (green < 100 AND 30s passed) OR (blue < 100 AND 30s passed) OR (gray < 100 AND 30s passed) OR (pink < 100 AND 30s passed) OR (yellow < 100 AND 30s passed) OR (white < 100 AND 30s passed)
Is is PITA to setup and even more PITA when I want to change the timeout. An "outer AND" would simplify it to:
(red < 100 OR green < 100 OR blue < 100 OR gray < 100 OR pink < 100 OR yellow < 100 OR white < 100) AND 30s passed
Re: train schedule condition: outer AND support
Posted: Sat Dec 05, 2020 10:23 am
by steinio
Yes, please.
Re: train schedule condition: outer AND support
Posted: Sat Dec 05, 2020 12:41 pm
by oleg4f
ssilk wrote: ↑Sat Dec 05, 2020 8:30 am
And why do you need that?
Hm. This is obvious and jodokus31 already answered this:
To dont have to transform a complex condition to an even more complex and ugly to read condition.
I have a case exactly like asheiduk wrote:
(MANY_OR) AND TIME passed
But factorio doesn't allow to write outer AND, thus i transform this expression to ugly:
(AND) OR (AND) OR ....
And when i need just to change time value i need to change it in many places. This is uncomfortable and whole expression looks ugly and hard to read.
Re: train schedule condition: outer AND support
Posted: Sat Dec 05, 2020 1:32 pm
by Squelch
oleg4f wrote: ↑Sat Dec 05, 2020 12:41 pm
ssilk wrote: ↑Sat Dec 05, 2020 8:30 am
And why do you need that?
Hm. This is obvious and jodokus31 already answered this:
I beleive what is being implied is the
template is not being followed.
To aid the developers, that template helps to quickly assess what areas the suggestion covers, the reasoning behind it, and additionally, any problems/impact that may be foreseen. The last point usually comes from replies by others.
That said, I do agree with the request, but may I also suggest you format the OP correctly too?
Re: train schedule condition: outer AND support
Posted: Sat Dec 05, 2020 1:39 pm
by jodokus31
Squelch wrote: ↑Sat Dec 05, 2020 1:32 pm
I beleive what is being implied is the
template is not being followed.
Ok. You're right, of course. Didnt think of that
Re: train schedule condition: outer AND support
Posted: Sat Dec 05, 2020 9:40 pm
by Squelch
The problem - Using @asheiduk's example, the train stop schedule looks like this:
- No_Outer_AND.PNG (235.43 KiB) Viewed 4835 times
It uses excessive amounts of screen space, and would require a lot of scrolling to be able to scan any subsequent schedules.
If the operator buttons were able to be dragged left and right to sort the order of operation in combination with the automated parenthesis, this suggestion could be realised.
- Drag_for_Outer_AND.png (15.99 KiB) Viewed 4835 times
The result would look like this:
- Outer_AND.png (176.46 KiB) Viewed 4835 times
This uses far less space, and is far easier to read in my opinion.
Re: train schedule condition: outer AND support
Posted: Sun Dec 06, 2020 9:05 am
by ssilk
Ok, I understood now, but when I’m asking for the why, I do that because I cannot imagine for what use case this could be used. What’s for you obvious is for others something I never thought about.
Re: train schedule condition: outer AND support
Posted: Sun Dec 06, 2020 11:36 am
by asheiduk
Squelch wrote: ↑Sat Dec 05, 2020 9:40 pm
The problem - Using @asheiduk's example, the train stop schedule looks like this:
Note that in my example "red", "green", ... do not refer to the color-signals but to the science packs of the mentioned color. Sorry for being not precise enough.
Re: train schedule condition: outer AND support
Posted: Sun Dec 06, 2020 3:40 pm
by Squelch
asheiduk wrote: ↑Sun Dec 06, 2020 11:36 am
Squelch wrote: ↑Sat Dec 05, 2020 9:40 pm
The problem - Using @asheiduk's example, the train stop schedule looks like this:
Note that in my example "red", "green", ... do not refer to the color-signals but to the science packs of the mentioned color. Sorry for being not precise enough.
Hehh, yes I thought it might have been, but only after I'd mocked it up. The actual signals don't really matter after all.
ssilk wrote: ↑Sun Dec 06, 2020 9:05 am
Ok, I understood now, but when I’m asking for the why, I do that because I cannot imagine for what use case this could be used. What’s for you obvious is for others something I never thought about.
Do the images help?
Seriously though, although an extreme example is presented, the omission of having AND as the primary qualifier is both puzzling, and annoying at times. The workaround is to reduce the logic in combinators at the station, but that is abstract, not necessarily understood by all players, and a duplication of resources for every station stop with the same/similar conditions.
My feeling is this is an oversight, not a deliberate implementation.
Re: train schedule condition: outer AND support
Posted: Mon Dec 07, 2020 8:55 am
by ssilk
No, you’re right, it makes sense to have “brackets” to set calculation priorities.
But I’m quite sure, that this issue has a low priority, because it is so from the start of the current scheduler. So it might be a high effort to change it, combined with low game play value (I need to ask why this is needed).
Re: train schedule condition: outer AND support
Posted: Mon Dec 07, 2020 11:38 am
by oleg4f
Squelch wrote: ↑Sat Dec 05, 2020 1:32 pm
I beleive what is being implied is the
template is not being followed.
i write the request according to this link. Here:
"which looks ugly and hard to read."
i specified why this is needed - to make life easier and easy to read/use of schedule. It obvious that need to transform every expression to DNF doesn't make life easier. Thanks for more detailed examples to others interested in this improvement
.
That said, I do agree with the request, but may I also suggest you format the OP correctly too?
Done.
Re: train schedule condition: outer AND support
Posted: Mon Dec 07, 2020 12:08 pm
by eradicator
+1
ssilk wrote: ↑Mon Dec 07, 2020 8:55 am
combined with low game play value (I need to ask why this is needed).
Ye, know, i don't want to be rude but the implication of that sentence is that anything
you personally don't understand has "low game play value". Seriously? You shouldn't use your own playstyle as an argument for what is and is not important. To anyone who's remotely familiar with predicate logic the @OPs intention is so blatantly obvious that it's rather suprising that this *isn't* already possible.
Re: train schedule condition: outer AND support
Posted: Mon Dec 07, 2020 12:29 pm
by nosports
is it not possible to do this with the logic-thingys already in the game....
And the last one should hand out then only one signal (to Station, or a rail signal)
Re: train schedule condition: outer AND support
Posted: Mon Dec 07, 2020 12:31 pm
by foamy
eradicator wrote: ↑Mon Dec 07, 2020 12:08 pm
+1
ssilk wrote: ↑Mon Dec 07, 2020 8:55 am
combined with low game play value (I need to ask why this is needed).
Ye, know, i don't want to be rude but the implication of that sentence is that anything
you personally don't understand has "low game play value". Seriously? You shouldn't use your own playstyle as an argument for what is and is not important. To anyone who's remotely familiar with predicate logic the @OPs intention is so blatantly obvious that it's rather suprising that this *isn't* already possible.
I know it's tripped
me up before. It's possible to transform them, but I actively resent having to do it. I get enough of that with Skyrim's CK, which *also* has the issue of OR precedence. It
works and I imagine it was implemented like that in both cases because it is a minimal way to give access to the full logic.
Re: train schedule condition: outer AND support
Posted: Mon Dec 07, 2020 12:43 pm
by oleg4f
nosports wrote: ↑Mon Dec 07, 2020 12:29 pm
is it not possible to do this with the logic-thingys already in the game....
Do you talk about internal things or the interface?
Re: train schedule condition: outer AND support
Posted: Mon Dec 07, 2020 12:45 pm
by Impatient
+1
Re: train schedule condition: outer AND support
Posted: Mon Dec 07, 2020 12:47 pm
by oleg4f
I don't talk about nest OR or nest AND. No. imho, outer AND will be enough. And i don't think that this important improvement is so hard to implement
.