By Melanie Barker, Arena Simulation Consultant
Published: January 29, 2016
Categories: Tips & Tricks
In this issue of Tips and Tricks we’re going to go over Boolean expressions. Boolean expressions are logical statements, such as 2 + 2 == 4, which can be evaluated as either true or false. Within the statements, AND (&&) and OR (||) can be used to build more complex expressions. With the statements built, a truth table like the one below can be developed to understand the potential results of the expressions.
When Arena evaluates a Boolean expression, it assigns a value of 0 to false statements and 1 to true statements. Boolean expressions can become useful in Arena when they use variables or attributes. For example, if a part of type 2 needs a longer delay than other part types, this can be done by adding a Boolean expression to evaluate if the part is type 2 and then multiplying the additional delay by the result of that statement.
Boolean expressions can also use other system variables, like TNOW. If a production line will make better parts as the simulation progresses, the inspection pass rate can be based on the system time. As the time increases, the pass rate increases.
One final note – if you will be using Boolean expressions to evaluate TNOW or other time-based statements, consider using a function like HoursToBaseTime() to convert the value to the base time units even if the base time units are already in hours. This will protect your statement if the base time units are changed later.
Sign up for the Newsletter
Arena User Group
Arena has a very active user community on LinkedIn. Ask questions, learn about best practices and connect with other simulation professionals.