0% found this document useful (0 votes)
22 views

ProModel User Guide-5

Guia de usuario-5

Uploaded by

Guido Salazar S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

ProModel User Guide-5

Guia de usuario-5

Uploaded by

Guido Salazar S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 101

386 Chapter 10:

Creating Reports

This value is in decimal format, not trun- •Maximum Value The maximum log entry
cated. (Excludes off-shift time, break time, value during the simulation for the given
and scheduled downtimes.) Log Name.
•Capacity The capacity defined in the •Average Value The average value of all
Locations module for this location. log entries during the simulation for the
•Total Entries The total number of entities given Log Name.
that entered the location, not including enti-
ties arriving to be joined and loaded. Entities Please note
split, unloaded, or ungrouped from another
entity at a location do not count as additional Log statistics are set up by the user with a LOG
entries. Arriving entities that have been pre- statement to track the time entities spend between
viously grouped or loaded to form a single any two points in the model.
entity only count as one entry.
•Average Time Per Entry The average time
each entry spent at the location. This time
may include partial times from the beginning Node Entries
and end of the actual run time.
A node entry summary is generated for each non-
•Average Contents The average number
passing path network in the system. It contains
of entries at the location. the following information.
•Maximum Contents The maximum num-
•Path Name The name of the path the node
ber of entries which occupied the location
resides on.
over the course of the simulation.
•Total Entries The number of times that a
•Current Contents The number of entities
resource entered the path node.
remaining at the location when the simula-
•Blocked Entries The number of times a
tion ended.
resource tried to claim a path node occupied
•% Utilization The percentage of capacity
by another resource.
occupied, on average, during the simulation.
Cumulative Occupancy Time x 100
Resources Costing
Capacity x Scheduled Time
•NonUse Cost Dollars NonUse Cost = (1-%
Cumulative Occupancy Time refers to the
Utilization) * Scheduled Time * Rate
sum of the clock time each entity spends at a
•% NonUse Cost Refers to the resource’s
location for processing.
percentage of the sum of all nonuse costs
•Usage Cost Dollars Usage Cost = (% Uti-
Logs
lization * Scheduled Time * Rate) + (Times
•Numbers of Observations The number of Used * Cost per use)
log entries that occurred during the simula-
•% Usage Cost Refers to the resource’s
tion for the given Log Name.
percentage of the sum of all resource usage
•Minimum Value The minimum log entry costs
value during the simulation for the given
•Total Cost Dollars Total Cost = Usage
Log Name.
Cost + NonUse Cost
ProModel 387
User Guide

•% Total Cost Refers to the resource’s per- •Average Time Per Usage The average
centage of the sum of all resource costs time the resource spent transporting or pro-
cessing an entity, or servicing a location or
Resource States other resource. Includes any pickup and
•Scheduled Time The total amount of time drop-off time as well as any blocked time
the resource was scheduled to be available. while in use. (See note on time units.)
(Excludes off-shift time, break time, and •Average Time Travel To Use The average
scheduled downtimes.) time the resource spent traveling to a loca-
•% In Use The percentage of time the tion or other resource to transport or process
resource spent transporting or processing an an entity, or to service a location or other
entity, or servicing a location or other resource. Does not include any pickup time,
resource that was down. This also includes but does include any blocked time. (This
deposit time. information is not available if your model
does not have dynamic resources.)
•% Travel To Use The percentage of time
the resource spent traveling to a location or •Average Time Travel To Park The aver-
other resource to transport or process an age time the resource spent traveling to
entity, or to service a location or other either a park node or a downtime node. (This
resource. This also includes pickup time. information is not available if your model
(This information is not available if your does not have dynamic resources.)
model does not have dynamic resources.) •% Blocked In Travel The percentage of
•% Travel To Park The percentage of time time the resource was unable to move to a
the resource spent traveling to a path node to destination because the next path node along
park or traveling to its downtime node. (This the route of travel was blocked (occupied by
information is not available if your model another resource). (This information is not
does not have dynamic resources.) available if your model does not have
dynamic resources.)
•% Idle The percentage of time the resource
was available but not in use. •% Utilization The percentage of time the
resource spent traveling to be used, trans-
•% Down The percentage of time the
resource was unavailable due to unscheduled porting or processing an entity, or servicing a
downtimes. location or other resource.
Total Travel to Use Time + Total Time In Usage
Resources x 100
Total Scheduled Time
•Units The number of units defined in the
Resources module for that resource.
•Scheduled Time The total amount of time
Please note
the resource was scheduled to be available.
(Excludes off-shift time, break time, and ProModel reports resource groups and multi-unit
scheduled downtimes.) resources both by unit and collectively. The col-
•Number of Times Used The total number lective unit (aggregate) report for a resource
of times the resource has been acquired to totals the first three fields and averages the last
transport or process an entity or to service five fields discussed above.
locations or other downed resources.
388 Chapter 10:
Creating Reports

Variables
•Total Changes The total number of times
the value of the given variable changed dur-
ing the simulation.
•Average Time Per Change The average
time a given variable remained at any one
value.
•Minimum Value The lowest value of the
variable during the simulation.
•Maximum Value The highest value of the
variable during the simulation.
•Current Value The final value of the vari-
able when the simulation ended.
•Average Value The average value of the
variable during the simulation. This value is
time weighted.

Please note

In the report, if a variable name is followed by an


asterisk (*), the variable is an observation-based
variable. Otherwise, it is a time-weighted vari-
able. This determination is made in the Variable
edit table where the variable is defined.

The initial value for observation-based variables


is not accounted for in the statistics.
ProModel 389
User Guide

Creating Charts Chart Toolbar


The toolbar that appears in a Chart window gives
Charts provide visual representations of the data
you several options to change the way the infor-
contained in Reports.
mation is presented in your chart.
The Output Viewer 3DR can display four main
types of charts with several sub-types:
• Category Charts
• State Charts • : Toggles between a three-dimensional
• Histograms and two-dimensional bars in your
chart. Three-dimensional is the default
- Time-Weighted Values
view.
- Simple Values
• Time Plots • : Toggles between bars and cylinders in
- Time-Weighted Values the Chart area.
- Simple Values • : Expands the chart along the z-axis to
- State Values show multiple scenarios in layers. This
- Counts option will not be available if only one
scenario was run.
Chart Window • : Shows the results in a stacked bar
chart.
The chart window contains your chart and
options to modify your chart. • : When the chart is three-dimensional,
this option will allow you to rotate the
view using the cursor.
• : Use this tool to enlarge regions of your
chart. Select this tool then click and
drag to outline the chart area you want
to enlarge. You can continue to zoom
in on an area, or you can reset the view
to the default zoom level by selecting
this tool again.
• : Use this tool to change the colors in
the Chart area. Selecting this tool will
open a menu with color options.
Choosing a color will change your cur-
Regardless of the type of chart you open, all chart sor to a paint bucket. Position the
windows have options and fields in common: bucket over the area you want to
• Chart Toolbar change, and click to fill the area with
• Legend Field the new color.
• Chart Area • : Opens the chart’s properties dialog.
• Display and Alias
390 Chapter 10:
Creating Charts

• : Opens a dialog, which allows you to Legend Field


modify the items displayed in the The Legend field shows the definition and color-
chart. This option is only available for coding of the bars in your chart.
Histogram and Time Plot charts.
• : Allows you to change the chart’s titles
and labels.
• : Allows you to change the font charac- Chart Area
teristic of the chart’s titles and labels. The Chart area contains your chart.
• : Toggles the point labels on and off.
Point labels are the numbers that the
bars in your chart represent. These
numbers will appear at the top of the
bars when this option is selected.
• : Toggles the point makers on and off.
Point markers are small graphics that
show the data points on your graphs.
• : Toggles the Legend area on and off.
The appearance of this chart will depend on the
• : Toggles the Display and Alias field on type of chart you are viewing; i.e. category, histo-
and off. For more information on this gram, etc.
field see “Display and Alias” on
page 390. Display and Alias
The Display and Alias field, which can be tog-
• : Toggles the vertical grid lines in the
gled on and off from the toolbar, allows you to
chart on and off.
quickly select the data items you wish to display
• : Toggles the horizontal grid lines in the in the chart and optionally assign aliases to the
chart on and off. data items.
• : Copies the chart to the Windows clip-
board as a bitmap, a metafile, or as
plain text (data only).

Please note

The Bar/Cylinder, , tool is not available for


Simple Values and Time-weighted Values time
plot charts, since they do not use bars to repre-
sent data.
Select which series and items you would like dis-
played in the chart by checking the box in the
ProModel 391
User Guide

Visible column. To show or hide all the items Category Chart


you can click check or uncheck the box in the
<ALL> row or click on any box while holding Category Charts displays bar charts for columns
the CTRL key. of data found in reports.
Double click on a series or item name to rename The Category Chart is an excellent way to visu-
it with an alias. ally compare the different items in your reports.
It is also helpful for organizing data attractively
for presentations.
To display a Category Chart, select Category
Chart from the View menu or the Category Chart
icon from the Toolbar. As a shortcut, you can
also right-click on any column of data in a report
and select Category Chart from the drop-down
menu.
When you choose to view a Category Chart, the
Category Chart Selection dialog will be dis-
played.

From this menu you can select the scenarios, rep-


lications, periods (only available if Batch Mean
or Periodic Output Reporting is selected in the
Simulation Options dialog) and categories of the
data you want displayed.
392 Chapter 10:
Creating Charts

For information on each category, see “Report Please Note


Data” on page 383.
Changes to a chart’s properties does not apply to
Category Chart Properties other charts or persist when the chart is closed
Choosing the properties option for a category and then regenerated.
chart will open the Chart Properties dialog.

Category Chart Example


An example of a Category Chart is shown below.

• Display Properties: Select the angle of


the text for the X-Axis labels.
• Axis Range - X-Axis Range (min-
max): These two boxes show the range of
items displayed in the X-Axis.
• Axis Range - Y-Axis Range (min- Please Note
max): In the first box choose the value for
the minimum range for the Y-Axis. The Positioning your cursor over a bar on the chart
maximum range is entered in the second box. will display specific information about that par-
• Axis Zoom Range - X-Axis Range (min- ticular bar. The appearance and structure of
max): Choose which range of X-Axis your chart can be edited using the chart toolbar
items to zoom in on by using these two or the right-click menu. For more information
boxes. see “Chart Toolbar” on page 389 or “Right-
• Axis Zoom Range - Y-Axis Range (min- click Menu” on page 379.
max): Choose which range of Y-Axis val-
ues to zoom in on by using these two boxes.

State Chart
State Charts show stacked bar charts of location,
resource, and entity states. States describe the
condition of these objects.
ProModel 393
User Guide

This type of chart is useful for quickly seeing window. See “Category Chart Properties” on
what your locations, resources, and entities spent page 392.
their time doing. Such visualizations can help
identify problem areas in your process. State Chart Example
To display a State Chart, select State Chart from An example of a State Chart is shown below.
the View menu or the State Chart icon from the
Toolbar. As a shortcut, you can also right-click
on any column of data in a report containing per-
centage values and select State Chart from the
drop-down menu.
When you choose to view a State Chart, the State
Chart Selection dialog will be displayed.

State Chart Selection Window

This chart shows the percentage of time by sce-


nario each location spent in the six different
states: operation, setup, idle, waiting, blocked,
and down.
Right click on any bar in the chart, and choose
Create Pie Chart to have that item’s state infor-
mation displayed as a pie chart.

From this menu you can select the scenarios, rep-


lications, periods (only available if Batch Mean
or Periodic Output Reporting is selected in the
Simulation Options dialog) and state categories
of the data you want displayed. Please Note

State Chart Properties Positioning your cursor over a bar on the chart
The State Chart Properties window is function- will display specific information about that par-
ally equivalent as the Category Chart Properties ticular bar. The appearance and structure of
394 Chapter 10:
Creating Charts

your chart can be edited using the chart toolbar click on an item to move it from the Available
or the right-click menu. For more information Items area to the Selected Items area or back
see “Right-click Menu” on page 379. again. You may also use the arrow buttons to
move items between the two areas.
If you check the Manual Bar Width option, you
may choose the range value for each bar shown in
Histogram the chart. If you leave this field unchecked, 3DR
will automatically calculate the range value for
A histogram is a bar chart showing the percent-
each bar, which will not necessarily be the value
age of time or times that time plot data fell within
in the Bar Width field.
a particular range of values.
There are two types of histograms that can be dis-
Chart Properties
played:
Choosing the properties option for time weighted
•Time-weighted Values Percentage of total
values histogram will open a window with two
simulation time that the values fell into a
tabs: Data and Display
specific range. (e.g. the Contents variable of
a location.)
Chart Properties: Data
•Simple Values Percentage of total simula-
tion time that a variable was within a range
of values (e.g. cycle times).

Time Weighted Values Histogram


The time weighted values histogram shows the
percentage of total simulation time the values fell
into specific ranges. The example further
explains how values are grouped.

Selection Window

• Display Series: This is a list of the series


data displayed in the histogram.
• Min/Max Values: Choose whether to dis-
play the minimum and/or maximum values
Choose the scenarios and replications you would for all replications in the histogram.
like displayed for the data item selected. Double
ProModel 395
User Guide

• Mean/Median/Mode Values: Choose Chart Example


whether to display the mean, median, and/or The example chart below shows the time-
mode values for all replications in the histo- weighted histogram contents of a queue.
gram.
• Percentile: Displays the maximum value
the series could reach for the chosen percent-
age of total simulation time. For example, if
you choose to display an 80 percentile for a
location’s contents, 80% of the simulation
time the location’s contents were at the dis-
played value or less.
• Data Properties: Displays the time units
used to calculate the histogram’s values, and
optionally allows you to choose your own
bar widths, which are the range of values
each bar will display. Entering a smaller bar
width results in more bars, while the greater
the bar width the fewer bars will be dis-
played. Along the X-Axis is the contents of the queue
divided into bar units of 10. The Y-Axis shows
Chart Properties: Display the percentage of total simulation time the con-
The Display tab for the time-weighted histogram tents of the queue were at the values along the X-
properties window is functionally equivalent as Axis.
the Category Chart Properties: Display window, The mouse over shows that for 18.21% of the
with the exception of the “Discrete label the X- total simulation time, for all replications, the con-
Axis” option. tents of the queue were between exactly 20 and
• Discrete label the X-Axis: When this almost 30 (29.99).
option is checked the full range of each bar is The average minimum and maximum contents of
shown in the X-Axis. the queue, for all replications, were 18 and 64
See “Category Chart Properties” on page 392. respectively, while the mean contents were
39.81.
The 80% Percentile line shows that for 80% of
the total simulation time the contents of the queue
were 50 or less.
396 Chapter 10:
Creating Charts

