Expressions

An Expression is a user-defined routine that runs within the larger SIMPROCESS program. In effect, SIMPROCESS checks at various points during a simulation run to see if there are any special instructions for it. If so, it runs the code. Expressions accomplish simulation and modeling requirements for which standard SIMPROCESS processing does not support.

When you define an Expression, you select the point at which you want the Expression to be evaluated; for example, at the beginning of the simulation, or at the moment an Entity (e.g., a Customer Order) is received by an Activity (e.g., Order Distribution). Each type of SIMPROCESS component (Activity, Entity Type, etc.) has different Expression activation events.

The SIMPROCESS Expression language has features common to programming languages.

  • Data Types (INTEGER, REAL, BOOLEAN, STRING, OBJECT)
  • Mathematical Operators (:=, +, -, *, /, MOD, DIV)
  • Relational Operators (=, <, >, <=, >=, <>)
  • Logical Operators (AND, OR, NOT)
  • Language Constructs (IF, WHILE, FOR, etc.)

In addition, Expressions use the extensive set of System Attributes, any User-defined Attributes, and the large library of System Methods. (System Methods are methods that extend the capability of a simulation. Some System Methods return a value and some do not. For example, SimTime returns the current simulation time. OpenDatabase opens a connection to a database for reading or writing. See Appendix F of the SIMPROCESS User’s Manual for a full listing of System Attributes and System Methods.)

Many of the demonstration models discussed in Chapter 5 of the SIMPROCESS Getting Started Manual use Expressions, and the ExpressionDemos directory included in the models directory contains models with the sole purpose of demonstrating Expressions.

Expressions are built using the Expression Editor. In-depth programming experience is not required. The Expression Editor includes references for the Expression Language, System Methods, System Attributes, and User-Defined Attributes.

  • The Expression Language tab lists data types, operators, and constructs of the SIMPROCESS Expression Language along with a description of the selected item.
  • The System Methods tab lists the System Methods available for SIMPROCESS along with the Arguments, the type the system method Returns, and Description of the selected item.
  • The System Attributes tab lists the system attributes defined for each simulation object in SIMPROCESS.
  • The User-Defined Attributes tab lists all the global attributes defined in the model and any local attributes defined for the expression owner including the Type of the selected attribute.

Double clicking an item will add it to the Expression text. In addition, the Expression Editor includes an Expression Assistant. The Expression Assistant displays a list of items that match the current set of characters being typed. The list can hold any item contained on the four reference tabs.

Click for larger image.