train schedule condition: outer AND support

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

oleg4f
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Fri Dec 04, 2020 9:16 am
Contact:

train schedule condition: outer AND support

Post 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)
Last edited by oleg4f on Mon Dec 07, 2020 11:40 am, edited 1 time in total.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: train schedule condition: outer AND support

Post by ssilk »

And why do you need that?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1603
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: train schedule condition: outer AND support

Post 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.

asheiduk
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Sat Dec 05, 2020 9:46 am
Contact:

Re: train schedule condition: outer AND support

Post 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
Last edited by asheiduk on Sat Dec 05, 2020 10:01 am, edited 1 time in total.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: train schedule condition: outer AND support

Post by steinio »

Yes, please.
Image

Transport Belt Repair Man

View unread Posts

oleg4f
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Fri Dec 04, 2020 9:16 am
Contact:

Re: train schedule condition: outer AND support

Post 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.

Squelch
Filter Inserter
Filter Inserter
Posts: 346
Joined: Sat Apr 23, 2016 5:31 pm
Contact:

Re: train schedule condition: outer AND support

Post 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?

User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1603
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: train schedule condition: outer AND support

Post 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

Squelch
Filter Inserter
Filter Inserter
Posts: 346
Joined: Sat Apr 23, 2016 5:31 pm
Contact:

Re: train schedule condition: outer AND support

Post by Squelch »

The problem - Using @asheiduk's example, the train stop schedule looks like this:
No_Outer_AND.PNG
No_Outer_AND.PNG (235.43 KiB) Viewed 3914 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
Drag_for_Outer_AND.png (15.99 KiB) Viewed 3914 times

The result would look like this:
Outer_AND.png
Outer_AND.png (176.46 KiB) Viewed 3914 times

This uses far less space, and is far easier to read in my opinion.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: train schedule condition: outer AND support

Post by ssilk »

:D 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.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

asheiduk
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Sat Dec 05, 2020 9:46 am
Contact:

Re: train schedule condition: outer AND support

Post 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.

Squelch
Filter Inserter
Filter Inserter
Posts: 346
Joined: Sat Apr 23, 2016 5:31 pm
Contact:

Re: train schedule condition: outer AND support

Post 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
:D 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? :D

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.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: train schedule condition: outer AND support

Post 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).
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

oleg4f
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Fri Dec 04, 2020 9:16 am
Contact:

Re: train schedule condition: outer AND support

Post 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.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: train schedule condition: outer AND support

Post 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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

nosports
Filter Inserter
Filter Inserter
Posts: 274
Joined: Fri Jan 19, 2018 5:44 pm
Contact:

Re: train schedule condition: outer AND support

Post 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)

foamy
Filter Inserter
Filter Inserter
Posts: 432
Joined: Mon Aug 26, 2019 4:14 am
Contact:

Re: train schedule condition: outer AND support

Post 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.

oleg4f
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Fri Dec 04, 2020 9:16 am
Contact:

Re: train schedule condition: outer AND support

Post 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?

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: train schedule condition: outer AND support

Post by Impatient »

+1

oleg4f
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Fri Dec 04, 2020 9:16 am
Contact:

Re: train schedule condition: outer AND support

Post 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 :-).

Post Reply

Return to “Ideas and Suggestions”