Simple Values Histogram Chart Example


The simple values histogram shows when, by The example chart below shows the simple val-
percentage of total simulation time, a variable’s ues histogram for the variable WIP.
value was within a certain range.

Selection Window

The X-Axis shows the value of the WIP variable


Choose the scenarios and replications you would divided into bar units of 4. The Y-Axis shows the
like displayed for the data item selected. Double percentage of times the WIP variable fell into the
click on an item to move it from the Available ranges shown on the X-Axis.
Items area to the Selected Items area or back
This chart also shows the median value of the
again. You may also use the arrow buttons to
WIP value for all replications. The 80% Percen-
move items between the two areas.
tile shows that for 80% of the counts the value the
If you check the Manual Bar Width option, you WIP variable was 19 or less.
may choose the range value for each bar shown in
the chart. If you leave this field unchecked, 3DR
will automatically calculate the range value for
each bar, which will not necessarily be the value
in the Bar Width field.

Chart Properties
The chart properties for the simple values histo-
gram are the same as for the time-weighted val-
ues histogram. See “Chart Properties” on
page 394.
ProModel 397
User Guide

Time Plot Time Weighted Values Time plot


Time plots show state and performance values as The time-weighted time plot chart shows variable
they occur over time. This allows you to see values over time.
trends and spikes in activity as the simulation The chart’s X-Axis shows time periods, while the
progressed. Y-Axis shows variable values for each time
Time plots can only be displayed if the user has period.
selected Time Plot as the statistics type for
objects as the model was being built. Selection Window
There are four types of time-plot statistics that
can be displayed:
•Time-weighted Values Variable values
weighted by time (e.g. the Contents variable
of a location.)
•Simple Values Variable values as they
change over time (e.g. cycle times).
•State Values Shows location states over
time.
•Counts The number of occurrences of
some particular event (e.g. the number of
exits from a location).
Choose the scenarios and replications you would
like displayed for the data items selected. Double
click on an item to move it from the Available
Items area to the Selected Items area or back
again. You may also use the arrow buttons to
move items between the two areas.
If you check the “Average data by period” box,
all the values in each period of selected time will
be averaged together. If left unchecked, each
value will be displayed.

Chart Properties
Choosing the properties option for time weighted
values time plot will open a window with two
tabs: Data and Display

Chart Properties: Data


The chart properties:data for the time-weighted
values time plot are the same as for the time-
weighted values histogram. See “Chart Proper-
ties” on page 394.
398 Chapter 10:
Creating Charts

Chart Properties: Display Simple Values Time plot


The Display tab for the time-weighted time plot The simple values time plot shows the change in
properties window is functionally equivalent as variable values over time.
the Category Chart Properties: Display window,
with the exception of the “Line Properties” Selection Window
option.
• Line Properties: Choose the pattern and
thickness for the lines on the chart.
See “Category Chart Properties” on page 392.

Chart Example
The example chart below compares the time-
weighted time plot contents of a queue for two
scenarios.

Choose the scenarios and replications you would


like displayed for the data items selected. Double
click on an item to move it from the Available
Items area to the Selected Items area or back
again. You may also use the arrow buttons to
move items between the two areas.
Choose the number of hours in each period that
will be displayed along the X-Axis.

Chart Properties
Choosing the properties option for simple values
The X-Axis shows the time periods for the chart. time plot will open a window with two tabs: Data
The Y-Axis shows the average content values of and Display
the queue for the time periods in the X-Axis.
Chart Properties: Data
The One Operator scenario additionally displays
the minimum and maximum contents of the
The chart properties:data for the simple values
queue for each time period for all replications, as
time plot are the same as for the time-weighted
well as the contents 99.99% confidence interval,
values histogram. See “Chart Properties” on
which means that 99.99% of all queue contents
page 394.
will be with the two confidence interval lines by
period.
Chart Properties: Display
This chart shows the impact that an additional
The Display tab for the time-weighted time plot
operator has on the contents of a queue.
properties window is functionally equivalent as
ProModel 399
User Guide

the Category Chart Properties: Display window, State Values Time plot
with the exception of the “Line Properties”
The state values time plot shows location state
option.
statistics over time.
• Line Properties: Choose the pattern and
thickness for the lines on the chart. Selection Window
See “Category Chart Properties” on page 392.

Chart Example
The example chart below compares the value of
the variable “WIP” over time for two scenarios.

Choose the scenarios and replications you would


like displayed for the data items selected. Double
click on an item to move it from the Available
Items area to the Selected Items area or back
again. You may also use the arrow buttons to
move items between the two areas.

Chart Properties
The Y-Axis shows the value of the WIP (work in Choosing the properties option for state values
progress) variable over the time in the X-Axis. time plot will open a window with two tabs: Data
The example shows how adding two additional and Display
resources to the demo model increases WIP and
reduces the fluctuation in WIP. Chart Properties: Data
The only option available from this properties
window is to change the time units shown in the
X-Axis.

Chart Properties: Display


The Display tab for the state values time plot
properties window is functionally equivalent as
the Category Chart Properties: Display window.
See “Category Chart Properties” on page 392.
400 Chapter 10:
Creating Charts

Chart Example Counts Time Plot


The example chart below compares the location The counts time plot shows the number of occur-
states of a location for two scenarios. rences of some particular event in the simulation
(e.g. the throughput of an entity).

Selection Window

The Y-Axis shows the state of the location for the


time in the X-Axis. This example shows how Choose the scenarios and replications you would
adding two resource units can impact a location’s like displayed for the data item selected. Double
state over time. click on an item to move it from the Available
Items area to the Selected Items area or back
again. You may also use the arrow buttons to
move items between the two areas.
Choose the number of hours in each period that
will be displayed along the X-Axis.

Chart Properties
Choosing the properties option for the counts
time plot will open a window with two tabs: Data
and Display

Chart Properties: Data

The chart properties:data for the counts time plot


are the same as for the time-weighted values his-
togram. See “Chart Properties” on page 394.

Chart Properties: Display


The Display tab for the counts time plot proper-
ties window is functionally equivalent as the Cat-
ProModel 401
User Guide

egory Chart Properties: Display window, with the


exception of the “Line Properties” option.
• Line Properties: Choose the pattern and
thickness for the lines on the chart.
See “Category Chart Properties” on page 392.

Chart Example
The example chart below compares the through-
put of a pallet entity for two scenarios.

The X-Axis show time periods. The Y-Axis


shows the throughput count for the pallet entity
for the time periods in the X-Axis.
This chart shows the improvement in pallet
throughput when an extra resource is added to the
model.
402 Chapter 10:
Creating Charts
ProModel 403
User Guide

Chapter 11: Language


Elements and Expressions

Language Elements
Language elements are the smallest units of the
language used to define a model’s objects and
logic. Language elements include:
•Names
•Keywords
•Numbers
•Character Strings
•Operators
404 Chapter 11:
Names

Names
A name or identifier is any combination (up to
eighty characters long) of letters, numbers, and
underscores (“_”), used to identify model ele-
ments such as locations, entities, variables, and
functions. Although any valid name can refer to
any object, it is best to use names which describe
the object they identify (e.g., using “ClientA” to
describe an entity that represents a client).
Names, like all words in ProModel, are case
insensitive, meaning that ProModel sees
“PARKING_A,” “Parking_A,” and
“PaRkInG_a” as identical.
Names must use the following conventions:
•Names may contain the letters A through Z
(upper or lower case), digits (0-9) and the
underscore “_”. Names may not contain
spaces. When opening an older model,
ProModel flags improper use of these
restricted characters.
•Do not use a digit as the first character of a
name. After the first character, any charac-
ter may be a digit. For example, “2Var” is
an invalid name, but “V2”, is a valid name.
•Names may not be keywords, but names
may contain keywords. For example,
“For” is an invalid name, but “Forklift” is
a valid name. Similarly, “Queue2” and
“OrderQty” are both valid.
•No matter what they identify, every name in
a model must be unique. For example, you
cannot name both a location and an entity
“Server.” You may, however, name one
“Server1” or “Server_Location” and the
other “Server2” or “Server_Resource.”
ProModel 405
User Guide

Keywords Please note


Keywords are words that ProModel reserves for *Reserved for future use.
special use as commands or function calls. Key-
words may not be used as names, although names For information on tank keywords, see “Tanks”
may contain keywords. Keywords, like all words on page 188.
in ProModel, are case insensitive.

accum dep hr ms* send


activate dispatch* if off* setrate
all display iff or show*
alt do ig order skip
and dosload in ownedresource snapshot*
as drop* inc p5 sound
backup dtleft incentcost p6 split as
begin else incloccost pause stop
bi empty increscost percentage* take
board* end inf pick* then
break ent infinite preemptedres* threadnum
breakblk entity int preemptor timeleft
by er join priority to
cancel* exit jointly prompt trace
calday fifo keep queue* turn
calhour first lifo random ungroup
calmin for load read unload
case* forlocation loc real until
char format location recently* up*
claim* forresource log rename use
close free lu report variable
combine full maparr res view
condition geo match reserve* wait
cont get min reset warmup
convey getcost mod reset stats while
create getresrate most resource wk
day goto move resqty write
debug graphic move for return writeline
dec group move on route xsub
default hide* move with sec xwrite
406 Chapter 11:
Numbers

Numbers Name-Index Numbers


ProModel uses two types of numbers: real num- When a simulation begins, locations, resources,
and entities are all assigned numbers according to
bers and integers. ProModel also uses a special
their position in their respective edit tables. The
category of integers, called “name-index num-
number assigned to the element is called its
bers.” This section discusses real numbers, inte-
name-index number. For example, the third entity
gers, and name-index numbers. It then discusses
in the Entity edit table will have the number three
converting between the different types.
for its name index number. The name of an ele-
ment may be used in an expression to reference
Integers its name-index number.
An integer number is a whole number ranging For example, if EntityA were the third entity in
from -2,147,483,648 to 2,147,483,647. Integer the Entity edit table, the statement, “Attr1 =
values may not include commas. Therefore, the EntityA,” would assign the number three to
number 5,380 should be entered as 5380. Name- Attr1, because attributes take numbers. Addition-
index numbers (described in this section) work ally, you may also test for an index number by
just like integer numbers. referencing the element name with a statement
like, “IF Var5 = Location3 THEN.” In fact, when
Examples of integers using a name-index number to identify a location,
resource, or entity (as in the previous examples),
-2234798 it is usually best to use the name of the element,
because inserting or deleting an element from the
0
edit table, may change the name-index number
32 assigned to other elements.
If you need to refer to a location, resource, or
entity by name but only know its name-index
Real Numbers number, use the name functions: LOC(), RES(),
and ENT(). These functions allow name-index
A real number is any number ranging from 1.7 X numbers and variables or attributes containing
10 -308 to 1.7 X 10 +308, including decimals. name-index numbers to be converted back to
Real values may not include commas. As such, their actual names for use in statements or
the number 5,380.5 should be entered as 5380.5. expressions requiring the element name.

Examples of real numbers Consider the statement, “Attr1 = PASSENGER.”


Although this statement only stores the name
index number of the element in the attribute, the
-2.875638
name-index number can then be used in conjunc-
844.2 tion with LOC(), ENT(), and RES() to get the
65.0 actual name of the location. For example, if PAS-
SENGER is the fifth entity in the Entity edit
table, the statement LOAD 1 ENT(Attr1) works
the same as LOAD 1 PASSENGER. Addition-
ally, a name-index number can be used with the
ProModel 407
User Guide

name functions to output a name to the screen or


a file.
Character Strings
A string is any collection of characters enclosed
Converting Between Numeric in quotes, such as “Now Boarding.” Unlike some
programming languages, ProModel uses charac-
Types
ter strings exclusively for output either to a file or
When an expression expects one type of value to the screen. Strings may contain any of the 256
but receives another, ProModel automatically ASCII characters. (ASCII characters not on the
takes care of converting between the two, so most keyboard can be included in string expressions
often the difference will not matter. However, with the CHAR() function.) Strings may include
when ProModel expects an integer but receives a keywords and names, but those keywords and
real value, it truncates the real value at the deci- names will not be executed in or used by the
mal point. For example, say the variable Integer1 logic.
is assigned the value 3.9, as in the following
statement: Integer1=3.9. The variable Integer1 Additionally, the symbol “\n” can be used to
would hold the value 3, not 4. To round 3.9 when divide a string into multiple lines when it is out-
assigning to an integer variable would require the put, as in the example below.
statement, Integer1=Round(3.9). The statement, DISPLAY “The simulation \nis
half over.” displays this dialog box:
Converting from name-index numbers to the
name of an element requires the ENT(), LOC(),
and RES() functions as ProModel does not auto-
matically convert numbers to names. For infor-
mation on how to output the name of an element
based on its name-index number, see “String
Expressions” on page 412.

Examples of character strings

“EntA exited the system.”


“Location 3 is operating at capacity.”
“ProModel”

Although ProModel does not provide string vari-


ables, it does allow the names of model elements
to be stored in variables and attributes as name-
index numbers (see “Name-Index Numbers” on
page 406). The name referenced by a name-index
number may be used in statements and output to
the screen or a file with the ENT(), LOC(), and
RES() functions. See “String Expressions” on
page 412 for more information.
408 Chapter 11:
Operators

Operators Comparison Operators


Operators are symbols used to perform opera- Operator Meaning
tions on elements in an expression. ProModel AND TRUE if both expressions are TRUE
operators include Boolean operators, mathemati- OR TRUE if one expression is TRUE
cal operators, and a string operator. Unlike
NOT Makes TRUE expressions FALSE
reserved words, you may not use operators as any and FALSE expressions TRUE
part of a name. The following sections explain
the use of these operators for different expression
types. Operator Precedence
As in conventional mathematics, ProModel eval-
Mathematical Operators uates expressions with more than one operator
according to certain rules of precedence. Expres-
Operator Meaning Example
sions with more than one operator evaluate in the
+ Addition A=B+C following order:
- Subtraction A=B-C
1. Terms inside parentheses: ( )
* Multiplication A=B*C
2. Exponentiation: **
/ Division A=B/C 3. Multiplication: *; Division: /; and Modulus:
Mod or @ Modulus A=B Mod C @
(assigns the remain- 4. Addition: +; Subtraction: -
der of B divided by C
5. Equalities and Inequalities: =, <>, >, >=, <,
to A)
<=
** Exponentia- A=B**C
6. NOT
tion (assigns the value of
B raised to the C 7. AND
power) 8. OR
9. Concatenation: $; (For string expressions
only.)
Relational Operators For more information and additional examples of
Operator Meaning operator precedence, see “Operator Precedence”
on page 413.
= Equal to
> Greater than
< Less than Expressions
>= Greater than or equal to Expressions consist of a value or combination of
<= Less than or equal to values (even of different types), variables,
<> Not equal to attributes, functions, and operators that result in a
value. Many consider an expression to be a string
expression if it evaluates to a string, a numeric
expression if it evaluates to a number, and so on.
(For information on how to handle different value
ProModel 409
User Guide

types in the same expression, see “Converting


Between Numeric Types” on page 407.)
Numeric Expressions
A numeric expression is a combination of
The following are the different expression types
numeric elements (such as numbers, variables,
used in ProModel:
and functions) and operators that evaluates to a
•Numeric Expressions numeric value.
•Boolean Expressions
An expression can contain any of the following in
•Time Expressions any combination:
•String Expressions
Arrays Mathematical operators
Attributes Name-Index numbers
Boolean operators Numbers
Distributions Subroutines
Macros System functions
Math function table Variables
functions

