|
Boolean Expressions
Melanie Barker's avatar
By Melanie Barker, Arena Simulation Consultant
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.
原帖:
utm_campaign=Newsletter&utm_source=hs_email&utm_medium=email&utm_content=25762347&_hsenc=p2ANqtz-_frEKsQ7Cyw_38O2jzVNbmOGFrZFCIHXOBFJ3DxI5E-yWxVvVZ54wTyJTd9aMMwi7G9OljPm4QwI2HAmkiuWbMkBIuIA&_hsmi=25762347[/url] |
评分
-
查看全部评分
|