Flexsim Tutorial
Flexsim Tutorial
Bill KP Chan
HW 1-6
Email: [email protected]
Libraries
Model Views
Model
Objects
Flowitems
4
Flexsim Model
A Flexsim model is a system of queues,
processes, and transportation.
Queues develop naturally in a model when
upstream arrival rates exceed the
downstream processing rates.
Processing is simply a forced time delay on
the object being processed.
Transportation is the physical movement of
an entity from one resource to another.
Object Classification
FixedResources objects which send
and/or receive flowitems
ex.
Object Classification
Flowitems - The entities that are
passed from one fixed resource to
another within a model.
Flowitems are actually Flexsim Objects.
Flowitems hold information that can be
set and queried in the model.
This information can do anything from
defining process times to making routing
decisions, and anything in between.
7
Model Behavior
Most modeling behaviour is defined on
the fixed resources in a model:
how long to process the flowitem
where to send the flowitem next
call a shared resource (operator) for
processing the flowitem
call a mobile resource to transport the
flowitem to the next fixed resource
8
Output
Center
10
Concept of Triggers
When key events occur on an object, a
trigger is fired.
The user may specify a variety of things to
happen when a trigger fires (trigger logic).
There are triggers when a flowitem enters
or exits an object. There are triggers when
a process time finishes or a repair time is
complete.
Each type of object has a unique set of
triggers.
11
Triggers
An opportunity to define
and customize system
behaviour at a specific
event occurrence.
Write/read information
to/from a flowitem.
Change visual properties
of flowitems or objects.
Send Messages to other
objects.
Change behavior of other
objects.
And much more
12
Library
Library - a list of class objects to
be used in building a model.
Instance a copy of one of the
library objects - created in the
model when an object is dragged
from the library icon grid into a
model view window.
14
Model Views
A view is a window into the model. You can have several
views open at the same time. Each view is a different
perspective on the same model.
> Orthographic
Perspective >
Additional Views:
Planar
Tree
15
16
Mouse Operations
View Window Navigation:
Translate: left click-drag
Tilt and Rotate: right click-drag
Zoom: left&right click-drag (or scroll wheel)
Object:
Translate in X and Y: left click-drag on object
Translate in Z: right&left click-drag on object
Model 1
Purpose
Introduction to the 5 basic steps of model building
using a single queue, single server system (post
office).
Description
people arrive at a post office every 60 seconds, on
average. The statistical probability distribution
which best simulates the inter-arrival pattern is an
exponential distribution with a location value of 0
and a scale value of 60.
the service time at the one and only service window
in the post office is lognormal(31, 3.1, 0.5) seconds.
if the queue for the service window exceeds 20
people, new arrivals are routed out of the model as
unhappy customers.
18
Model 1 Layout
19
20
Flowitem Flow
Flowitems are passed from one object to the
next in zero time regardless of where in the
model layout the objects are located.
To create time delay in the flowitem flow, add
conveyors or task executers for transport.
Convey time depends on the conveyors length and
speed.
Transport time between objects depends on the
distance between the objects, plus the task
executers speed, acceleration, & deceleration.
21
2. Once you have chosen your time and distance units, make
the mental connection that EVERY measurement in your
model must be set in your chosen units.
22
Port Connections
Objects can have an unlimited number of
ports.
A port connection is needed for each
possible routing choice in the model.
The actual port that a flowitem passes
through depends on the selected rule for
the object that is either doing the pushing
or the pulling.
(see Flow tab, Send To Port field).
23
24
Disconnect
Connect
View
Center to Center
26
Parameters Window
Double click (or right click then choose Parameters)
Used to edit object specific behaviour
27
Properties Window
Every object has the
same set of properties
tabs
Visual Tab
Look and size
General Tab
Port connections
Display switches
Statistics
Throughput, states, queuing,
and stay times
Graphs, charts, readings
28
29
Parameters Window
Each object class has its
own Parameters Window
Parameters affect the time
that flowitems stay in an
object and how they are
routed from object to object.
Apply will accept changes
OK will accept changes and
close the window
Cancel will close the window
without accepting changes
Properties button opens the
Properties Window
30
Parameter tabs
Parameters are grouped into tab pages by category
Every fixed resource object will have a Flow tab
and a Triggers tab
31
32
Code Template
Blue text in the Code
Template may be
replaced with any valid
number, string or
expression.
These templates can be
customized through the
Code Edit window.
(to be taught later)
34
35
36
Summary Report
Display a tabular
report for all objects
in model (or just
those that are redselected).
Choose from a list
of standard system
variables to include
in report.
Add user-selected
attributes to the
report.
38
39
41
Full Report
42
43
Model 1 Follow Up
Questions
Whats the maximum and average time
people wait in line?
How many unhappy customers?
Whats the utilization of the service window?
How many customers were serviced?
44
Model 2
Purpose
learn how to duplicate objects
see affects of adding a second service window
introduction to the Send to port field (Flow tab)
Description
add another service window to the post office
Questions
answer the questions asked in Model 1 - Preview
if the windows differ by the type of service they can
provide and 40% of the people need to use window
1 and 60% need to use window 2, how does the
queue time increase?
45
46
Model 3
Sink
Queue
Conveyor
Flow Node
Processor
- Multiprocessor
- Seperator
- Combiner
- Rack
- Operator
- Transporter
- Task Executer Teams
- Network Node
- Recorder
- Visual Tool
47
Dispatcher
Navigator
Task Executer
Network Node
Network Navigator
Visual Tool
Recorder
Operator
Queue
Transporter
Sink
Traffic Control
Crane
Rack
ASRS Vehicle
Robot
Reservoir
Elevator
MultiProcessor
Conveyor
Processor
MergeSort
Combiner
Separator
48
FixedResource Superclass
FixedResource objects are the backbone of a simulation
model. Theyre used to define the product flow.
FixedResources can:
TaskExecuter Superclass
TaskExecuters execute tasksequences.
A tasksequence is a list of tasks which are to be completed in the
order listed.
A task is an activity such as loading, unloading, traveling, delaying,
or simply being utilized.
When a TaskExecuter receives a tasksequence, it will start
executing the tasks one after another until the tasksequence is
either finished or preempted by a preempting tasksequence of
higher priority.
Tasksequences are created and dispatched automatically when the
Use Transport or Use Operator boxes are checked on a
FixedResource.
Custom tasksequences can also be created and dispatched using
commands (taught later).
51
Dispatcher Superclass
The Dispatcher receives tasksequences and either queues them up,
or dispatches the tasksequences immediately to other Dispatchers
and/or TaskExecuters connected to its output ports.
A tasksequence may preempt the current tasksequence part way
through the current list of tasks. The preemption can either
temporarily interrupt the current tasksequence or permanently
destroy the current tasksequence as well as any other
tasksequences waiting in the preempted TaskExecuters
tasksequence queue.
Tasksequences can be sorted by their priority.
Because a TaskExecuter is a subclass of the Dispatcher, it too can
act as a Dispatcher and be connected through its output ports to
other TaskExecuters.
52
Model 3
Purpose
Build a model which uses several objects in the Flexsim library
Description:
A part enters a Separator every 20s where it is split into 3 separate parts.
Each part moves down one of three separate lines:
1. The first part moves via an s-shaped conveyor to a Combiner where a total
of 8 parts are packed on a pallet (supplied by another Source). The loaded
pallet is then conveyed to a Sink.
2. The second part is conveyed to a Queue where it is then carried by an
Operator to a MultiProcessor object where 3 separate processing steps are
performed. The first step can complete on its own in 3 seconds. The second
step requires an operator (same operator that delivered the part) and takes
4 seconds, and the third step can complete on its own in 5 seconds. A
Transporter then picks up the part and takes it to a Rack where it is stored.
3. The third part travels via FlowNodes to a Queue where 10 are accumulated
before being released, one at a time, to a Processor with a 20 second cycle
time. They are then placed in a Queue where a Robot transfers one part at a
time over to a Sink.
53
Phase 4: Reporting
Add a 3D pie chart to show the status of the Operator
Add 3D text to show the content of the Rack
54
Phase 1 Description
Phase 1:
Obtain flow with FixedResource Class objects only (neglect
TaskExecuters).
55
Source
The Source is used to
introduce flowitems into
the model.
The arrival rate of
flowitems will be based
on an Inter-Arrival Time,
Arrival Schedule or
Sequence.
Most models will start
with a Source.
56
Sink
The sink is used as an exit point for flowitems.
FlowItems can only exit the model via the Sink.
Your last chance to record information about the
flowitems is in the OnEntry trigger of the Sink.
57
Queue
The Queue is used to
stage FlowItems for
downstream operations.
Queues are used in the
model wherever work-inprocess (WIP) exists
between process steps.
A Queue may be a table,
basket, line, or waiting
room.
58
Conveyor
Used to convey flowitems from one location in the model
to another location.
Time to convey depends on the conveyors length
divided by its speed.
Can be accumulating or not. If not, all parts on the
conveyor stop when a part at reaches the end of the
conveyor and is blocked (like a Belt conveyor).
Conveyors can take the actual length of the flowitems
and the Conveyor sections into account when calculating
accumulation and available space.
You can define a combination of many straight and
curved sections all on one conveyor object!
59
Flow Node
The FlowNode is used in a model where it is
desirable to have flowitems move along a
designated path to another object in the
model consuming time as they move.
One use would be to move people (flowitems)
down an open corridor or in a building.
Similar to a Conveyor and is connected to
other FlowNodes and FixedResources.
Each FlowItem can have its own speed.
Flowitems DO NOT spatially accumulate.
60
Processor
A Processor is used anytime an operation is
performed on a FlowItem.
A Processor can be any kind of machine or
station; anything that would take time to
manipulate a FlowItem.
The FlowItems must stay in the Processor for
the sum of the Setup Time and the Process
Time plus any Blocked Time. The dwell time
may also include time waiting for an operator,
time waiting for a transporter and time waiting for
the Processor to be repaired if broken down.
61
Order of Execution
(pushed flowitem)
flowitem enters
OnEntry
Pick Operator
Process Time
delay
OnProcessFinish
OnExit
delay
Setup Time
Pick Operator
OnSetupFinish
Request
Transport From
delay
Send To Port
possible
delay
62
MultiProcessor
A MultiProcessor is a good
object to use when you have
large flowitems that move to a
spot where several operations
are performed before it moves
again.
Combiner
64
Separator
The Separator is used to separate (unpack) or to split
(make copies of) flowitems.
It can unpack flowitems that were previously combined
using the Combiner.
Flowitems can be split into a specific number or call from
a table.
The contents must leave before the container can leave.
65
Rack
The Rack is used to store flowitems in a
specific column and row (bay and level).
You can toggle between three different
visual displays of the Rack by holding the
X key and clicking on the Rack.
The physical configuration is defined by
the Rack layout size table.
66
Rack Tabs
67
Complete Phase 1
68
Phase 2 Description
Phase 2:
Add TaskExecuters: Operator, Transporter and Robot.
69
Operator
70
Transporter
71
72
Center
Output
Dispatcher
TaskExecuters
Input
73
Complete Phase 2
Bonus:
Try replacing the robot with a Crane. Play with the cranes
74
parameters to get a feel for how it works.
Phase 3 Description
Phase 3:
Add a NetworkNode path to control the travel path of the
Transporter.
75
NetworkNodes
NetworkNodes are used to define the path a
TaskExecutor will follow when executing its travel tasks.
A network path is made up of a group of interconnected
NetworkNodes.
A TaskExecuter is assigned to move on the network by
connecting it to any NetworkNode in the path. The
connected node becomes the TaskExecuters home
node.
If a FixedResource is visited by a task executor
assigned to travel on the network, that FR must be
connected to at least one NetworkNode, making it
accessible via the network.
76
Connecting NetworkNodes
Click-and-drag a
connection while
pressing the A key.
When connected you
will see a black line
between the nodes.
Two green direction
indicators show that
travel is allowed in
both directions.
77
Connecting a TaskExecutor
to the Network
Click-and-drag a
connection between the
TaskExecutor and a
NetworkNode while
pressing the A key.
Non-Passing Paths
A non-passing path can
be toggled by using the
A key and click-anddragging between two
nodes that are already
connected.
The direction indicator
turns yellow, showing a
non-passing direction.
A dragging a red or
yellow direction will
toggle back to green.
No traveling
82
83
2. A
3. A
6. a
4. A
84
Paths Tab
Each path from a NetworkNode
can be edited in many ways.
Different direction modes can be
set using the Connection Type
dropdown list.
Minimum spacing between
travellers can be defined.
A maximum speed can be set
for this path connection.
A Virtual Distance can be set.
Virtual distance is a forced
distance value. Using virtual
distance, you can give a path an
artificial length.
When might a virtual distance
be useful?
85
Complete Phase 3
Bonus:
Try adding a second Transporter to the Multiprocessor.
Can you make the Transporters travel in a counter-clockwise
direction?
86
Phase 4 Description
Phase 4:
Add a 3D pie chart to show the status of the Operator
Add 3D text to show the content of the Rack
87
Recorder
The Recorder is used to display and record
statistical information.
The Recorder can display 3D charts and
graphs from object data or tables.
Enable the object to record data for Content
and Staytime graphs (Statistics tab of
Properties window).
Can gather point statistics (min, max, avg) or
complete historical data at set time intervals or
based on actual object events.
88
VisualTool
The VisualTool is one of
the most versatile Flexsim
Objects.
VisualTool can be used as
a prop to display planes,
cubes, columns, spheres,
imported objects (2D CAD
or 3D shapes), 3D text and
even presentation slides
(bmp, jpg).
The VisualTool can also
act as a container for other
objects.
89
Complete Phase 4
Bonus:
Can you change the 3D shape of the Operator?
90
Flexsim Hierarchy
<understanding the tree structure>
And
91
What is a Node?
Basic data structure of Flexsim is a hierarchal tree
main tree (model and project related objects and data)
view tree (GUI related objects and picklists)
model tree (model related objects and data)
92
Node Structure
Nodes have a name
Nodes can have a data item
number
string
object
Node Symbols
Standard Folder
Object
Object data
Function (C++)
Function (FlexScript)
94
95
What is a function?
functionname(argument1, argument2, etc)
An argument can be:
Numerical value
String (text)
Pointer (*) to an object or node
Function example:
colorrandom(item)
96
General Rules
language is case sensitive (A does not equal a)
no specific format is required (free use of spaces, tabs and line
returns is encouraged for readable code)
text strings are entered between quotes. mytext
parenthesis follow a function call and commas separate the
arguments of the function. moveobject(object1, object2);
a function or command will always end with a SEMI-COLON (;)
parenthesis can also be used freely to make associations in
your math and logic statements. Ex: ((x+3)*2)
curly braces { } are used to define a block of statements.
to comment the rest of a line use // and type note here
multi-line comments start with /* and end with */.
dont use spaces or special characters in name definitions
( _ is ok).
names may include numbers, but may not begin with a number
(machine_9 is acceptable, 9machine is not).
97
98
Variable Types
int
double
string
treenode
99
int index = 1;
double weight = 175.8;
string category = groceries;
treenode forklift = centerobject(current,1);
100
Math Operators
x+y
x-y
x*y
x/y
sqrt(x)
pow(x,y)
round(x)
frac(x)
fmod(x,y)
min(x,y)
max(x,y)
x plus y
x minus y
x times y
x divided by y
square root of x
x to the power of y (xy)
x rounded to the nearest integer
returns the decimal portion of x
returns the remainder of x/y
returns minimum of x and y
returns maximum of x and y
101
Comparing
x>y
x<y
x >= y
x <= y
x == y
x != y
comparetext(string1,string2)
x greater than y
x less than y
x greater than or equal to y
x less than or equal to y
x equal to y
x not equal to y
string1 matches string2
102
Relating
&&
||
!
logical AND
logical OR
logical NOT
103
Updating
x=y
x += y
x -= y
x *= y
x /= y
x ++
x --
set x to y
set x to x plus y
set x to x minus y
set x to x times y
set x to x divided by y
add 1 to x
subtract 1 from x
104
rank(node, ranknum)
node(relativepath, object)
rank(current,3)
node(/Operator1,model())
inobject(object, portnum)
outobject(object, portnum)
centerobject(object, portnum)
inobject(current,1)
outobject(current,1)
centerobject(current,1)
first(object)
last(object)
first(current)
last(current)
105
content( object )
getinput( object )
getoutput( object )
getstatenum( object )
zloc( object )
xsize( object )
ysize( object )
setsize( object, xnum, ynum, znum )
zsize( object )
xrot( object )
yrot( object )
setrot( object, xdeg, ydeg, zdeg )
zrot( object )
107
Itemtypes
itemtype all flowitems have an attribute
called itemtype. Its a numeric identifier used
to distinguish one type of flowitem from
another in processing and routing decisions in
a model.
108
getname( object )
setname( object, name )
getitemtype( flowitem )
setitemtype( flowitem, num)
setcolor( object, red, green, blue )
colorred( object ) blue,green,random...
How can you find the names of other color
functions?
109
example
pt(Item In ); pt(getname(current)); pt( ); pf(time()); pr();
110
Processor Parameters
Understanding the edit fields of the Processor
object will help you understand Flexsim.
You should be able to answer the following
four questions about each edit field:
111
Access Variables
Returns
Setup Time
delay time
Process Time
current, item
delay time
MTBF
current
delay time
MTTR
current
delay time
Send To Port
current, item
port number
current
port number
Pull Requirement
true/false (1/0)
numeric pointer
Pick Operator
current, item
numeric pointer
OnReset
current
N/A
OnMessage
current, msgsendingobject,
msgparam1, msgparam2, msgparam3
N/A
OnEntry
N/A
OnExit
N/A
OnSetupFinish
current, item
N/A
OnProcessFinish
current, item
N/A
OnBreakDown
current
N/A
OnRepair
current
N/A
112
Code Exercise 1
Purpose
Gain experience in writing code in the Code Edit windows.
Introduction to special comments used to define Code Template
windows.
Introduction to the bernoulli command.
bernoulli(num probability, num succeed-value, num fail-value, [num stream])
Description
Do not use code templates for these exercises (write your own
code, beginning with most basic available option)!
See next slide for model layout description.
Using the Send To Port field of the Conveyor, send 30% of the
flowitems to port 1 and 70% to port 2 (Use the bernoulli
command).
113
114
Logical if Statement
if (test expression)
{
code block
}
else
{
code block
if (content(item) == 2)
{
colorred(item);
}
else
{
colorblack(item);
}
115
Code Exercise 2
Purpose
Learn how to both set and read the itemtype of a flowitem
using code.
Introduction to the Flowitem Bin
Description
Questions
Can you change the color of the Flowitems based on their
itemtype using code? How can you find the color commands?
116
Labels
labels information can be
stored on flowitems (and
other modeling objects) in the
form of labels.
Flowitems and other Flexsim
objects can have an
unlimited number of labels.
Labels have a name and
data. The data may be
numeric, string, list, or table.
118
syntax
Object Labels
examples
switch (type)
{
case 1:
{
coloryellow(item);
break;
}
case 5:
{
colorred(item);
break;
}
default:
{
colorgreen(item);
break;
}
}
120
Code Exercise 3
Purpose
Learn how to both set and read the labels on a flowitem using
code.
Description
Uses same layout as Exercise 1.
Create a numeric label named routing on the Textured
Colored Box in the FlowItem Bin (see toolbar).
Set the routing label of flowitems as they exit the Source with
a random number between 1 and 4 (use duniform() command).
Use a switch() statement in the Send To Port field of the
Conveyor to send flowitems according to the following rules:
Label values 1 and 3 go to port 2
Label values 2 and 4 go to port 1
Questions
Can you change the color of the flowitems based on their label
value using code?
121
123
Code Exercise 4
Purpose
Learn how to write your own for loop.
Description
A Combiner packs 8 boxes on a pallet.
Use an infinite supply of pallets from one Source and an infinite
supply of boxes from another Source.
The Combiner sends to a Conveyor which then sends to another
Conveyor.
Using the OnExit trigger of the first Conveyor, write a for loop which
changes the color of all the boxes on the pallet.
Questions
Can you change the 3D shapes of the boxes on the pallet to totes
using the Change 3D Shape picklist option?
124
Exercise 4 Layout
125
Model 4 - Concepts
Itemtypes
Push vs. Pull
Distributions (continuous vs. discrete)
126
Order of Execution
(pulled flowitem)
Flowitem
becomes available Pull Requirement
upstream
OnSetupFinish
delay
Process Time
Pick Operator
Pull From
Port
OnExit
delay
if true
delay
OnEntry
Pick Operator
Setup Time
delay
Send To Port
Request
Transport From
possible
delay
127
Purpose
Model 4
Description
Electronic components need to be tested after manufacture.
There are two types of components that arrive in a queue at
random with the mix being 40% of one and 60% the other.
The inter-arrival time of components is exponential(0,30,1)
There are two testers for component 1 and three testers for
component 2. Components will go to the first available tester.
Testing times are all between 120 and 150 seconds uniformly
distributed.
128
Model 4 Layout
129
Model 5 - Concepts
Global Tables
Labels
Triggers
130
131
Model 5
Purpose
Small example of using a Global Table to define product routings.
Learn how to use a label to keep track of what step the flowitem is on.
Description
3 different products (uniformly distributed) enter a 5 station work cell.
Products are processed at the following stations in the order specified
Product 1 needs to be processed at station 1,3, and 2.
Product 2 needs to be processed at station 1, 2, and 4.
Product 3 need to be processed at station 2,4,3, and 5.
Use a global table to make sure the products are sent to the right
station in the proper sequence.
Use a single Queue whose output ports are connected to each of the 5
stations and to a Sink. Each of the five stations have their output port
also connected to the input ports of the Queue.
Use an Arrival Schedule to test the routes for each product type
separately.
Model 5 Layout
133
Model 6 - Concepts
Labels and Itemtypes
Empirical Distributions
Trigger sequence
134
Model 6
Purpose
Learn how to assign and use labels on flowitems for routing and
processing purposes. Learn how to use an empirical distribution to
assign itemtypes.
Description
Parts arrive in a queue exponentially every 30 seconds. There are
four part types (1,2,3,4) distributed (20%, 30%, 40%, 10%)
respectively (see dempirical in Flexsim Command Summary).
The parts are processed on one of four machines. Each machine is
dedicated to a single part type. The processing times at each
machine is uniform(100,120) seconds for first time parts, and
uniform(120,130) seconds for rework parts.
After the parts are machined, they are put in a queue and wait to be
tested. The test time is a constant 10 seconds. Parts that pass, leave
the model, failed parts are routed back to the first queue to be
reworked. 10% of the parts fail.
Parts being reworked are given priority in the queue.
Model 6 Layout
136
Model 7 - Concepts
TaskSequence Priority
Global Pointers
137
Model 7
Purpose
Learn how to use an Operator to both carry and process
flowitems
Description
Parts arrive at a queue every 20 seconds exponentially
distributed and need to be carried by the operator to one of 3
machines, whichever is first available.
The operator needs to setup the part which takes 10 seconds.
The part will then process for 20 seconds on its own.
When the part finishes, it will leave the system.
One operator will run all three machines.
Model 7 Layout
139
Model 8 - Concepts
Send To Port
Break To Requirement
140
Model 8
Purpose
Learn how to use the Break To Requirement field on
TaskExecuters.
Description
Model 8 Layout
142
Model 9 - Concepts
TaskExecuter Teams
TaskSequence Preemption
Time Tables
143
Model 9
Purpose
More practice working with teams, priorities and preempting
Description
Model 9 Layout
145
Model 10 - Concepts
Update Combiner Component List OnEntry
Excel Imports and Exports ~ Multi-Table
Read Automatic Excel Input Documentation
146
Custom
Excel
Import/Export
Example:
excelopen(C:\mybook.xls);
excelsetsheet(Sheet1);
double thenum = excelreadnum(1,1);
excelwritenum(5,2,thenum)
excelclose(true);
This opens a link to a workbook called mybook, and stores a value read from
row 1, column 1 from Sheet1, then writes the stored value to row 5, column 2. The
link with Excel is then closed.
See also excelimporttable() and excelexporttable()
Rules:
You must call excelopen() once per workbook. Only one workbook can be open at a
time. The user must call excelclose() before trying to open another workbook.
Before reading from the open file, excelsetsheet() must also be called to point to the
appropriate worksheet. This command may be called several times to point to
different sheets in the active workbook.
See Flexsims browser based help for more information. Press the ? button in the
lower left corner of the Automatic Excel Import to open the contextual help.
147
Model 10
Purpose
Learn how to manipulate the Components List table on a
Combiner object to do custom packing on the fly
Learn how to import and use a Source arrival schedule
Description
A small distributor has 10 product types that he ships to the
same 5 customers.
Each customer has a different order profile.
The distributor has a large supply of each of the 10 products
so all he has to do is wait for an order to come through the
door.
Products are placed on a pallet and then conveyed out.
Use the next two tables to build the model.
Model 10 Layout
149
Customer 2
Customer 3
Customer 4
Customer 5
prod 1
prod 2
prod 3
prod 4
prod 5
prod 6
prod 7
prod 8
prod 9
prod 10
0
150
ItemName
ItemType
Quantity
Customer 1
OrderA
Customer 2
3600
OrderB
Customer 3
7200
OrderC
Customer 4
10800
OrderD
Customer 5
14400
OrderE
1
151
152
Model A1 - Concepts
Closing and Opening Output/Input Ports
Message Sending
Stop and Resume commands
153
154
Order of Execution
(Messages)
sendmessage()
OnMessage
trigger of
receiving object
senddelayedmessage()
delay
OnMessage
trigger of
receiving object
155
Model A1
Purpose
Learn how to control product flow and send delayed messages.
Description
Assume an infinite supply of A and B components.
The two components must be glued together with epoxy which
takes lognormal(0,2.6,0.8) seconds.
The assembled parts must wait in a staging area for at least 15
seconds for the epoxy to cure before they can enter the paint
booth.
It takes lognormal(0,2.5,0.5) seconds to paint each part
separately.
After each part is painted and exits the paint booth, the booth
must be purged for 3 seconds before another part can enter.
Model A1 Layout
157
Model A2 Concepts
158
Model A2
Purpose
Gain experience in building an abstract model
Learn to write behavior logic in a trigger field using code
Description
Items arrive at a warehouse each day to be stored.
Orders arrive at a warehouse each day to be pulled.
The average number of items and orders received each day is 10, but both are
exponentially distributed.
There are only 5 types of items (and therefore orders) received. The type of
received items and orders is uniformly distributed 1 through 5 on a daily basis.
Whenever an order arrives it must search for a matching item and remove it.
Whenever an item arrives it must search for a matching order and remove it.
1 model time unit = 1 day.
159
Model A2 Layout
160
Model A3 - Concepts
Custom TaskSequences
Global TaskSequences
Global Variables
161
TaskExecuter Control
Simple Commands
requestoperators( taskexecuter, station, involvedobj, nrofops, priority,
preempting )
freeoperators( taskexecuter, involvedobj )
Custom Built TaskSequence
createemptytasksequence( taskexecuter, priority, preempting)
Returns a pointer (treenode) to the task sequence created
Task Types
TASKTYPE_LOAD: flowitem, pickup
TASKTYPE_FRLOAD: flowitem, pickup, [outputport]
TASKTYPE_UNLOAD: flowitem, dropoff
TASKTYPE_FRUNLOAD: flowitem, dropoff, [inputport]
TASKTYPE_UTILIZE: involved, station, [state]
TASKTYPE_STOPREQUESTFINISH: stoppedobject, NULL
TASKTYPE_TRAVEL: destination, NULL
TASKTYPE_TRAVELTOLOC: NULL, NULL,xloc,yloc,zloc, [endspeed]
TASKTYPE_TRAVELRELATIVE: NULL, NULL,xloc,yloc,zloc, [endspeed]
TASKTYPE_BREAK: NULL, NULL
TASKTYPE_DELAY: NULL, NULL, delaytime, [state]
TASKTYPE_SENDMESSAGE: receiver, NULL, [param1,param2,param3]
TASKTYPE_MOVEOBJECT: flowitem, container, [port]
TASKTYPE_DESTROYOBJECT: object, NULL
Brown parameters are required, [Gray] parameters are optional
** use profiletasksequence(ts) to print a full description of the task sequence to the Output
Console
164
Define References
Dynamic references
are assigned at runtime
Up to 5 dynamic
references
166
Define Tasks
167
Model A3
Purpose
Learn how to manually build your own tasksequences
Description
The model consists of a Source, three Processors in series,
and a Sink.
An operator must pick up a part from the source, carry it to the
first processor, be utilized for the process time, carry the part
to the next processor, etc. until finally dropping it off at the sink.
Use Global Object Pointers instead of center port connections.
168
Model A3 Layout
169
Model A4
Purpose
Learn how to create custom built task sequences
Description
The model consists of a Source, an Operator, a NetworkNode
and a Sink.
An operator must pick up a part from the source, carry it to the
sink and travel to the NetworkNode location after dropping it off
at the sink.
Create custom built task sequences at the source.
Model A4 Layout