The following mathematical operators are avail-


able:

Operator Meaning Example


+ Addition A=B+C
- Subtraction A=B-C
* Multiplica- A=B*C
tion
/ Division A=B/C
Mod or @ Modulus A=B Mod C
(assigns the
remainder of B
divided by C to A)
** Exponenti- A=B**C (assigns the
ation value of B raised to
the C power)

You can perform additional mathematical opera-


tions using math functions. For more information
on operator precedence rules and expression nest-
ing, see “Operator Precedence” on page 413.
410 Chapter 11:
Boolean Expressions

Please note Boolean Expressions


In each of the examples above, if A is an integer Boolean expressions are relational comparisons
number and B and C are both real numbers, the between numeric expressions resulting in a value
result will be truncated unless ROUND() is used of either True or False. Boolean expressions are
(e.g., A = ROUND(B+C)). used most often in IF...THEN and other control
statements. The following relational operators are
used in Boolean expressions:

Operator Meaning
= Equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
<> Not equal to

Relational operator examples

A=B
A>B
A<B
A >= B
A <= B
A <> B

Spacing between the terms and operators within a


numeric expression is optional. However, for
operators with two characters (for example, >=,
<=, <>), no spaces are allowed between charac-
ters in the operator.
ProModel 411
User Guide

Additionally, the following operators compare


two Boolean expressions.
Time Expressions
A time expression is a numeric expression fol-
Operator Meaning lowed optionally by a time unit (WK, DAY, HR,
AND TRUE if both expressions are TRUE MIN, SEC) which defines a duration. If no time
OR TRUE if one expression is TRUE unit is specified, the default time unit specified in
NOT Makes TRUE expressions FALSE the General Information dialog box is assumed.
and FALSE expressions TRUE ProModel knows whether an expression is a time
expression based on the context. Time expres-
For information on operator precedence and nest- sions are not valid within a function call. For
ing rules, see “Operator Precedence” on example, E(10 sec) is invalid, while E(10) sec is
page 413. valid. If a negative value is used for a time
expression, it is automatically converted to zero.

Syntax for time expressions

<numeric expression>{<time units>}

Examples
2 hr
E(10) min
Var1+40.25 min.01

Note that time units cannot be mixed (e.g., 3 min


21 sec), unless you use colon notation.
412 Chapter 11:
String Expressions

Colon Notation for Time Values String Expressions


Colon notation allows for more complex time Any text to be written to a file or displayed on the
expressions. You may use colon notation in the screen is created with a string expression. String
following manner to express time values. expressions are created from a combination of the
following:
Colon notation
• Character strings • ENT()
<hours expression>:<minutes expres- • Concatenation operators "$" • LOC()
sion>:<seconds expression> • Numeric Expressions • RES()
• CHAR() • FORMAT()

Colon notated time expressions evaluate from A string expression must begin with a concatena-
right to left as illustrated in the following exam- tion operator ($) or with a string constant in
ples: quotes (i.e., “...”). The concatenation operator
combines components together, and must be
Example Meaning between all components of a string expression.
:05 5 seconds For example, if Attr1 is 7.83, then the expression
5:00: or 5:: 5 hours “STRING1”$ ATTR1 $ “STRING2” evaluates
5:00 or 5: 5 minutes to “String17.83String2.”
2:40: 2 hours and 40 minutes To output the name of a location, entity, or
15:02:05 15 hours, 2 minutes and 5 sec- resource, use the appropriate function inside a
onds string expression: LOC() for locations, ENT() for
3:25 3 minutes and 25 seconds entities, and RES() for resources. For example,
Attr1::Var2 Attr1 hours and Var2 seconds the following logic checks the first ten locations
in a model and displays the name of any location
that is completely full.

Display name of full location

Var1 = 1
While Var1 <= 10 Do
Begin
If FreeCap(Loc(Var1)) = 0 Then
DISPLAY Loc(Var1) $ “is full.”
INC Var1
End

String expressions are valid only as part of the


following statements and functions: DISPLAY,
ProModel 413
User Guide

PAUSE, PROMPT, STOP, WRITE, WRITE-


LINE, TRACE, XSUB(), and XWRITE.
Operator Precedence
As in conventional mathematics, ProModel eval-
String expressions uates expressions with more than one operator
according to certain rules of precedence. Expres-
sions with more than one operator are evaluated
If a model had been running for six days, the
statement in the following order:

DISPLAY “The simulation ran \n” $ CLOCK(DAY) $ 1. Terms inside parentheses: ( )


“days.” 2. Exponentiation: **
3. Multiplication: *; Division: /; and Modulus:
would display the following dialog box.
@
4. Addition: +; Subtraction: -
5. Equalities and Inequalities: =, <>, >, >=, <,
<=
6. NOT
7. AND
8. OR
9. Concatenation: $; (For string expressions
only.)
When evaluating more than one operator with the
same precedence, ProModel works from left to
right.
Arithmetic and boolean expressions may include
nested expressions (expressions in parentheses)
to indicate precedence in complex expressions
such as the following examples:

Nested expressions

A+B*(C+D)
((A>B) OR (B>C)) AND (C>D)
The expression (C+D) is a nested expression
which is evaluated first. Multiple nesting is per-
mitted, with the innermost nesting being eval-
uated first.

Example 1

15 - MATRIX[4]**2 + CLOCK(MIN) / 60
414 Chapter 11:
Operator Precedence

In this expression, Matrix[4]**2 is evaluated


first, with the result being subtracted from 15.
This value is then added to the value
obtained from Clock(min)/60.

Example 2

(A>B) OR (A>C) AND (A=D)


would evaluate
(A>B) OR ((A>C) AND (A=D))
ProModel 415
User Guide

Chapter 12: Routing Rules

Routing Rules
Routing rules determine the next location for the
processing entity. They are specified in the
“Rule” field of the Routing edit table. They may
be typed manually or selected from the Routing
Rule Dialog box shown below by clicking on the
Rule button. For more information about routing,
see “Routing Edit Table” on page 155.
416 Chapter 12:
Alternate

Alternate Example

After Shaft completes a 3 minute operation at


Syntax samples Drill, it routes to either Lathe1 or Lathe2 if a SEND
statement somewhere in the model directs an
ALT EntA to be sent to one of those locations. If no
SEND request is waiting, an alternate routing will
route the entity to Lathe3. If no capacity is avail-
able at Lathe3, the entity will wait until capacity
Description becomes available at Lathe3 or a SEND state-
ment that matches the entity and the location in
Causes a location to be selected as an alternate one of the SEND routings executes somewhere in
destination if it has available capacity and the the model.
condition for a preceding routing rule is not met.
If the ALTERNATE location is unavailable, the
entity waits until it becomes available or until the
preceding routing rule is satisfied. Process Table
ALTERNATE routings are common to all pri- Entity Location Operation (min)
mary routings, except the Probability and User Shaft Drill WAIT 3
Condition rules, and should therefore be listed
after the last primary routing but before any Routing Table
backup routings.
Blk Output Destination Rule Move Logic
For example, a high-speed machine might be pre- 1 Shaft Lathe1 Send 1
ferred, but alternatively, a slower machine can be Shaft Lathe2 Send
used when the faster machine is unavailable. Shaft Lathe3 ALT

Valid In See Also


The rule field of the Routing edit table only. An See the other routing rules for exceptions and
ALTERNATE routing may be specified after any special cases. Also see “Processing” on page 149.
other type of routing (including other ALTER-
NATE routings) except for BACKUP, CON-
TINUE and DEPENDENT routings.
ProModel 417
User Guide

Backup Example

After an entity, Chip, completes a 3 minute oper-


Syntax samples ation at CNC, it is routed to Stamp1 when
Stamp1 becomes available. Only if Stamp1 and
BACKUP the alternate location (Stamp2) are both down
will it be routed to Stamp3. If Stamp3 is also
unavailable, Chip will wait for Stamp3 only as
long as both Stamp1 and Stamp2 remain down.
Description
Locations specified by this rule are selected only
if all of the destinations (primary or alternate) Process Table
listed in the preceding routings of the same block
are unavailable due to any downtime, including a Entity Location Operation (min)
shift. One use of BACKUP is to handle a Chip CNC WAIT 3
machine that is not functioning, and entities need
another destination to continue. Routing Table
Blk Output Destination Rule Move Logic
Valid In
1 Chip Stamp1 FIRST 1
Inside the rule field of the Routing edit table, at Chip Stamp2 ALT
the end of a routing block, after one or more pri- Chip Stamp3 BACKU
mary routings or even an ALTERNATE rule. P
Conditions for using Backup routings with either
USER CONDITION and PROBABILITY rout- See Also
ing rules are given in the notes for these rules. ALTERNATE routing rule. Also see “Process-
ing” on page 149.
418 Chapter 12:
Continue

Continue Valid In
The rule field of the Routing edit table only. A
CONTINUE rule must be the only routing in a
Syntax samples
routing block and must always take a quantity of
one.
CONT 1

Example

Description This example simulates an unlimited supply of ore


at a location. After the Extract location extracts
Leaves an entity at the current location for further
the Iron from the Ore, two routing blocks execute.
processing. ProModel searches the process list
The first routing block routes the Iron just extracted
forward and then from the beginning until a pro- on to a molding location. The second routing
cess is found for the output entity at the current block routes another unit of ore back to the loca-
location. If the entity name remains the same and tion, where the process begins again.
no additional processes for that entity type are
defined at the location, the original process will
repeat continuously unless a condition bypasses
the routing block with the CONTINUE rule. Process Table
The CONTINUE routing rule also allows Entity Location Operation (min)
dynamic priority changes. This means a low pri- Ore Extract WAIT 100
ority entity that enters a location can be dynami- Iron Mold ...
cally upgraded to a higher priority without
leaving the location. Move Logic for the routing Routing Table
block with the CONTINUE rule will not be exe-
Blk Output Destination Rule Move Logic
cuted.
1* Iron Mold FIRST 1 MOVE FOR 10
Neither a time value nor a movement rescue is 2 Ore Extract CONT 1
allowed in the Move Logic column for a route ... ... ... ... ...
block containing a CONTINUE rule. This rule is
See the next example for an illustration of
one way to route an entity from a single capacity
dynamic priority changing.
location to the same location without causing a
deadlock. The CONTINUE rule can also simu-
late an unlimited supply of a raw material at a Example
location.
Dynamic Priority Changing Suppose a gear
Statistics for a location using the CONTINUE enters a location. The gear has a low priority. If
rule are collected as one entry for the entity. another type of gear enters the system with a
higher priority, the second gear may preempt the
first gear. Another worker in the plant needs the
first gear immediately or else he will miss his
deadline. Now the first gear’s priority is higher than
the second gear. Using the CONTINUE routing rule
allows you to change the priority of the first gear.
ProModel 419
User Guide

An entity that enters a location with a priority 99


can increase its priority to 999 without ever leav-
ing that location. In addition, this functionality will
also allow you to specifically control which enti-
ties in a multi-capacity location will be pre-
empted by another incoming high priority entity.

Process Table
Entity Location Operation (min)
Gear Loc1 WAIT 2
Gear Loc2 WAIT 3
IF CLOCK() > 1 THEN
BEGIN
var = 999
ROUTE 2
END
ELSE ROUTE 1
Gear Loc2

Routing Table
Blk Output Destination Rule Move Logic
1 Gear Loc2, 99 FIRST 1 MOVE FOR 1
1 Gear Loc3 FIRST 1 MOVE FOR 1
2 Gear Loc2, var CONT 1
1 Gear Loc3 FIRST 1 MOVE FOR 1

See Also
“Processing” on page 149.
420 Chapter 12:
Dependent

Dependent Example

After an entity named “Lamp” completes a 3-


Syntax samples minute preparation at Prep, the paint shop will
paint it. If the paint shop has capacity, the Base
DEP routes to the paint shop and the Shade routes to
the Waiting area based on the dependent rule.
But if the paint shop does not have capacity, the
lamp stays together and routes to Storage on an
Description alternate routing.
Selects a location if, and only if, the routing
immediately preceding it is selected. An ALTER-
NATE routing which follows a dependent routing Process Table
is an alternate to the last major routing preceding
the dependent condition and not to the dependent Entity Location Operation (min)
routing itself. Lamp Prep WAIT 3

A dependent routing should be used when one Routing Table


process results in two different types of entities
that should go to different locations. For exam- Blk Output Destination Rule Move Logic
ple, a dependent routing could simulate the sepa- 1 Base Painting FIRST 1
ration of a customer and his or her order placed at Shade Waiting DEP
the drive-through window at a restaurant. While Lamp Storage ALT
the customer continues on to the cashier window,
the order is sent on to the counter for fulfillment. See Also
“Processing” on page 149.
Valid In
The rule field of the Routing edit table only. A
DEPENDENT routing may be specified after any
other routing rule (including other DEPENDENT
routings) except for a CONTINUE routing.
ProModel 421
User Guide

Empty Example

After EntA completes a 25 second operation at


Syntax samples Loc1, it is routed to one of three multi-capacity
locations (Loc2, Loc3 or Loc4) as soon as one
EMPTY {<expression>} becomes empty. Subsequent routings continue
to the same location until it is full, and then to the
next location that is empty. Once all locations
are filled, no more routings occur until one of the
Description locations becomes empty.
Selects a location only if it is completely empty.
This routing rule is similar to the UNTIL FULL
rule except that a location must be completely Process Table
empty before it is initially selected. Once an
empty location is selected, it continues to be Entity Location Operation (min)
selected until it is full. If no location is empty, the EntA Loc1 WAIT 25 sec
output waits until one becomes empty.
Routing Table
The EMPTY condition is designed for the situa-
tion where two or more multi-capacity locations Blk Output Destination Rule Move Logic
are being filled from the same source and the 1 EntA Loc2 EMPTY 1
modeler desires each location to completely fill EntA Loc3 EMPTY
and completely empty in an alternating fashion. EntA Loc4 EMPTY

