Post on 01-Jul-2018
transcript
© 2009 Winton 1
Using ExtendSimUsing ExtendSim
© 2009 Winton 2
ExtendSim EnvironmentExtendSim EnvironmentE dSi i l i l i i h• ExtendSim is a complete simulation environment that runs under Windows– Supports both continuous and discrete simulationSupports both continuous and discrete simulation– Employs a multi-window graphical user interface for assembling
model structure• The primary technique for laying in a model is "drag and drop"• The primary technique for laying in a model is drag and drop
using blocks from supplied libraries• Block elements include a dialogue, iconics, and procedural
routines – Double-clicking on a block opens its dialogue window – The procedural routines are written in a "C-like" language called– The procedural routines are written in a C-like language called
ModL• Library blocks, including their procedural routines are fully
ibl d b i d d difi d f i laccessible and can be copied and modified for special purposes
© 2009 Winton 3
Single Server QueueSingle Server Queue• Basic graphical layout for a single-server queueg p y g q
model "Executive" block (in the Item.lix library)configurable “Create" block (in the Item.lix library)
for bringing items into the model"Queue" block (in the Item.lix library) for receiving items in the model flow – default protocol is FIFOitems in the model flow – default protocol is FIFO
Configurable "Activity" block (in the
"Exit" block (in the Item.lix library)for removing items from the model
“Random Number" block (in the Value lix library) for sampling from
Configurable "Activity" block (in the Item.lix library) for modeling activities such as a server action
Value.lix library) for sampling from probability distributions (use in this manner is optional)
© 2009 Winton 4
Setup for Building a ModelSetup for Building a ModelCli ki Fil N M d l i th E t dSi i t f• Clicking File … New Model in the ExtendSim interface opens a new model window
• Blocks for a model are obtained from library files• Blocks for a model are obtained from library files– The most commonly used libraries of blocks for discrete event
simulation are named Item.lix and Value.lix
• Clicking Library … Open Library is used to access the library files– Once a library is open, it will appear in a list under the Library
tab, from which a library access window can be opened for drag & drop of library blocks to the modelp y
• ExtendSim can be configured to automatically open libraries (and access windows) on launch via Edit … Options … Libraries
© 2009 Winton 5
ExtendSim Elements
• Items are simply the basic discrete event units that are passed between blocksare passed between blocks
• Values are actual data generated or used in the model as it operatesmodel as it operates
• Block connectionsC t f it t t t it i t– Connect from item output to item input
• E.g., the item output of a Generator Block to the item input of a Queue Block
– Connect from value output to value input • E.g., connect the value output from a Random Number block
to the delay value input of an Activity blockto the delay value input of an Activity block
© 2009 Winton 6
C i l kConnecting Blocks• There are two basic types of connectors for blocks in ExtendSim:
– item input and output connectors
“Activity” block (It li )(Item.lix)
– value input and output connectors
• A connector with a small triangle is a multiple connector– click & drag on the triangle produces the additional connections
• There are other, less commonly used types of connectors
© 2009 Winton 7
Making Connections
• On the model this is done using the “drawing pen”pen – Appears when the block/text layer tool is placed over a
connector– Use standard “click and drag” from one connector to
another of opposite type causes a tentative connection line which darkens when a connection match is madeline which darkens when a connection match is made
– Releasing the mouse button causes the connection line to affix between the two points.
• Different types of connection lines can be configured by use of the Model … Connection Li t bLines tab
© 2009 Winton 8
Running an ExtendSim ModelRunning an ExtendSim Model
Th i l i i d b• The simulation is started by – clicking the run icon on the task bar or– by executing "run" from the run tabby executing run from the run tab
• a simulation, even in its initial set up will almost always run, but until configuration details and output display are in place it
ill d hi i l l i f lwill not do anything particularly meaningful• The "Show 2D Animation" section under the run tab provides means
for configuring the simulation graphics to show simulation progress as g g g p p gthe simulation executes– Useful in initial stages of simulation construction
2D Si l ti ff t b t l d / ff f th t k b– 2D Simulation effects can be toggled on/off from the task bar
© 2009 Winton 9
Block Dialogue
• To bring up a block's dialogue, just d bl li k idouble-click on it– The dialogue is where any permitted
fi i l (iconfiguration values are set (in some cases, configuration values can be adjusted "on the fly" by use of prescribed "block inputs")fly by use of prescribed block inputs )
© 2009 Winton 10
About the Blocks in the Basic Single Server Queue Model
© 2009 Winton 11
Executive Block
• The Executive block (Item.lix) is required for discrete event models in ExtendSim
• It must be placed to the left of all otherIt must be placed to the left of all other blocks in the model
b fi d f i i h• It can be configured for a stop criteria other than simulation run length
© 2009 Winton 12
C l kCreate Block• The Create block (Item.lix) is used to bring items into the model• A Create block is configured via its dialogue window (obtained g g (
by double-clicking the block) ― The distribution governing
item generation (including empirical) is selected just by clicking on the distribution ginput box
― Any parameters required by the distribution can then be setthe distribution can then be set
― Note that for animation, the animation figure can be any one of a number of differentone of a number of different representations
© 2009 Winton 13
Queue Block
• The Queue block (Item lix) is used as a bin for holdingThe Queue block (Item.lix) is used as a bin for holding items (temporarily) blocked from proceeding– For example, items waiting for a server
• The queuing protocol to be used for releasing items is specified in the Queue block’s dialogue– Default is first in, first out (FIFO)– Others include last in, first out (LIFO – the protocol used by a
stack) priority and by attributestack), priority, and by attribute
© 2009 Winton 14
Activity Block
• The Activity Block is used to delay one or more items from progressing in the model– Typically, a server is represented by an activity delay
Th i b f i ll d i h bl k ( i h– The maximum number of items allowed in the block (set in the block’s dialogue window) corresponds to the number of servers the block represents
– The delay amount for each item can be input through the D connector
Th bl k ll i t f d li biliti ( i it• The block allows a variety of modeling capabilities (via its dialogue), including dynamically changing the maximum number of items and item pre-emption (exiting an itemnumber of items and item pre emption (exiting an item before completing its prescribed delay)
© 2009 Winton 15
d b l kRandom Number Block
• As for the Create Bl k d bl li kBlock, double-click on a “Random Number” block (Value.lix) to b oc (Value.lix) obring up its dialog and set the distribution (including empirical) to(including empirical) to be sampled from
© 2009 Winton 16
Exit Block
• Items are exited from the model usingItems are exited from the model using an Exit block
The total number exited is displayed and– The total number exited is displayed and output by the block
• The block can be configured to have more than one exit– Useful for counting items of differing
characteristics as they exit the modelcharacteristics as they exit the model
© 2009 Winton 17
Additional Model Considerations
© 2009 Winton 18
Timed Simulation ModelTimed Simulation Model• The overall simulation• The overall simulation
can be set up as a "timed" simulation via the Run
Si l i… Simulation Setup…Setup tab.
• If the setup is configured p gfor "hours" and the Create blocks (Item.lix) and Activity blocks (Item lix)Activity blocks (Item.lix) are configured for "minutes", ExtendSim will automatically takewill automatically take care of the time conversions.
© 2009 Winton 19
Simulation Time UnitsSimulation Time Units
• The Setup tab under theunder the Simulation Setup provides the meansprovides the means for changing how time conversionstime conversions are done (e.g., to have 8 hour dayshave 8 hour days, rather than 24 hour days)days)
© 2009 Winton 20
U ti d Si l tiUntimed Simulation• Setting up a simulation to
be untimed is one of the options in the dialogue ofoptions in the dialogue of the Executive block (Item.lix)( )– Permits the stop criteria to
be a value input through the count connectorcount connector
– Selecting the count connector option causes an input value connector for the count to appear on the Executive
© 2009 Winton 21
G i S Si lGenerating a Stop Signal
• A Pulse (Item.lix)block can be sedblock can be used to send a signal to the Executive Block to stop a psimulation
© 2009 Winton 22
The ExtendSim DisplayThe ExtendSim Display
• A display or I/O box in a block's dialogue can be "cloned" p y gonto the model display (actually residing in the "Clone" layer) by using the clone tool to drag a copy from the dialogue onto the model displaydialogue onto the model display.
• There are actually three "layers" on the display, each with its own tool:– Block/Text layer– Draw layer
Clone layer– Clone layer• There is also an "all layers" tool for positioning items for
best line-up across layers p y
© 2009 Winton 23
Cloned Item Behavior
• Once a dialogue box is cloned onto the display, the “all layers” tool can be used to resize and position it appropriatelyp pp p y
• As the simulation executes, the values in the cloned displa bo change d namicallcloned display box change dynamically– Same is true if the dialogue is left open
© 2009 Winton 24
Built-in Controls
• Under the Model … Controls tab there are 3 controls:are 3 controls:– Slider
• a graphical display for producing a value in aa graphical display for producing a value in a (min, max) range
– Switch • a graphical display for producing a 0 or 1 value
(true or false)– MeterMeter
• a graphical display for exhibiting a value
• Useful for public display purposesp p y p p
© 2009 Winton 25
Some Useful Data Value BlocksSome Useful Data Value Blocks• The “Constant” block (Value.lix) outputs a
set value that can be used in computations or for input parameters
• The “Simulation Variable” block (Value.lix) outputs the value of the system variable selected in its dialogue (e gvariable selected in its dialogue (e.g., current simulation time)
• The “Display Value” block (Value lix)The Display Value block (Value.lix) displays the value of an input value– Warning: if this block is attached to a Random
Number block also being used by some other block, it will pull its own random value rather than displaying the one provided to the otherthan displaying the one provided to the other block
© 2009 Winton 26
Mean & Variance Block
• The “Mean & Variance” block (Value.lix) is used to produce running statisticalused to produce running statistical information on values input to the block
Th i l d t th t t l b l d M– The mean is placed at the output labeled M– The variance is placed at the output labeled V
A t t t ith ll t i l i lti l• An output connector with a small triangle is a multiple output; click & drag on the triangle produces the additional outputs
© 2009 Winton 27
f i l kInformation Block
• Used to gather information about items• Can be set up to gather and output various
item statisticsitem statistics– Signal an item passing through
f b f i– Count of number of items– Interarrival time between items– Time in activity (via a specified attribute)
© 2009 Winton 28
Arithmetic Calculations
• The Math Block (Value.lix) can be used to perform a number of standard operations on the values input– Add, subract, multiply, divide,
exponentiate, logarithm– And, or, not– Trigonometric functions and a number of
others
© 2009 Winton 29
Equation Blocksqua o oc s• There is a general "Equation" block (Value.lix) for
calculating expressions of the form lt f lcalculating expressions of the form result = formula;– Can be configured via its block dialogue for as many inputs
as needed– ExtendSim's operators are:
• +, -, *, /• ^ (exponentiation), MOD or % (modulus)• AND or &&, OR or ||, NOT or !• == (equals) != or <> (not equal)• == (equals), != or <> (not equal)• <, <=, >, >=
• There’s also an “Equation(I)” block (Item.lix) for useThere s also an Equation(I) block (Item.lix) for use with discrete event objects– Can access use item attributes as well as input values
© 2009 Winton 30
Simulation Reporting (1)p g ( )• ExtendSim provides a crude report
d h bgenerator under the Run tab– Report information is generated block by
bl k f h bl k h h l dblock for those blocks the user has selected • to select multiple blocks at once, click on them
while holding the shift keywhile holding the shift key • under the Run tab click on "Add Selected to
Report "
– Reporting only gives final values– There is a (voluminous) model tracing
capability under Run .. Debugging if intermediate values are of interest