Train schedule conditions question.
Posted: Sun Nov 05, 2017 7:42 am
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.
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.