Valid In See Also


The rule field of the Routing edit table only. “Processing” on page 149.

Components

<expression>
Total entities output from the process. This expression
is valid only for the first routing of a routing block. For
more information on this expression, see “Processing”
on page 149.
422 Chapter 12:
First Available

First Available Example

After EntA completes a 4 minute operation at


Syntax samples Loc1, it is routed to Loc2, Loc3 or Loc4 depend-
ing on which location is the first to have available
FIRST {<expression>} capacity.

Description Process Table


Selects the first location available among one or
Entity Location Operation (min)
more locations listed in a routing block. Specify-
EntA Loc1 WAIT 4
ing multiple First Available routings in a routing
block has the same effect as specifying a First
Routing Table
Available routing followed by one or more
ALTERNATE routings. An example of using the Blk Output Destination Rule Move Logic
First Available rule in a routing block is given 1 EntA Loc2 FIRST 1
below. EntA Loc3 FIRST
EntA Loc4 FIRST
The First Available rule is the default rule when
defining the initial routing in the Process Editor.
See Also
In this case, the First Available routing can be
interpreted to be the “primary” routing. “Processing” on page 149.

Valid In
The rule field of the Routing edit table only.

Components

<expression>
The total entities output from the process. This expres-
sion is valid only for the first routing of a routing
block. For more information on this expression, see the
“Processing” on page 149.
ProModel 423
User Guide

Join Example

After EntA completes a 5.2 minute operation at


Syntax samples Loc1, it routes to Loc2, Loc3 or Loc4 to join to
some other entity that issued a JOIN request for
JOIN {<expression>} an EntA.

Description Process Table


Selects a location whenever a JOIN request is Entity Location Operation (min)
issued at that location. Since a joining entity does EntA Loc1 WAIT 5.2
not require capacity, there is no need to check for
available capacity at the destination. Multiple Routing Table
JOIN requests are filled according to the oldest
waiting request with the highest priority. Entities Blk Output Destination Rule Move Logic
routed with the JOIN routing rule are not actually 1 EntA Loc2 JOIN 1
sent to their destination until a JOIN statement is EntA Loc3 JOIN
encountered at the destination location. EntA Loc4 JOIN

Valid In See Also

The rule field of the Routing edit table only. JOIN statement. Also see “Processing” on
page 149.
Components

<expression>
The total entities output from the process. This expres-
sion is valid only for the first routing of a routing
block. For more information on this expression, see
“Processing” on page 149.
424 Chapter 12:
Load

Load Example

After EntA completes a 3 minute operation at


Syntax samples Loc1, it is routed to Loc2, Loc3 or Loc4 to be
loaded onto some other entity that has issued a
LOAD {<expression>} LOAD request.

Description Process Table


Selects a location whenever a LOAD request is Entity Location Operation (min)
issued at the destination location. Since a loading EntA Loc1 WAIT 3
entity does not fill capacity, there is no need to
check for available capacity at the destination. Routing Table
Multiple LOAD requests are filled according to
the oldest waiting request with the highest prior- Blk Output Destination Rule Move Logic
ity. 1 EntA Loc2 LOAD 1
EntA Loc3 LOAD
Valid In EntA Loc4 LOAD

The rule field of the Routing edit table only. See Also
LOAD statement. Also see “Processing” on
Components page 149.

<expression>
The total entities output from the process. This expres-
sion is valid only for the first routing of a routing
block. For more information on this expression, see
“Processing” on page 149.
ProModel 425
User Guide

Longest Unoccupied Example

After EntA completes a 2.5 minute operation at


Syntax samples Loc1, it routes to Loc2, Loc3 or Loc4 depending
on the location unoccupied the longest.
LU {<expression>}

Process Table
Description
Entity Location Operation (min)
Selects one of the locations listed in a block of
EntA Loc1 WAIT 2.5
routings based on which has been unoccupied the
longest. If several multi-capacity locations all
Routing Table
have one or more current entities, the location
with the most available capacity will be selected. Blk Output Destination Rule Move Logic
If no capacity is available at any location, the first 1 Plane Gate1 LU 1 MOVE FOR 2
one that becomes available is selected. This rule Plane Gate2 LU MOVE FOR 2
is useful in situations where residual effects must Plane Gate3 LU MOVE FOR 2
diminish before further usage of a location (e.g., Plane Gate4 LU MOVE FOR 2
an oven cooling to an ambient temperature, the
vapor clearing out of a paint booth, etc.). Routing Table
Please note that this routing rule is not valid for Blk Output Destination Rule Move Logic
single-capacity locations 1 EntA Loc2 LU 1
EntA Loc3 LU
Valid In EntA Loc4 LU
The rule field of the Routing edit table only.
See Also

Components “Processing” on page 149.

<expression>
The total entities output from the process. This expres-
sion is valid only for the first routing of a routing
block. For more information on this expression, see
“Processing” on page 149.
426 Chapter 12:
Most Available

Most Available Example

After EntA completes a 4 minute operation at


Syntax samples Loc1, it is routed to Loc2, Loc3 or Loc4 depend-
ing on which location has the most available
MOST {<expression>} capacity at the current time.

Description Process Table


Selects one of the locations listed in a block of
Entity Location Operation (min)
routings based on which has the most available
EntA Loc1 WAIT 4
capacity. If no capacity is available at any of the
locations listed, the first one that becomes avail-
Routing Table
able is selected. Use the MOST routing rule to
equalize queues in front of workers. This rule is Blk Output Destination Rule Move Logic
useful in cases where inventory levels need to be 1 EntA Loc2 MOST 1
balanced among several downstream queues. EntA Loc3 MOST
EntA Loc4 MOST
Valid In
See Also
The rule field of the Routing edit table only.
“Processing” on page 149.
Components

<expression>
The total entities output from the process. This expres-
sion is valid only for the first routing of a routing
block. For more information on this expression, see
“Processing” on page 149.
ProModel 427
User Guide

Probability Example

EntA completes an eight minute operation at


Syntax samples Loc1, and routes to Loc2 80% of the time, Loc3
15% of the time, and to Loc4 5% of the time. If
<probability> {<expression>} EntA selects Loc2 but the location has no avail-
able capacity, EntA will select an alternate loca-
tion, Loc2A. If both Loc2 and Loc2A are down,
EntA selects a backup location (Loc2B). Loc3 has
Description an alternate location (Loc3A) in case it is unavail-
able, but has no backup location. Loc4 has nei-
Randomly selects a location listed in a block of ther an alternate location nor a backup location.
routings based on a probability. Several probabil-
ity routings should be used together and the sum
of all probabilities must equal one. The entity
will wait to be routed until the selected location Process Table
has available capacity. Unlike most primary rout-
ings, an ALTERNATE and BACKUP routing Entity Location Operation (min)
may be specified after each PROBABILITY EntA Loc1 WAIT8
routing in a single routing block. If the selected
location has no ALTERNATE routing and has no Routing Table
available capacity, the entity will wait for the Blk Output Destination Rule Move Logic
location until it has available capacity. 1 EntA Loc2 .800 1
EntA Loc2A ALT
Valid In EntA Loc2B BACKUP
The rule field of the Routing edit table only. EntA Loc3 .150
EntA Loc3A ALT
Claim Loc4 .050
Components
See Also
<probability>
“Processing” on page 149.
The chance of the routing being taken, expressed as a
decimal less than one. All probabilities in a single rout-
ing block must add up to one. This number must be a
value and may not be an expression.
<expression>
The total entities output from the process. This expres-
sion is valid only for the first routing of a routing
block. For more information on this expression, see
“Processing” on page 149.
428 Chapter 12:
Random

Random Example

After EntA completes a 3 minute operation at


Syntax samples Loc1, it is randomly routed to Loc2, Loc3, or
Loc4.
RANDOM {<expression>}

Process Table
Description
Entity Location Operation (min)
Randomly selects one of several available loca- EntA Loc1 WAIT 3
tions listed in a block of routings such that each
location having available capacity is equally Routing Table
likely to be selected. If none of the locations
listed has available capacity, the first location Blk Output Destination Rule Move Logic
that becomes available will be selected. 1 EntA Loc2 RANDOM 1
EntA Loc3 RANDOM
Valid In EntA Loc4 RANDOM

The rule field of the Routing edit table only. See Also
PROBABILITY routing rule. Also see “Process-
Components ing” on page 149.

<expression>
The total entities output from the process. This expres-
sion is valid only for the first routing of a routing
block. For more information on this expression, see
“Processing” on page 149.
ProModel 429
User Guide

Send Example

Purchase Orders (PO’s) are held at a holding


Syntax samples location until final approval is received.
Once a SEND request has been generated at
SEND {<expression>} some other location in the system, the PO is
sent to the appropriate vendor.

Description
Process Table
Causes an entity to remain at the current location
until one of the listed destinations issues a SEND. Entity Location Operation (min)
Once a location has been selected, capacity must PO Holding
be available at that location before the routing
actually takes place. Multiple alternative SEND Routing Table
destinations may be specified in a block.
Blk Output Destination Rule Move Logic
Valid In 1 PO VendorA SEND 1 MOVE FOR 48
Hr
The rule field of the Routing edit table only. PO VendorB SEND MOVE FOR 48
Hr
PO VendorC SEND MOVE FOR 48
Components Hr

<expression> See Also


The total entities output from the process. This expres- “Processing” on page 149.
sion is valid only for the first routing of a routing
block. For more information on this expression, see
“Processing” on page 149.
430 Chapter 12:
Turn

Turn Example

In this example, Purchase Requests (PR’s) are


Syntax samples entered into an on-line accounting system at
location Keypunch. They are then assigned
TURN {<expression>} on a rotating basis to Buyer1, Buyer2, or
Buyer3.

Description
Process Table
Selects the locations listed in a block of routings
in rotation by availability. If none of the locations Entity Location Operation (min)
listed are available, the first one that becomes PO Keypunch WAIT U(3,1) min
available is selected. A particular location may be
listed more than once in a routing block if it is to Routing Table
have a greater proportion of turns than the others.
Blk Output Destination Rule Move Logic
Valid In 1 PR Buyer1 TURN 1
PR Buyer2 TURN
The rule field of the Routing edit table only. PR Buyer3 TURN

Components See Also


“Processing” on page 149.
<expression>
The total entities output from the process. This expres-
sion is valid only for the first routing of a routing
block. For more information on this expression, see
“Processing” on page 149.
ProModel 431
User Guide

Until Full Example

In this example, pallets are scanned at a bar-


Syntax samples code location before being placed in stor-
age in a warehouse. The policy at the
FULL {<expression>} warehouse calls for keeping Aisle1 com-
pletely full before storing anything in Aisle2.
Similarly, Aisle2 must be kept full before storing
anything in Aisle3.
Description
This rule continues to direct all output to the first
location specified until it fills to capacity and Process Table
then to the next location until it fills and so on. If
all locations are full, the first one that becomes Entity Location Operation (min)
available is selected. Pallet Barcode USE Scanner FOR U(2.3,4)

Valid In Routing Table


The rule field of the Routing edit table only. Blk Output Destination Rule Move Logic
1 Pallet Aisle1 FULL 1 MOVE FOR
Components 5
Pallet Aisle2 FULL MOVE FOR
6
<expression> Pallet Aisle2 FULL MOVE FOR
The total entities output from the process. This expres- 7
sion is valid only for the first routing of a routing
block. For more information on this expression, see See Also
“Processing” on page 149.
“Processing” on page 149.
432 Chapter 12:
User Condition

User Condition Components

<Boolean expression>
Syntax samples
Any expression which evaluates to TRUE or FALSE.
<Boolean expression> {<expression>} <expression>
The total entities output from the process. This expres-
sion is valid only for the first routing of a routing
block. For more information on this expression, see
Description “Processing” on page 149.
Selects one of several locations listed in a routing
block based upon a user-defined condition. Sev-
eral User-Condition routings usually are used in Example
the same routing block. At least one of the user-
defined conditions in a block must be true or an Customers bring their cars to a local service
error message will appear and the simulation will station for emissions testing and state inspec-
terminate. Capacity must be available at the loca- tion. After each car completes a 10-minute
tion before the routing actually takes place. inspection operation at location Inspect, they
Unlike most primary routing rules, an ALTER- are put in the proper service bay depending
NATE or BACKUP routing may be specified on the car’s engine type. Late-model (post-
after each USER CONDITION routing in the 1975) cars are tested in Bays 1 and 2, pre-
1975 cars are tested in Bay3, and diesel
same routing block.
engine cars are tested in Bay4. If Bay1 is
selected but not available, an alternate loca-
tion (Bay2) is selected. If both Bay1 and Bay2
are down, a backup location (Bay3) is
selected. Bay3 also has an alternate location
(Bay4) in case it is unavailable, but has no
backup location. Bay4 has neither an alter-
nate location nor a backup location.

Valid In
The rule field of the Routing edit table only.
ProModel 433
User Guide

Process Table
Entity Location Operation (min)
CAR Inspect WAIT 10

Routing Table
Destinatio
Blk Output n Rule Move Logic
1 CAR Bay1 IF Type=1 1
CAR Bay2 ALT
CAR Bay3 BACKUP
CAR Bay3 IF Type=2
CAR Bay4 ALT
CAR Bay4 IF Type=3

See Also
“Processing” on page 149.
434 Chapter 12:
User Condition
ProModel 435
User Guide

Chapter 13: Logic Ele-


ments

Functions Resource-Specific System


Functions
Functions return information such as a location’s
capacity, the amount of time the simulation has Resource-specific system functions may only be
been running, or a random number. A function is used in resource node logic when a resource
a keyword followed by parentheses, which may enters or leaves a node.
contain data that the function needs to complete
its operation. You should be aware that if a func- Downtime-Specific System
tion or variable expecting an integer gets a real Functions
number, it will ignore everything to the right of
the decimal point. ProModel permits you to use downtime-specific
system functions only in downtime logic.

System Functions Shift & Break System Functions


The following list describes the function types ProModel allows you to use these functions only
available in ProModel. in shift and break logic.

General System Functions


General Functions
General system functions return information
about the simulation, such as the length of time
that the simulation has run, and may be refer-
Math Functions
enced in any numeric expression. Math functions are built-in functions used for
performing mathematical operations on numeric
Entity-Specific System Functions expressions.

