Train schedule conditions question.

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
dgnuff
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri Feb 24, 2017 8:06 pm
Contact:

Train schedule conditions question.

Post by dgnuff »

How do multiple conditions bind when there are several conditions with a mix of "And" and "Or" combining? Say I have the following list:

Cargo item Iron Plate > 1000
And Cargo item Copper Plate > 1000
Or Circuit Condition A = 1
And Circuit Condition B = 2

There are four possible ways that could evaluate:

"Top to Bottom" associative: ((Iron > 1000 And Copper > 1000) Or A = 1) And B = 2
C/C++ style: And binds more tightly than Or: (Iron > 1000 And Copper > 1000) Or (A = 1 And B = 2)
"Inverse" C/C++ Or Binds more tightly than And: Iron > 1000 And (Copper > 1000 Or A = 1) And B = 2
"Bottom to Top" Associative: Iron > 1000 And (Copper > 1000 Or (A = 1 And B = 2))

Depending on the state of the four base conditions, each of these can have the train departing under different circumstances.

So which of the four is it? I'd guess the most likely is the first, with a chance it might be the second. The third and fourth really don't make much sense, and are just listed for the sake of completeness.

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

Re: Train schedule conditions question.

Post by eradicator »

AND binds stronger than OR.
According to a lengthy discussion mixed into FFF212
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.

Post Reply

Return to “Gameplay Help”