I'm using a select output block to do something if one track has less railcars on it than another track. Right now I'm using the following code in the if condition is true area:
int x
int y
track1.nCars()=x
track2.nCars()=y
(x.intValue() >= y.intValue());
But this isn't working, and I'm wondering how to use the nCars() function in a flowchart block like this?
You can only write 1 line of code in such a condition code box.
As long as the track1
and track2
objects are in the same agent as the SelectOutput
, simply turn your code into a 1-line condition:
track1.nCars() >= track2.nCars()
Agents will exit via the true
branch if track1 has more/equal cars than track 2