Entity-specific system functions return informa-


tion about the processing entity, such as the num-
Type Conversion Functions
ber of entities in an entity group. For that reason, When two types of numbers are used in an
these functions may be used only where an entity expression, as when a real value is assigned to an
is processing some type of logic. This includes integer variable, they must all be converted to the
Arrival, Operation, and Location Exit logic. same type before ProModel can evaluate them.
ProModel performs this conversion automatically
436 Chapter 13:
Statements

and, in most instances, this conversion will be system whenever they are encountered by an
satisfactory. The only place where the user may entity in the operation logic. They are valid only
want to use a different conversion is when Pro- in certain areas. See each statement for a list of
Model converts from a real to an integer. places where it is valid.
When converting from a real to an integer, Pro- There are two subsets of operation statements:
Model ignores everything to the right of the deci- entity-related and resource-related. Entity-
mal point. When converting from an integer to a related operation statements perform specific
real, ProModel simply adds a decimal point to the actions on entities only. Resource-related opera-
integer. ProModel handles name-index numbers tion statements involve resources alone (for
exactly like integers. Most often, these automatic example, GET and FREE) or resources and enti-
conversion will be sufficient, but occasionally it ties together (for example, USE).
will be necessary to convert between the types
differently. For these situations, use the conver- Statement Blocks
sion functions.
A statement block is a group of statements that
begin with the keyword BEGIN, or the symbol
Statements “{”, and end with the keyword END, or the sym-
bol “}”. Two examples appear below. See
Statements cause ProModel to take some action BEGIN and END for more extensive examples of
or perform some operation. Unlike functions, statement blocks.
statements neither return a value nor use paren-
theses, and logic may contain comments. (See
“Comments” on page 461.) Statements can use Statement blocks
spacing (including a new line) before each word
in a statement, and are case insensitive so any let- BEGIN {
ter may be either upper or lower case. Statement 1 Statement 1
Statement 2 Statement 2
General Action and Control
Statement 3 Statement 3
Statements
... ...
General statements can be divided into two main
Statement n Statement n
categories: action and control statements. They
are called general because they can be used in END }
any logic. Action statements cause some action to
occur in the model, such as changing an entity’s
graphic or writing to a file. Control Statements
determine the next statement to be executed, such
as loops, branches, and statement blocks.

Resource- and Entity-Related


Operation Statements
Operation Statements perform specific actions on
entities and resources at locations throughout the
ProModel 437
User Guide

Distribution Functions
Distribution functions are built-in functions
which, in conjunction with streams, return ran-
dom values according to a statistical distribution.
The following table is a summary of available
distribution functions. They are valid in any
numeric expression.

Distribution Syntax Individual Components


Beta B(a,b,c,d{,<s>}) a=shape value 1, b=shape value 2, c=lower boundary, d=upper
boundary
Binomial BI(a,b{,<s>}) a=batch size, b=probability of “success”
Erlang ER(a,b{,<s>}) a=mean value, b=parameter
Exponential E(a{,<s>,<ax>}) a=mean
Gamma G(a,b{,<s>,<ax>}) a=shape value, b=scale value
Geometric GEO(a{,<s>}) a=probability of “success”
Inverse Gaussian IG(a,b{,<s>,<ax>}) a=shape value, b=scale value
Lognormal L(a,b{,<s>,<ax>}) a=mean, b=standard deviation
Normal N(a,b{,<s>}) a=mean, b=standard deviation
Pearson5 P5(a,b{,<s>,<ax>}) a=shape value, b=scale value
Pearson6 P6(a,b,c{,<s>,<ax>}) a=shape value 1, b=shape value 2, c=scale value
Poisson P(a{,<s>}) a=quantity
Triangular T(a,b,c{,<s>}) a=minimum, b=mode, c=maximum
Uniform U(a,b{,<s>}) a=mean, b=half range,
User-defined <name>({<s>}) Name of a user-defined distribution as defined in the User Distri-
bution section
Weibull W(a,b{,<s>,<ax>}) a=shape value, b=scale value

General Components time shift the entire distribution. Any time an axis
shift is specified, a stream must be specified also.
<s> The optional stream to use in conjunction
with the distribution’s probabilities. If this option Any negative value returned by a distribution that
is omitted, ProModel will use stream one. For is used for a time expression will be automati-
more information on streams, see “Streams” on cally converted to zero.
page 266.
<ax> An optional axis shift. The distributions,
E, G, W, L, IG, P5, and P6 all normally have a
minimum value of zero. Use an axis shift to alter
the distribution’s minimum value and at the same
438 Chapter 13:
Priorities

Priorities
Many statements in this manual use <priority> as
a component. A priority determines the order in
which competing commands are fulfilled. For
example, priority determines which of two com-
peting requests to USE a resource gets fulfilled,
or which of two competing requests to SEND the
same entities to different locations gets fulfilled.
Commands or entities with high enough priority
can even bring back up locations that are down,
or force a location to stop processing one entity
and process another instead. This is called “pre-
emption.” All priorities must be an expression
that evaluates to a number between 0 and 999.
For a complete explanation of priorities and pre-
emption, see “Location Priorities and Preemp-
tion” on page 111, “Resource Shift Downtime
Priorities” on page 141, “Preemptive Entities” on
page 121, and “Preemption Process Logic” on
page 300.
ProModel 439
User Guide

Chapter 14: Statements


and Functions

Accum that location will participate in the same accumu-


lation.
Entity-Related Operation Statement
Valid In
The operation column of process edit tables only.
Syntax samples
ACCUM must be used at a location with enough
capacity to accumulate the specified quantity.
ACCUM <expression>
ACCUM 10
ACCUM Var1 Components

<expression>
The number of entities to accumulate. If this expres-
Description
sion results in zero or one, it is ignored. If it results in a
Accumulates, without consolidating, the speci- number greater than the location’s capacity or a nega-
fied quantity of entities at a location. ACCUM tive number, the simulation will stop with an error.
works like a gate that prevents entities from pro- This expression is evaluated every time an entity to be
cessing until a certain number arrive. Once the accumulated arrives, so the quantity to be accumulated
specified number of entities have accumulated, can vary as the entities to be accumulated arrive. If an
they will go through the gate and begin process- entity arrives that changes this expression to a number
ing individually, independent of each other. lower than the number of entities already accumulated,
all of the accumulated entities begin to process.
ACCUM can be used to model situations where
several entities should be accumulated before
they get processed. For example, when a resource
processes orders at a work station, it may be more
Example
efficient to accumulate several orders before
requesting the resource. Entities named “Pallet” arrive at a location
named “Loading” and accumulate in batches of
If you specify an ACCUM operation in a process 20. Entities named “Box” also arrive at Loading
for an individual entity, accumulation will occur and accumulate in batches of 10. Only after the
by individual entity type. However, if you specify right number of boxes or pallets accumulates
ALL as the processing entity, all entity types at does ProModel request the forklift. The accumula-
tion of Boxes and Pallets at Loading is entirely
440 Chapter 14:
Accum

independent because the accumulation state-


ments are in different records. Note that the fork-
lift is used for two minutes per pallet or box,
because each pallet and box process individu-
ally after accumulating all of them. While the
accumulation of entities at Loading is by entity
type, the accumulation at the location, “Storage”
is independent of entity type since the ALL key-
word denotes common processing for all entities
at this location.

Process Table
Entity Location Operation (min)
Pallet Loading ACCUM 20
USE ForkliftFOR 2
Box Loading ACCUM 10
USE Forklift FOR 2
ALL Storage ACCUM 30

Routing Table
Blk Output Destination Rule Move Logic
1 Pallet Storage FIRST 1 MOVE FOR 5
1 Box Storage FIRST 1 MOVE FOR 5
1 ALL Loc3 FIRST 1 MOVE FOR 5

See Also
COMBINE, JOIN, and GROUP.
ProModel 441
User Guide

Activate Components

General Action Statement <subroutine>


The name of the subroutine to run. This name should
Syntax samples appear exactly as if the subroutine were being called
normally. Any return value for this function is ignored.
See “Subroutines” on page 246.
ACTIVATE <subrou-
tine>({parameter1>,<parameter2>...}) <parameters>
ACTIVATE Sub1() The parameters that the subroutine normally takes.

Description
Example
Starts an independent subroutine. Only subrou-
tines of type interactive can be called with ACTI- This example uses ACTIVATE in a model’s initializa-
VATE. The calling logic then continues without tion logic to start a subroutine named Res_Log().
waiting for the called subroutine to finish. There- Res_Log() is a user-defined subroutine that logs
fore, independent subroutines can run in parallel every time that all units of a resource named
with the logic that called them. Independent sub- Worker are in use. After it logs the time that all
routines are not entity or location dependent and units were busy, it waits ten minutes to check
run without regard to what happens inside the again. Note that the WHILE...DO loop in the sub-
routine is never exited. This technique allows the
logic that called them.
subroutine to run during the entire simulation.
Use ACTIVATE to process logic that has WAIT Initialization Logic:
or WAIT...UNTIL statements when you do not Activate Res_Log()
want to use an entity to process the WAIT or
Res_Log()
WAIT...UNTIL statements. For example, an
INT X = 1
ACTIVATE in the initialization logic could call a
WHILE X = 1 DO
subroutine that adjusts the arrival frequency for a BEGIN
type of entity depending on the time of day. IF FREEUNITS(Worker)=0
Independent subroutines called with ACTIVATE THEN LOG "All workers busy at ",0
WAIT 10
cannot use entity-specific or location-specific
END
system functions. If the subroutine has a return
value, then that value is ignored. External subrou-
tines cannot be called with ACTIVATE, although See Also
they may be called from within an activated sub- XSUB(). Also see “Subroutines” on page 246.
routine.

Valid In
Any logic.
442 Chapter 14:
Animate

Animate mum. This allows the modeler to more easily view


which resource (RES1 or RES2) is captured to ser-
vice the location.
General Action Statement

Syntax samples

ANIMATE <expression>
ANIMATE 70
ANIMATE Var1

Description
Sets the simulation’s animation speed. The
higher the value, the faster the animation. ANI-
MATE is used primarily to speed up or slow
down a model for cursory or detailed observation
whenever a particular condition is encountered. See Also
Another common use is to set the animation
speed to one-hundred in the Initialization Logic GRAPHIC and SOUND.
to rapidly advance the simulation to some point
in time.

Valid In
Any logic.

Components

<expression>
The new speed of the animation. This expression can
be any number from 0 to 100 and is evaluated every
time the ANIMATE statement is encountered. The
default speed is 56.

Example

This example shows the use of the ANIMATE state-


ment in the downtime logic for the location Press.
Whenever Press goes down for service, the ani-
mation speed is slowed to 30 percent of maxi-
ProModel 443
User Guide

ArrayDims()
General System Function

Syntax samples

ARRAYDIMS(<arrayname>)
ARRAYDIMS(MyArray)

Description
Returns the number of dimensions in an array.

Valid In
Any Logic

Components

<arrayname>
The name of the array for which you wish to know the
number of dimensions.

See Also
ArrayDimSize().
444 Chapter 14:
ArrayDimSize()

ArrayDimSize()
General System Function

Syntax samples

ARRAYDIMSIZE(<arrayname>, <dim_num>)
ARRAYDIMSIZE(MyArray, 2)

Description
Returns the size of a dimension in an array. You
must provide the name of the array and the partic-
ular dimension of the array for which you want to
know the size.

Valid In
Any Logic

Components

<arrayname>
The name of the array.
<dim_num>
The number of the dimension for which you wish to
know the size.

See Also
ArrayDims().
ProModel 445
User Guide

Assignment Statement
Syntax samples

<variable, array element, or attribute> =


<numeric expression>

Description
Assigns the value of a numeric expression to a
designated variable, array element, or attribute.

Valid In
Any Logic

Example

Var1 = 300
Attr2 = Clock(hr) - Attr3

Please Note

If you assign an expression that evaluates to a


real number to a variable, array, or attribute of
type integer, the number truncates unless you use
the ROUND() function.
446 Chapter 14:
Begin

Begin ments within the BEGIN and END only if Attr1


equals one.
IF Attr1 = 1 THEN
General Control Statement
BEGIN
Syntax samples ORDER 10 EntA
INC Var1
BEGIN or {
END
Just as in the logic above, if Attr1 in the following
WHILE FREECAP(Loc1) > 5 DO example equals one, ten entities are ordered.
BEGIN However, Var1 increments regardless of the value
INC Var2, 5 of Attr1. The IF...THEN applies only to the very next
WAIT 5 sec statement, no matter how you format the logic.
END
IF Attr1 = 1 THEN
ORDER 10 EntA
IF Var1 > 5 THEN
INC Var1
{
INC Var2, 5
WAIT 5 sec
}
See Also
END, IF...THEN...ELSE, DO...WHILE,
WHILE...DO, and DO...UNTIL.
Description
Defines a statement block with a corresponding
END statement. BEGIN and END are almost
always used in conjunction with other control
statements such as IF...THEN and DO...WHILE.
Every BEGIN statement must pair with an END
statement.

Valid In
Any logic.

Example

Compare the following logic examples:


The example below includes a BEGIN and END
statement. In this logic, if the attribute Attr1 equals
one, ten entities are ordered and the variable
Var1 increments. ProModel executes the state-
ProModel 447
User Guide

Break Process Table


Entity Location Operation (min)
General Control Statement Claim Station1 WHILE V1<3 DO
BEGIN
WAIT 3 min
Syntax samples IF V3<=5 THEN
BEGIN
BREAK WAIT 3 min
BREAK
END
WAIT 5 min
END
Description //Break to here
Exits the innermost WHILE...DO, DO...WHILE,
or DO...UNTIL loop. The next statement to be Routing Table
executed will be the one immediately following Blk Output Destination Rule Move Logic
the END statement associated with the innermost 1 EntA Station2 FIRST 1 MOVE FOR 5
loop. If a BREAK is encountered outside any
loop, then ProModel exits the entire logic. See Also

Valid In BREAKBLK.

Any logic.

Example

Normally, a WHILE...DO loop repeats a statement


block until a certain condition becomes false.
This example shows the use of a BREAK statement
to exit the loop based on a condition not
included in the WHILE...DO loop. As long as the
variable V1 is less than three and the variable V3
is less than or equal to five, both the three-minute
wait and the five-minute wait will be executed for
a total of eight minutes. However, if V3 becomes
greater than five, the total wait will be six minutes:
three minutes in the main part of the loop and
another three minutes inside the IF...THEN state-
ment block. The five minute wait will not be exe-
cuted because the BREAK statement exits the
loop entirely.
The line “//Break to here” is a comment that marks
the next line of logic executed after the BREAK.
448 Chapter 14:
BreakBlk

BreakBlk Process Table


Entity Location Operation (min)
General Control Statement ALL Shipping IF ENTITY() = Letter THEN
INC No_of_Let
IF ENTITY() = Pkg THEN
Syntax samples BEGIN
INC No_of_Pkg
BREAKBLK IF Attr1 = 1 THEN
BREAKBLK
USE Wrapper FOR 8
Attr1 = 1
END
Description //Breakblk to here
USE Addresser FOR 3
Exits from the innermost statement block. The
next statement to be executed will be the one
immediately following the END statement of the Routing Table
innermost statement block. If a BREAKBLK is Blk Output Destination Rule Move Logic
executed outside any statement block, ProModel 1 ALL Post_Office FIRST 1 MOVE FOR
will exit the logic completely. 5

Valid In See Also


Any logic. BREAK.

Example

This example uses BREAKBLK in the logic for a


shipping department that handles two types of
entities, Letters and Packages. Both packages
and letters need to be addressed, but packages
may need to be wrapped before they are
addressed. When a package arrives, shipping
increments the variable No_of_Pkg to keep track
of the number of packages it ships. Attr1 is then
checked to see if the package has been
wrapped. If the package has been wrapped (if
Attr1 = 1), the BREAKBLK statement exits the state-
ment block that wraps packages. If the package
has not been wrapped, a resource, Wrapper,
wraps the package. Finally, all entities that Ship-
ping processes are addressed by the same
statement and routed to the location
Post_Office. The line
“// Breakblk to here” is a comment which marks
the next statement executed after the BREAKBLK.
ProModel 449
User Guide

CalDay() Example

General System Function Suppose that shipment arrival types vary from
day to day. Since Monday’s Shipment_Type_A
arrival patterns are unique, you will need to use a
Syntax samples distribution specific to those patterns.
IF CALDAY()=1 THEN
CALDAY()
BEGIN
Shipment_Type_A =
Monday_Distribution_A
Description USE Forklift FOR Unload_Time
END
The CALDAY() function corresponds to the
weekday of the calendar date you defined as part
of the warm-up period or simulation begin date
under simulation options. Since CALDAY() See Also
resets with the advent of a new week, every CALDOM(), CALHOUR(), CALMIN(), CAL-
weekday will return the same value (i.e., MONTH(), and CALYEAR().
Wednesday will always return a value of 3).

Valid In
Any logic.

Please note

CALDAY() works only when you select calendar


date in the simulation options dialog.
450 Chapter 14:
CalDOM()

CalDOM()
General System Function

Syntax samples

CALDOM()

Description
The CALDOM() function corresponds to the cal-
endar day of the month you defined as part of the
warm-up period or simulation begin date under
simulation options. Values returned by this func-
tion will be integers in the range of 1 to 31.

Valid In
Any logic.

Please note

CALDOM() works only when you select calendar


date in the simulation options dialog.

See Also
CALDAY(), CALHOUR(), CALMIN(), CAL-
MONTH(), and CALYEAR().
ProModel 451
User Guide

CalHour() See Also


CALDAY(), CALDOM(), CALMIN(), CAL-
General System Function MONTH(), and CALYEAR().

Syntax samples

CALHOUR()

Description
The CALHOUR() function corresponds to the
hour of the calendar date you defined as part of
the warm-up period or simulation begin date
under simulation options. Since this function ties
directly to the 24-hour clock displayed on the
screen during simulation, CALHOUR() will
never return a value higher than 23.

Valid In
Any logic.

Please note

CALHOUR() works only when you select calen-


dar date in the simulation options dialog.

Example

The following example implements a change in


personnel used to perform an operation. After the
simulation runs for 18 hours, the technician
becomes available to perform the activity.
IF CALHOUR() > 18 THEN
USE Worker FOR N(10,4)
ELSE USE Technician FOR N(8,2)
452 Chapter 14:
CalMin()

CalMin() See Also


CALDAY(), CALDOM(), CALHOUR(), CAL-
General System Function MONTH(), and CALYEAR().

Syntax samples

CALMIN()

Description
The CALMIN() function corresponds to the
minute of the calendar date you defined as part of
the warm-up period or simulation begin date
under simulation options. Since this function ties
directly to the 24-hour clock displayed during
simulation, CALMIN() will never return a value
higher than 59.

Valid In
Any logic.

Please note

CALMIN() works only when you select calendar


date in the simulation options dialog.

Example

Suppose parts have a fixed shipping time of 4:30


PM. The following logic would order parts to the
shipping area.
IF CALHOUR() = 16 AND CALMIN() = 30 THEN
ORDER 1 Part TO Shipping_Area
ProModel 453
User Guide

CalMonth()
General System Function

Syntax samples

CALMONTH()

Description
The CALMONTH() function corresponds to the
month of the year you defined as part of the
warm-up period or simulation begin date under
simulation options. Values returned by this func-
tion will be integers in the range of 1 to 12.

Valid In
Any logic.

Please note

CALMONTH() works only when you select calen-


dar date in the simulation options dialog.

Example

If CalMonth()=12 THEN WAIT 20


Else Wait 10

See Also
CALDAY(), CALDOM(), CALHOUR(),
CALMIN(), and CALYEAR().
454 Chapter 14:
CalYear()

CalYear()
General System Function

Syntax samples

CALYEAR()

Description
The CALYEAR() function corresponds to the
year of the calendar date you defined as part of
the warm-up period or simulation begin date
under simulation options.

Valid In
Any logic.

Please note

CALYEAR() works only when you select calendar


date in the simulation options dialog.

See Also
CALDAY(), CALDOM(), CALHOUR(),
CALMIN(), and CALMONTH().
ProModel 455
User Guide

Cap() Example

General System Function The individual ovens of a ceramics plant have


different capacities, but otherwise they are
exactly the same. While each oven could be
Syntax samples modeled as an individual location, it would be
easier to model this situation as a multi-unit loca-
CAP (<location>) tion. This example uses CAP() in the processing
logic of the parent location to accumulate
GROUP CAP(Loc1) enough Sinks to fill each oven. The LOCATION()
function returns the value of the current location.

Description
Returns the total capacity of a location. CAP() Process Table
can be used to prepare a batch of entities to fill a
Entity Location Operation (min)
location. Sink Oven ACCUM CAP(LOCATION())

Valid In
Routing Table
Any logic and any expression evaluated after
Blk Output Destination Rule Move Logic
translation. For a list of expressions evaluated
1 Sink Cool FIRST 1 MOVE FOR
after translation, see the “Appendix A” on 5
page 587.
See Also
Components
FREECAP(), LOC(), and LOCATION().
<location>
The name of the location to examine. If this component
is the name of a multi-unit location, CAP() will return
the capacity of the entire location. For example, if each
unit of a five-unit location has a capacity of five,
CAP() will return twenty-five. This component can
also be the name of an individual unit in a multi-unit
location.
456 Chapter 14:
Char()

Char() Example

String Function The logic below displays the combined cost of all
the Parts ordered through a particular service
center. The simulation has kept a tally of all the
Syntax samples parts it has ordered in the variable Parts, and
each part cost 25 English pounds. The logic dis-
CHAR(<expression>) plays the cost of the parts with the pound symbol
(£), which is ASCII code 156.
CHAR(10)
DISPLAY “Total cost of parts:” $ CHAR(156) $ Parts *
25

Description
Returns the ASCII character for the number that
the expression evaluates to. This function is most
useful for outputting ASCII characters that can-
not be typed, such as accented characters. This
function is most often used in conjunction with a
string expression and the concatenation (“$”)
operator.
The number corresponding to the ASCII charac-
ter varies with each computer depending on the
character set specified in the config.sys file of See Also
your computer. To determine the number corre- “String Expressions” on page 412.
sponding to the ASCII character at your com-
puter, run the model CHAR.MOD found in the
MODELS\REFS directory. View the file this
model generates called CHAR.TXT found in the
same directory as the model.

Valid In
Any string expression.

Components

<expression>
Any expression that evaluates to a number between 0
and 255. The expression is evaluated every time the
CHAR() function is encountered.
ProModel 457
User Guide

Clock() Components

General System Function <time unit>


The elapsed simulation time will be returned in this
Syntax samples unit. This may be HR, MIN, SEC, DAY, WK. If omit-
ted, the value returned will be in the default time units
as specified in the General Information dialog box.
CLOCK({<time unit>}) When using CLOCK() to capture a time for later use
IF CLOCK(DAY) >= 1.5 THEN PAUSE with the LOG statement, the units should be omitted.

Attr1 = CLOCK()
See Also
“General Information” on page 179 and “Time
Description Expressions” on page 411.
Returns value of the elapsed simulation time in
the units specified. Clock units should be kept
consistent when comparing values. If an attribute
has been assigned a time in minutes, any time
value compared with that attribute should also be
in minutes.
When no units are specified in the parentheses in
the clock function, ProModel returns the default
time unit specified in the General Information.

Valid In
Any logic and most fields, except those fields
evaluated at translation. For a list of fields evalu-
ated at translation, see the “Appendix A” on
page 587.
458 Chapter 14:
Close

Close
General Operation Statement

Syntax samples

CLOSE <file ID>


CLOSE Arrival_File
CLOSE ALL

Description
Closes a file that has previously been written to
with WRITE, WRITELINE, XWRITE, or read
with READ. Use CLOSE when finished with a
file to free system resources. A file will automati-
cally be re-opened to be read or written if it has
been closed. All opened files are automatically
closed at the end of a simulation. When you are
using many external files and you want to con-
serve system resources, this statement is espe-
cially helpful.

Valid In
Any logic.

Components

<file ID>
The file ID of the desired file as defined in the External
Files editor.

See Also
READ, WRITE, WRITELINE, XWRITE, and
RESET.
ProModel 459
User Guide

Combine Valid In
The operation column of Process edit tables only.
Entity-Related Operation Statement COMBINE may not be used in combination with
CREATE, GROUP, UNGROUP, LOAD,
UNLOAD, SPLIT AS, or other combine state-
Syntax samples
ments in the same process logic.
COMBINE <expression> {AS <new entity
name>} Components
COMBINE Var1
<expression>
COMBINE 3 AS EntQ
The number of entities to combine. Negative values
COMBINE Var1 as ENT(Attr1) generate an error message. If this expression evaluates
to zero, it is ignored. If it evaluates to one, then no enti-
ties are actually combined, but the entity that encoun-
tered the combine statement is renamed (if the AS
Description option has been specified).
Accumulates and consolidates a specified quan- This expression is evaluated every time an entity
tity of entities into an entity, optionally with a encounters the COMBINE statement, so the amount of
different name. Unlike the GROUP statement, entities to be combined can vary as the simulation
combined entities lose their identities and progresses. If an entity arrives that changes this expres-
attributes and cannot be ungrouped later. Use sion to a number lower than the number of entities
already waiting to be combined, all of the entities wait-
COMBINE when several entities need to be com-
ing to be combined are combined, including the entity
bined, such as when eight spark plugs are com-
that just arrived.
bined in a box. Note that after several entities
have been combined at a location, no additional AS <new entity name>
statistics will be collected for any of the com- The optional name of the resulting entity. If left off, the
bined entities at that location. new entity will have the same name as the last com-
bined entity or the output entity name.
When specifying COMBINE <expression> AS
<new entity name> in the operation logic, there
must be another operating block at the same loca- Explicit Entity Actions
tion. In this case, the incoming entity at the new
operating block is the new entity name specified COMBINE passes cost on to new entities but not
in the COMBINE statement. statistical information. ProModel counts com-
bined entities as exits.
460 Chapter 14:
Combine

Example

A manufacturing plant makes computer mother-


boards. After manufacture and inspection, when
the motherboards are ready for shipping, workers
combine them into sets of twenty to distribute to
the company’s customers. A COMBINE statement
will work well for this example, because workers
do not inspect or use the individual mother-
boards again. At the final assembly location,
workers group motherboards into totes of twenty,
and route the totes to the shipping department.

Process Table
Entity Location Operation (min)
mboard Assembly COMBINE 20

Routing Table
Blk Output Destination Rule Move Logic
1 Tote Shipping FIRST 1 MOVE FOR 5

See Also
GROUP, ENT(), ACCUM, and LOAD. Also see
the “Attributes” on page 225.
ProModel 461
User Guide

Comments Valid In
Any logic.
Documentation Symbols
Example
Syntax samples
The logic below has several notes to explain it.
# Additionally, ProModel ignores the ELSE statement
and the ELSE statement’s block.
//
IF Parts_Available > Attr2 THEN
/*...*/
//Parts needed is stored in attribute 2
BEGIN
JOIN Attr2#Join the number of parts
Components # needed only if there are
# enough parts available.
#
WAIT Attr1
The pound sign signals the start of a one-line comment.
END
ProModel will ignore any characters on the rest of the
line. /* ELSE
// BEGIN//Start operation
Two forward slashes signal the start of a one-line com- INC Var1
ment. ProModel will ignore any characters on the rest
WAIT Attr3
of the line. This symbol works exactly the same as the
# sign. END */
/*...*/
A slash followed by an asterisk signals the start of a
multi-line comment. ProModel will ignore all charac-
ters after the “/*” until it finds an asterisk followed by a
slash, “*/”. Use this type of comment for long explana-
tions and to prevent ProModel from executing long
portions of logic during debugging. Comments using //
or # may be nested inside multi-line comments.

Description
Comments are notes to the modeler inside blocks
of logic. ProModel ignores them, but they can be
particularly useful to explain logic when more
than one person will be using a model.
462 Chapter 14:
Contents()

Contents() Example

General System Function An assembly line has a location called Clean


that often gets too busy for one operator to han-
dle and the supervisor then comes to help. The
Syntax samples processing logic below models this situation with
an IF...THEN statement and the CONTENTS() func-
CONTENTS(<location>{,<entity type>}) tion. As long as the location contains fewer than
five entities, a worker processes any arriving enti-
LOAD CONTENTS(Loc1) ties. However, if the location’s contents are
JOIN CONTENTS(Loc1, EntA) EntA greater than five, the Supervisor processes them.

Description Process Table


Returns either the total number of entities at a Entity Location Operation (min)
location or the number of a certain type of entity ALL Clean IF CONTENTS(Clean)<5
at a location. Use CONTENTS() to make deci- THEN
sions based on how busy a location is. Using USE Worker FOR 10
ELSE
CONTENTS() to keep track of the number of USE Worker FOR 10
entities at a location requires fewer steps and OR Supervisor FOR 10
allows more flexibility than using variables to
count the number of entities that enter and exit a Routing Table
location. For example, the second syntax does in
one statement what would require several state- Blk Output Destination Rule Move Logic
ments without the CONTENTS() function. 1 ALL Mold FIRST 1 MOVE FOR
1
Valid In
See Also
Any logic and all fields except those fields evalu-
ated at translation only. For a list of the fields FREECAP(), LOC(), ENT(), and FREEUNITS().
evaluated only at translation, see the “Appendix
A” on page 587.

Components

<location>
The name of the location to examine.
<entity type>
The optional name of the type of entity to look for. If
omitted, CONTENTS() will return the total of all enti-
ties at the location.
ProModel 463
User Guide

Create Components

Entity-Related Operation Statement <expression1>


The number of new entities to create. This expression
Syntax samples is evaluated every time the create statement is encoun-
tered.

CREATE <expression1> {AS <entity name>} AS <entity name>


{TAKE {<expression2>} <resource>,...} The name of the new entities. ProModel will search the
CREATE 10 AS EntX process list for the new entity type and begin process-
ing them before it finishes processing the entity that
CREATE 2 AS EntB TAKE 1 Res1, 2 Res2 created them. If omitted, the entities will be named the
CREATE Var1 AS Ent(Var2) TAKE Var3 same as the currently processing entity.
Res(Var4) TAKE <expression2>
The first created entity will take any resources
listed here from the parent entity. This compo-
Description nent is optional. The second syntax example
above creates two EntB’s. The first of the two
Creates a specified number of entities in addition
will own one unit of Res1 and two units of Res2.
to the original entity and copies all attributes of
the original entity to each new entity. The first <resource>
entity created can optionally take any of the The name of the resource whose ownership should be
resources owned by the parent entity. The newly transferred to the first new entity. Using the keyword
created entities require no additional capacity at ALL here will take all resources owned by the parent
the location and are processed immediately. entity.
The CREATE statement can simulate the cre-
ation of paperwork that needs to be hand-carried
Explicit Entity Actions
to another location to be approved while the base
entity continues to process. Before the base entity The CREATE statement forms a new entity with
can exit the location, the paperwork must be new statistical information and cost. ProModel
approved and routed back to the original location adds an initial cost to explicitly created entities
where it is joined to the base entity. (i.e., entities created with the CREATE state-
ment).
Valid In
Implicit Entity Actions
The operation column of process edit tables only.
CREATE may not be used in combination with ProModel allows you to use the CREATE state-
LOAD, UNLOAD, GROUP, UNGROUP, SPLIT ment implicitly as part of the routing definition.
AS, or other CREATE statements in the same To do this, define a route block and check the
processing logic. New Entity option. ProModel does NOT add an
initial cost to implicitly created entities.
464 Chapter 14:
Create

Example

The following example shows how one entity,


Record, creates two new entities. Note that there
is no routing defined in this process for the new
entities, Copy. The new entities are handled
according to the logic defined in the subsequent
process.

Process Table
Entity Location Operation (min)
Record Station1 WAIT N(8,.3)
CREATE 2 AS
Copy
Copy Station1 WAIT U(3,.3)

Routing Table
Blk Output Destination Rule Move Logic
1 Record Station2 FIRST 1MOVE FOR 5
1 Copy File_Cab FIRST 1MOVE FOR 5

See Also
ORDER, SPLIT AS, ENT(), and RES().
ProModel 465
User Guide

Debug Process Table


Entity Location Operation (min)
General Action Statement Client Recep DEBUG
IF Attr1=1 THEN
GRAPHIC
Syntax samples WAIT 5 min

DEBUG Routing Table


Blk Output Destination Rule Move Logic
1 Client Waiting FIRST 1 MOVE FOR 5
Description
During run time, the ProModel debugger would
Brings up ProModel’s debugger. Use DEBUG to appear displaying the following information:
step through logic one statement at a time and
examine variable and attribute values while
developing a model. After a model is working,
DEBUG statements are generally removed.

Valid In
Any logic.

Example

If you were having trouble with a Client’s logic at


a particular location, we could start the process-
ing logic with a DEBUG statement, as in the fol-
lowing example. This would allow you to watch See Also
each Client’s logic execute, statement by state-
ment, revealing problems with the logic’s flow. “Debug Option” on page 357.
466 Chapter 14:
Dec

Dec Example

General Operation Statement The example below shows two variables decre-
mented in exit logic. The variable Num_in_system
is decremented by one, while variable Var3 is
Syntax samples decremented by 20.

DEC <name>{, <expression>}


DEC Var1
DEC Attr1, 5

Description
Decrements a variable, array element, or attribute
by the value of a specified numeric expression.
To decrement a variable, attribute, or array ele-
ment when the current entity actually leaves a
location, use DEC in the move logic.

Valid In See Also


Any logic. INC. Also see “Numeric Expressions” on
page 409.
Components

<name>
Any variable, array element, or attribute.
<expression>
The amount to decrement the value. If this expression
is omitted, the value will be decremented by one. This
can be a negative number.
ProModel 467
User Guide

Display Example

General Action Statement This simple example displays the value of both
Var1 and of Attr1 if Attr2 is 1. This logic will display
the dialog box below if Attr2 is 1. If Attr2 is not 1,
Syntax samples an error message will appear.
Operation (min)
DISPLAY <string expression>
IF Attr2=1 THEN
DISPLAY “Var1 =” $ Var1 $ “and Attr1 =” $
Attr1 DISPLAY “Var1 =” $ Var1 $ “\nand Attr1 =” $ Attr1

DISPLAY “Now beginning 100th process” ELSE

DISPLAY Number_in_Queue DISPLAY “Error”

Description
Pauses the simulation and displays a message.
The simulation will resume when the user selects
OK. The concatenation operator ($) should be
used to combine a numeric value into the string
(as in the first syntax example above). Using the
ENT(), LOC(), and RES() functions will display
the name of the entity, location, or resource.
Please note
Valid In
Any logic. The “\n” character starts new lines.

Components

<string expression>
See Also

The message to be displayed. To display a numeric PROMPT, PAUSE, CHAR(), and FORMAT().
value, use the concatenation operator ($) as in the first
syntax example.
468 Chapter 14:
Do...Until

Do...Until <Boolean expression>


As long as this expression is FALSE, the loop will con-
tinue. This expression is evaluated for each iteration of
General Control Statement
the loop.

Syntax samples
Example
DO <statement block> UNTIL <Boolean
expression>
A machining station can manufacture parts of
increasing complexity from the same entity,
DO INC Var1 UNTIL Array1[Var1] <> 10 called a Blank. When a Blank arrives at the sta-
tion, the value stored in Attr1 determines the
complexity of the part and the amount of time
DO needed to create the new part. The following
logic models this situation with a DO...UNTIL loop.
BEGIN All blanks that arrive go through a five minute pro-
INC Var2, 5 cessing time, and then go through the operation
several more times depending on the value of
WAIT 5 sec Attr1.
END
UNTIL FreeCap(Loc1) > 5
Process Table
Entity Location Operation (min)
Description Blank Machining INT Count = 0
Repeats a statement or statement block continu- DO
BEGIN
ously while a condition remains false. WAIT 5 min
DO...UNTIL is an exit-condition loop, meaning INC Count
that the loop will always be executed at least END
once. Use DO...UNTIL when an operation will UNTIL Count = Attr1
always be executed at least one time and possibly
more times. Routing Table
Blk Output Destination Rule Move Logic
Valid In
1 Base Painting FIRST 1
Any logic.
See Also
Components BEGIN, END, DO...WHILE, and WHILE...DO.

<statement block>
The statement or block of statements to execute.
ProModel 469
User Guide

Do...While Components

General Control Statement <statement block>


The statement or block of statements to execute.
Syntax samples <Boolean expression>
As long as this expression is TRUE, the loop will con-
DO <statement block> WHILE <Boolean tinue. This expression is evaluated for each iteration of
expression> the loop.

DO INC Var1 WHILE Array1[Var1] <> 10


DO Example
BEGIN
INC Var2, 5 The logic below orders a minimum of ten cases
WAIT 5 sec to location Receiving every time it is encoun-
END tered. As long as the location has a capacity
WHILE FreeCap(Loc1) > 5 greater than ten, it will send additional sets of ten
entities to the location.
DO
ORDER 10 Cases to Receiving
Description
WHILE FREECAP(Receiving) > 10
Repeats a statement or statement block continu-
ously while a condition remains true.
DO...WHILE is an exit-condition loop, meaning
that the loop will always execute at least once. See Also
Use DO...WHILE for processes that must be exe- BEGIN, END, DO...UNTIL, and WHILE...DO.
cuted one time and possibly more.

Please note

Use caution when using a DO...WHILE with a


system function (e.g., FREECAP()) to ensure that
the system does not enter an infinite loop. For
example, eliminating the “WAIT 5 sec” in the
syntax sample will cause the system to enter an
infinite loop because there is no time delay within
the loop.

Valid In
Any logic.
470 Chapter 14:
Down

Down Please Note


The DOWN statement does not need to be called
Downtime-Specific System Function from the processing logic at the location that is to
go down. It can be called from any logic in your
model, except Initialization and Termination
Syntax samples
logic, and still cause the location’s Called Down-
time to execute.
DOWN <dtname>, {<priority>}
See Also
“Called Downtime Editor” on page 111, and
Description “Location Priorities and Preemption” on
Makes a location, with the specified called down- page 111.
time, attempt to go down.
This statement is used in conjunction with the
Called Downtime dialog, where you have previ-
ously defined the called downtime’s name, prior-
ity, and logic.
When this statement is executed, the called
downtime will attempt to execute its logic. The
timing of the execution of the called downtime’s
logic will depend on the location’s state and the
called downtime’s priority.

Valid In
Any logic, except Initialization and Termination
logic.

Components

<dtname>
The name of the called downtime. This name is
defined in the Called Downtime dialog, found in the
Locations table.
<priority>
You may optionally define a priority. This will over-
ride the priority you defined in the Called Downtime
dialog for the specified called downtime.
ProModel 471
User Guide

DownQty() Example

General System Function Two resources, Welders, weld brackets onto steel
frames at a location, Man_Weld, in 6.5 minutes.
An automatic welding machine, Auto_Weld, can
Syntax samples perform the same task, but it takes 9.3 minutes.
However, if only one Welder is available and the
DOWNQTY(<location> or <resource>>) other Welder is down (e.g., on break), it takes one
Welder 13.0 minutes to weld the brackets to the
IF DOWNQTY(Loc1) > 3 THEN ROUTE 2 frames. Therefore, if one Welder is down, the
DISPLAY “Total Res1 Down Now:” $ DOWN- frames should route to the automatic welding
QTY(Res1) machine, Auto_Weld.

Description Process Table


Returns the number of location or resource units Entity Location Operation (min)
down at the time of the call. Use this function to Frame Buffer IF DOWNQTY(Welder)>0
make decisions based on how many resource or THEN
location units are down. For example, if too many ROUTE 1
ELSE
units are down, a foreman could preempt several ROUTE 2
units back into service. Frame Auto_Weld ...
Frame Man_Weld ...
Valid In
Any logic and all fields except those fields evalu- Routing Table
ated at translation only. For a list of the fields
Blk Output Destination Rule Move Logic
evaluated only at translation, see the “Appendix
1 Frame Auto_Weld FIRST 1 MOVE FOR 1
A” on page 587.
2 Frame Man_Weld FIRST 1 MOVE FOR 1
... ... ... ... ...
Components ... ... ... ... ...

<location> See Also


The name of the location to examine. LOC() can be FREECAP, FREEUNITS(), and UNITS().
substituted for the name of a location.
<resource>
The name of the resource to examine. RES() can be
substituted for the name of a resource.
472 Chapter 14:
DTDelay()

DTDelay() Example

Downtime-Specific System Function The following statement models a situation where


a location is supposed to go down at 12:00 and
always goes back up at 1:00, even if it stays up
Syntax samples past 12:00 to finish processing an entity. If the
downtime was missed entirely (meaning that the
DTDELAY(<time unit>) downtime delay was greater than an hour), then
the downtime takes no time at all. If the down-
WAIT Att1 - DTDELAY(Min) time was not missed entirely, then it lasts one hour
DISPLAY “The downtime delay was”$DTDe- minus the delay.
lay(DAY)$“days.” IF 60 - DTDelay(min) > 0 THEN WAIT (60 - DTDe-
lay(min))

Description
Returns the difference between the time when See Also
you scheduled a non-preemptive downtime to DOWNQTY().
occur and the time it actually occurred. Use
DTDelay to determine if downtimes are being
postponed because of incompleted work. You
can use DTDelay in downtime logic to ensure
that a location comes back up at a specific time.
Also returns the difference between the time
when a downtime is preempted and the time it
resumes.

Valid In
Any downtime logic including off-shift and break
logic. This function returns a real number.

Components

<time unit>
The function will return the downtime delay in any of
the following units: SEC, MIN, HR, DAY, and WK.
ProModel 473
User Guide

DTLeft() Example

Shift & Break System Function Suppose a technician is frequently working on a


job when the end of the shift rolls around and that
the priority for ending the shift is not high enough
Syntax samples to interrupt the job. To ensure that the technician
gets a minimum of 14 hours off before coming
DTLEFT <time units> back to work, even though the shift file specified
16 hours between shifts, you could enter the fol-
Shift_Time = DTLeft() lowing off-shift logic:
IF DTLEFT(hr) < 14 THEN
BEGIN
Description
WAIT 14 hr
The DTLEFT function returns the balance of the
SKIP
off-shift or break time remaining for a location or
resource before it resumes normal activities. END
Unless passed as an argument (e.g., DTLeft(hr)),
the return value uses the time units defined in the
General Information Dialog (see “General Infor-
mation” on page 179). Please note

Valid In In the above example, the SKIP statement is


important to skip over the defined time in the shift
This function can only be referenced in off-shift
file.
and break logic (either the pre-start or main
logic).

Components See Also


DTDELAY()
<time units>
The time units, if different from the default found in
the General Information dialog, in which you want the
return value expressed.
474 Chapter 14:
DynPlot()

DynPlot() Example

General Action Statement You are giving a presentation to management.


Two hours into the simulation, you want a chart to
be displayed showing the value of a WIP variable
Syntax samples plotted against average part cost. Four hours into
the simulation, you want this chart to disappear.
DYNPLOT “<chart name>” To do this, define a Chart view from the Dynamic
DYNPLOT “my dynamic plot name” Plots dialog, naming your Chart view “WIP vs
DYNPLOT “Chart 1” Cost.” Define a subroutine and call it in the initial-
DYNPLOT “” ization logic using the ACTIVE statement. Enter the
following logic in the subroutine:
WAIT 2 HR
DYNPLOT “Wip vs Cost”
Description
Wait 2 HR
The DynPlot statement is used to automatically
turn on predefined Dynamic Plot windows. Its DYNPLOT ""
usage is similar to that of the View statement.
Dynamic Plot windows are predefined during
simulation mode. These predefined Chart views
can then be called from any logic statement, Please note
invoking the display of the designated chart dur-
ing simulation. Using the statement with a null value (no name
defined between the quotation marks) will close
Valid In all currently open Dynamic Plot windows.
Any Logic.

Components

<Chart name>
The name of the Dynamic Plot chart as defined in the
Dynamic Plots dialog. Enclose the name in quotation
marks.
ProModel 475
User Guide

End Example

General Control Statement Compare the following examples:


The example below includes a BEGIN and END
Syntax samples statement in the form of the “{” and “}” symbols.
In this logic, if the attribute Attr1 equals one, ten
Cases are ordered and the variable, Var1, incre-
END or } ments. ProModel executes the statements within
the BEGIN and END only if Attr1 equals one.
WHILE FREECAP(Loc1) > 5 DO IF Attr1 = 1 THEN

BEGIN {

INC Var2, 5 ORDER 10 Case

WAIT 5 sec INC Var1

END }
Just as in the logic above, if Attr1 in the following
example equals one, ten Cases are ordered.
However, Var1 increments no matter what the
Description value of Attr1. Without a statement block, the
Defines a statement block along with a corre- IF...THEN applies only to the very next statement,
no matter how you format the logic.
sponding BEGIN statement. BEGIN and END
are almost always used in conjunction with other IF Attr1 = 1 THEN
control statements such as IF...THEN and ORDER 10 Case
DO...WHILE. Every END must pair with a
INC Var1
BEGIN.

Valid In
Any logic. See Also
BEGIN, IF...THEN, DO...WHILE,
WHILE...DO, DO...UNTIL, and END.
476 Chapter 14:
Ent()

Ent() Example

Type Conversion Function The logic below orders three batches of five
different entity types to a location, Receiving.

Syntax samples Var1 = 1


WHILE Var1 <= 3 DO
ENT(<entity name-index number>) BEGIN
SEND 10 ENT(Var1) TO Loc1 ORDER 5 ENT(Var1) TO Receiving
DISPLAY “Ent A has been combined with” $ INC Var1
ENT(Var1)
END

Description
See Also
Converts a name-index number or integer to an
entity name. Use this function when a statement LOC(), RES(), ENTITY(), and LOCATION().
or function needs the name of an entity whose
name index number is stored in an attribute, vari-
able, or some other expression. ENT() can also be
used to vary the entity that a statement references
by using an expression for the name-index num-
ber. When used in an expression expecting a
string, such as in the second syntax example
above, ProModel will convert the name-index
number to the actual name of the entity.

Valid In
Any logic where an entity name is normally used.

Components

<entity name-index number>


The name-index number of the entity desired. This
component may be an expression which allows the ref-
erenced entity to change as the simulation progresses.
Real numbers will be treated as integers.
ProModel 477
User Guide

Entity() Components

Entity-Specific System Function <expression>


The number of the entity in a group to inspect. For
Syntax samples example, ENTITY(3) returns the name-index number
of the third entity in the group. If this option is omitted,
the name-index number of the calling entity is
ENTITY({<expression>}) returned.
ENTITY()
ENTITY(Var1)
Example

All cars from the motor pool must be washed


Description after use. All cars except vans require ten minutes
to wash, and vans require an additional ten min-
Returns the name-index number of the current
utes. The logic below models this situation.
entity or a particular entity in an entity group.
This function is especially useful in macros and
subroutines that vary depending on which entity
calls them. Use ENTITY() to determine what Process Table
type of entity is processing when an entity type of
ALL is specified at a location. For example, if a Entity Location Operation (min)
common area handles several different parts with ALL Wash1 WAIT 10 min
essentially the same process, use an IF...THEN IF ENTITY() = Van THEN
WAIT 10 min
statement in conjunction with an ENTITY() to
have individual statement blocks handle the
Routing Table
details of the operation. This function returns an
integer. Blk Output Destination Rule Move Logic
1 ALL Parking FIRST 1 MOVE FOR 30
Valid In
Speed fields, traveling time fields, conveyor See Also
speed fields, Resource fields, operation logic, ENT() and LOCATION().
routing fields, arrival logic, debug user-condition
field.
478 Chapter 14:
Entries()

Entries() Process Table


Entity Location Operation (min)
General System Function Order Stores IF ENTRIES(Loc1) = 50
THEN
Batch_Time = 0
Syntax samples
Routing Table
ENTRIES(<location>)
Blk Output Destination Rule Move Logic
DISPLAY “LocA has had” $ ENTRIES(LocA) $
1 Order Shipping FIRST 1 MOVE FOR 30
“entries.”

See Also
IF...THEN...ELSE.
Description
Returns the total entries to a location. This func-
tion returns an integer.

Valid In
Any logic and any field except those evaluated
only at translation. For a list of fields evaluated at
translation see the “Appendix A” on page 587.

Components

<location>
The location to examine.

Example

A location, Stores, sends entities, Orders, to a


location, Shipping. A variable, Batch_Time, tracks
the amount of time it takes to process 50 Orders.
After Loc1 processes 50 entities, we want to reset
Batch_Time to zero.
ProModel 479
User Guide

Exp()
Math Function

Syntax samples

EXP(<expression>)
Real1 = EXP(Real2)

Description
Returns the exponential of an expression. This
function is equivalent to ex.

Valid In
Any expression. This function returns a real num-
ber.

Components

<expression>
EXP() returns the exponential of this expression.

See Also
LN().
480 Chapter 14:
ForLocation()

ForLocation() See Also


FORRESOURCE(). Also see “Shift & Break
Shift & Break System Function Logic” on page 305.

Syntax samples

FORLOCATION()

IF FORLOCATION() THEN Priority 100

IF FORLOCATION() THEN
INC Arr1 [1, 2]
ELSE
INC Arr1 [2, 2]

Description
This function returns TRUE if the object execut-
ing the shift or break logic is a location.

Valid In
Shift or break logic.

Example

We assign three resources (Oper1, Oper2, and


Oper3) and two locations (Mill1 and Mill2) to a
shift. When the locations go off-shift, the example
uses a resource called Maint for 10 minutes to
clean up around the machines. Because we
assigned the same shift to locations and
resources, we need to check if the object exe-
cuting the off-shift logic is a location. We place
the following logic in the off-shift logic:
IF FORLOCATION() THEN USE Maint FOR 10 min
ProModel 481
User Guide

Format() <digits after decimal>


An expression that evaluates to the maximum number
of digits to the right of the decimal. If there are more
String Function
digits to the right of the decimal than this number, the
excess digits will be truncated. If there are fewer digits,
Syntax samples ProModel will pad the number with zeros.

FORMAT(<expression>, <total number of


characters in expression> {,<digits after deci- Example
mal>})
DISPLAY “The value of Var1 is” $ FOR- The logic below writes formatted output to a file
MAT(Var1, 5) with XWRITE and FORMAT.
XWRITE File1, “The variable Var1 is” $ FOR-
MAT(Var1,5,2)
Description In this example, if the value of Var1 is 378.87654,
it would be written to the file as:
Converts a number to a string in the format speci-
fied. FORMAT() should most often be used with The variable Var1 is 378.87
the concatenation operator (“$”) and another (Two spaces)
string, as in the syntax example above. Format is
often used in conjunction with the XWRITE
statement to produce formatted output.
See Also
Valid In
WRITE and WRITELINE.
Any string expression.

Components

<expression>
This expression will be evaluated and converted to a
string. If the expression results in an integer, it will be
converted to a real.
<total number of characters in expression>
This expression formats the number so that it occupies
a total space equal to the number of digits before +
number of digits after the decimal + one character for
the decimal point. For example if you were to do the
following logic: XWRITE file1 Format (10.0 4 1)
XWRITE file1 Format (1.0 4 1), it will show up in
the file as 10.0 1.0 with a space before the 1.0.
482 Chapter 14:
ForResource()

ForResource()
Shift & Break System Function

Syntax samples

FORRESOURCE()
IF FORRESOURCE() THEN GET Res1

Description
This function returns TRUE if the object execut-
ing the shift or break logic is a resource.

Valid In
All Shift or Break logic.

Example

A shift called DAYS.SFT has five resources and


eight locations assigned to it. When the resources
go off-shift, it is desired to write the resource
name and simulation time to a file called
RES_TIME. The following logic is placed in the
off-shift logic.
IF FORRESOURCE() THEN
BEGIN
XWRITE res_time, “Shift for” $ RES(Resource()) $
“ended at” $ Clock(hr) $ “.”
END

See Also
FORLOCATION(). Also see “Shift & Break
Logic” on page 305.
ProModel 483
User Guide

Free Example

Resource-Related Operation Statement In the following example, EntA arrives at Loc1 for
a multi-step process requiring the use of
resources Res1 and Res2. The first step requires
Syntax samples the simultaneous use of Res1 and Res2 for a nor-
mally distributed amount of time. ProModel then
FREE {<quantity>} <resource>, {{quantity} frees Res1while Res2 performs the second step of
<resource>...} the process according to a Lognormal distribu-
tion.
FREE Res1, 2 Res2, 5 Res3A
FREE ALL
FREE RES(Attr1)
Process Table
Entity Location Operation (min)
EntA Loc1 JOINTLY GET Res1 AND
Description Res2
WAIT N(4.5,.2)
Frees resources which are currently “owned” by FREE Res1
the current entity. These resources must have WAIT L(3.4,.23)
been captured through a GET or JOINTLY GET FREE Res2
statement.
Routing Table
Valid In
Blk Output Destination Rule Move Logic
Location processing logic and downtime logic. 1 EntA Loc2 FIRST 1 MOVE FOR 5

Components See Also


GET and JOINTLY GET.
<quantity>
The number of the following resource to free. A value
of zero is ignored and values less than zero result in an
error. This quantity may be any numeric expression
and is evaluated and truncated to an integer every time
the FREE statement is encountered.
<resource>
The name of the resource to free. The ALL keyword
may be used here to free all resources owned by an
entity. Any resource which is not owned by the entity
will be ignored.
484 Chapter 14:
FreeCap()

FreeCap() Example

General System Function Suppose the entities, Plates and Cams, travel
through an assembly line. The location, Assembly
(capacity=1) joins Cams with the Plates. When a
Syntax samples Cam finishes processing at Station2, it should not
enter Station3 unless a Plate is waiting to join with
FREECAP(<location>) it further down the assembly line at Assembly. If
there is no Plate at Assembly, another location,
SEND FREECAP(Loc1) EntA TO Loc1 Buffer, sends one. The logic for Cam at Station2 is
as follows:
IF FREECAP(Assembly) = 1 THEN
Description SEND 1 Plate TO Assembly
Returns the available capacity of a location. This
function returns an integer.

Valid In See Also


CAP().
Any logic and any field except those fields evalu-
ated only at translation time. For a list of fields
evaluated only at translation time, see the
“Appendix A” on page 587.

Components

<location>
The name of the location to examine. The LOC() func-
tion may also be used here.
ProModel 485
User Guide

FreeUnits() Process Table


Entity Location Operation (min)
General System Function Problem Rework INT T_Size = FREUNITS(Spe-
cialist)
IF T_Size = 0 THEN T_Size = 1
Syntax samples USE T_Size Specialist FOR
Team_Time(T_Size) Hr
FREEUNITS(<location> or <resource>)
Routing Table
USE (FREEUNITS(Res1)) Res1 FOR 5 min
Blk Output Destination Rule Move Logic

Description See Also


Returns the free units of a location or resource.
UNITS(), RES(), and LOC().
Valid In
Any logic and any field except those fields evalu-
ated only at translation time. For a list of fields
evaluated only at translation time, see the
“Appendix A” on page 587.

Components

<location>
The name of the location to examine.
<resource>
The name of the resource to examine.

Example

This example uses FREEUNITS() to assign a team of


Specialists to rework a problem. The size of the
team, stored in the local variable T_Size, is deter-
mined by all the free Specialist units. Team_Time
is a table function that varies the amount of time
it takes to solve a problem (the amount of time in
the USE statement) based on the number of units
on the team.
486 Chapter 14:
Get

Get continue where it left off when the resource


becomes available.
Resource-Related Operation/Move Every GET must have a corresponding FREE or
Logic Statement an error occurs when the entity exits the system.
If an entity owns one or more resources and is
Syntax samples subsequently loaded onto or grouped with
another entity, it cannot free the resource(s) until
it is unloaded or ungrouped.
GET {<quantity>} <resource> {,<priority>}
{AND or OR {quantity} <resource> {,<pri-
ority>}...} Valid In

GET Res1 Location processing, downtime, move, and shift


logic. A GET statement cannot follow a move
GET 3 Res1, 5
related statement in move logic.
GET 2 Res1OR 3 Res2
GET Res1, 3 AND (Res2 OR Res3) Components
GET Res(Skill_required)
<quantity>
The number of resources to get. A value of zero is
ignored and values less than zero return an error. This
Description numeric expression is evaluated and truncated every
Captures a specified number of resources as they time the GET statement is encountered.
become available. If the entity already possesses <resource>
one of the requested resources, the entity will still
The name of the resource to GET. You can substitute
try to capture an additional unit of that resource. RES() for the resource name.
When capturing multiple resources, each
resource will be captured as soon as it becomes <priority>
available until all resources are captured. When multiple entities are waiting for the same
resource to become available, the entity with the high-
A resource captured with the GET statement at est priority will capture the resource first. This expres-
one location and then released with a FREE state- sion should be a number between 0 and 999.
ment at another location will not be used to move
the entity between locations unless it is also spec-
ified in a MOVE WITH statement in the routing
Example
move logic. Otherwise, it is the entity that is
moving the resource from one location to the next
To start a semi-automatic welding process, we
and the resource will not be visible when moving
need a static resource named “Operator.” Mid-
with the entity.
way through the process, the Operator tests the
Resources captured by a GET statement can only weld with a resource named “Tester,” shared with
be preempted when the entity owning the other operators. After the test, the operator
resource is undergoing a WAIT or USE time restarts the welder. The Operator stays with the
welder until he or she completes the last part of
except in move logic. If the resource is pre-
the operation. After the welding process the
empted during one of those times, the time will

You might also like