extendsim seminar
TRANSCRIPT
ExtendSim Tutorial
Dr David Brown
April 28, 2010
Innovative Decisions, Inc.
1945 Old Gallows Road
Suite 207
Vienna, VA 22182
www.innovativedecisions.comPhone:(703) 854-1130
Agenda
• ExtendSim Overview
• Continuous and Discrete Models
• Model Optimization
• Custom Model Blocks
• Animation
• Building Animation Objects
• Integration with Bayesian Networks.
What is ExtendSim?
• GUI based simulation package• Continuous, discrete event, discrete rate, and
agent-based modeling is supported• Robust set of modeling and data analysis
components. Allows for development of custom components.
• Links to external data sources and also includes built-in databases
• Supports animation and advanced graphic for enhanced presentation
Extend Libraries
Internal Block Settings
Activity Block
Double click to open block and set internal
options
D F
Typical Applications• Manufacturing
– Assembly lines, distribution, shipping
• Facilities
– Customer flow, operational efficiency, logistics
• Industrial Operations
– Construction, mining
• Military Operations
– Troop readiness, military logistics
• Process Improvement
– Business operations
Output
• Built-in graphing and report generation
• Export data to spreadsheets or databases
0
0.00005
0.0001
0.00015
0.0002
0.00025
20000 22000 24000 26000 28000 30000 32000 34000
Weekly Net Revenue ($)
Pro
bab
ilit
y
Baseline
Rule-based
Bayesian Network
Hierarchical Blocks
1 2 3
Rand
Assembly Station
Bins
InBins
Out
Sta#
Assembly Station
Bins
InBins
Out
Sta#Assembly Start
Bins
In
Bins
Out
Type
Bin In
1
Station #
Assembly Station
Bins
InBins
Out
Sta#
3
Station #Assembly Station
Bins
InBins
Out
Sta#
Assembly Station
Bins
InBins
Out
Sta#
Assembly Station
Bins
InBins
Out
Sta#
Assembly Station
Bins
InBins
Out
Sta#
6
Station #
Assembly Station
Bins
InBins
Out
Sta#
8
Station #
BinsInBinsIn
Assembly Station
Bins
InBins
Out
Sta#
Assembly Station
Bins
InBins
Out
Sta#
2
Station #
4
Station #
7
Station #
9
Station #
10
Station #
5
Station #
BinsOutBinsOut
D
T U
Bin Load Delay
select
b?
a
A
Get
BinTy pe a
b
L W
FD
Conv ey or Queue
BinsInBinsIn
BinsOutBinsOut
TCR
Receiv e
Load Delay Mean
1 2 3
Rand
Delay Time
StationInStationIn
3
Constant
TCR
Receiv e
Load Delay Dev
Eqn
1
Constant
N
B
A
Y a>b
TCR
Receiv e
# Stations
Activity-Based Costing
Types of Models
• Continuous Models
– Values are always present
– Examples: Temperature in a room, Accounts, Fuel in your car
• Discrete Models
– Things happen at specific times
– Examples: People enter a building, Cars in a parking lot, Files in an inbox
• Many models contain elements of each
– Example: Deposit to a savings account
Inputs and OutputsContinuous
BlockDiscrete
Block
ContinuousInput
ContinuousInput
ContinuousOutput
ContinuousOutput
DiscreteOutput
DiscreteInput
Outputs must beconnected to Inputs
y =f (x)
D F
Drag DownTabs
D
C
F
U
L
P
NB
SD
SH
PT
BT
DT
AS
Continuous Models
If only the value blocks are used, there are no special requirements
getHare Population
###1.25
Hare Birth Rate
Hare Births
Hare Pop
###100
Ecosy stem Area
Hares Killed
Lynx Pop
Lynx Pop
Hare Density
Hare Pop
Lynx Pop
getwant
Ly nx Population
###0.25
Ly nx Birth Rate
Ly nx Births
Value
Ly nx Mortality
Ly nx DeathsLynx Pop
Buttons
Discrete Models
ExecutiveBlock
An executive block must be used if any discrete blocks are used in a model.The executive block must be to the left of all other blocks.
demand
ADGate 1
startStart
Start
demand
ADGate 2
0
L
Stage 2
demand
ADGate 3
0
D F
Stage 3
L1
Indicator 1
1
L
Stage 1
L2
L4L1 L2
L4
L3
L3
conmax
Stage
A=0
A
B
Y
N
A=0
A
B
Y
N
A=2
A
B
Y
N
Indicator 1
C CO
Source
100
R Q
Valv e 1
Stage
800
C CO
I
Reception
T= 60
Indicator 2
Indicator 1
y =f (x)
%
ID
0
L
Stage 4
Indicator 2
Stage y =f (x)
0
R Q
Valv e 2
Stage
Stage 1: Open Valve 1 and release flow into Reception
Stage 2: Open Valve 2 and release flow into Processing
Stage 3: Process the flow
Stage 4: Open Valve 3 and release flow into Sink
0
C CO
I
Processing
4000
C CO
Recy cle
0
R Q
Valv e 3
y =f (x)
12000
C CO
Sink
Example Problem
• Work station for evaluation of incoming paperwork
– 1000 forms as input
• 100 per hour enter system
– Start with 3 workers
– One worker can review one form at a time
– Variable time to complete review
• Mean 3
• Std Dev 1
Work Flow FunctionsIncoming
Files
Workers
File
Review
Completed
Files
1000
100 per
hour
3
Mean 3
Std Dev 1
mins
1 file
1 worker
1 file
1 worker
Inbox
Work Flow Model
0
TR U
24
R L
0
0
Q
2
D F
i13
L
13
Incoming
Files
Workers
File
Review
Completed
Files
1000
100 per
hour
3
Mean 3
Std Dev 1
mins
1 file
1 worker
1 file
1 worker
Inbox
Run ExtendSim
Marine Corps Fuel and Water Logistics
• Modeled availability of complex fuel and water systems based on repair and transport of components
Marine Corps Fuel and Water Logistics
Included use, repair, procurement, transport, and use-life guidelines for multiple system components with different attributes.
Output was system availability data for multiple battalions with different system use profiles.
Navy Ship and Aircraft Operations
Ship and aircraft loading, movement, and debarkation modeling.
Naval Ship Design
Model movement of troops and vehicles within a new ship design to see how long it takes to outfit and deploy a landing force with their vehicles.
Model Optimization
• Extend can be used to optimize problems
• Mathematical solutions require equal numbers of variables and equations to solve
– These are not always available
• Extend uses genetic algorithms to optimize multiple variables in one equation
Optimization Problem
• An unprocessed file results in an average loss of $300
• A processed file results in a gain of $1000
• A worker costs $3000 per 600 time units
• What is the optimal number of people to assign to this job?
Work Flow Optimization
TR U
Workers
R L
Inbox
0
0
Q
D F
ir
L
Completed
585
Run ExtendSim
Set Optimization
Complex Optimization
Fire
FireCalls
EMS
EMS Calls
LE Calls
Full
Full
Dispatchers
Full
Non-emergency Calls
In progress
Completed
F
E
0
Dispatch
Operations
Simulation
In progress
Completed
F
L
0
Full
In progress
Completed
F
E
L 40
In progress
Completed
E
L0
In progress
Completed
F
23933
#
FEL
In progress
CompletedE
28699
In progress
CompletedL
31143
#
FE
Performance
Stats
Call
Processor(s)
Processing Input
Data
Target 0.95
#
FL
Target 0.99
#
ELPct of Calls < 15 secs
#
F
#
E
Pct of calls < 40 secs
#
L
Full
# of
processors
Dispatch Optimization
Modified Blocks
demand
a b cabc
a b cdemand
a b cabc
Standard
Block
Modified
Block
One IDI customer needed a
custom batching block that
could create custom orders
instead of batching the same
items every time
The blocks that come with
ExtendSim can be modified to
Meet unique customer needs
Other Custom Blocks
demand
a
b
c
demand
a
b
c
a b c
L W
FD
L W
F
use
changeu
#
I
use
changeu
#
change
use
u#
ichange
use
u# #
sensor
Gate
#
sensor
Gate
Variable unbatch
Buffer with variable input Bin with variable
starting items
Labor pool with variable
start laborersGate with variable number
Of items within the gate area
Animation
Advanced 3D visualization is supported.
Example Animation
Run ExtendSim
Integrating Netica Models with ExtendSim
Position
AirRouteReturnToForceNeither
20.211.568.3
Identity
HostileNeutralFriendly
42.025.532.5
RSM
F14Mig29BoeingAirbusOtherNone
30.824.39.257.255.4023.0
IFF
ValidReplyNoReply
5.6094.4
Comms
TrueFalse
33.966.1
Classification
Mig29MissileBoeingAirbusF14
30.05.0015.010.040.0
Kinematics
GT700ktss500to700KtsLT500kts
40.341.518.3
EW
F14RadarCommRadar1CommRadar2Mig29RadarMissileRadarNoRadar
27.011.713.221.57.7518.8
Intel
HostileNeutralFriendlyNone
18.415.116.550.0
Netica Models
• Netica is software package for the creation of Bayesian Networks and influence diagrams by Norsys Software Corp
• Comes in a graphical user interface version and a set of Application Programmer Interface (API) functions
Sample Network
Tuberculosis
presentabsent
1.0499.0
XRay Result
abnormalnormal
11.089.0
Tuberculosis or Cancer
truefalse
6.4893.5
Lung Cancer
presentabsent
5.5094.5
Dyspnea
presentabsent
43.656.4
Bronchitis
presentabsent
45.055.0
Visit To Asia
visitno visit
1.0099.0
Smoking
smokernon smoker
50.050.0
Distributed by Norsys Software Corp.
Contributing Factors
Diseases
Symptoms
Chest Clinic
Example Inference
Tuberculosis
presentabsent
6.7293.3
XRay Result
abnormalnormal
100 0
Tuberculosis or Cancer
truefalse
70.629.4
Lung Cancer
presentabsent
64.635.4
Dyspnea
presentabsent
73.226.8
Bronchitis
presentabsent
60.040.0
Visit To Asia
visitno visit
1.2298.8
Smoking
smokernon smoker
100 0
Distributed by Norsys Software Corp.
Contributing Factors
Diseases
Symptoms
Chest Clinic
Adding known information that the person is a smoker and that their chest
XRay was abnormal cause the probability of cancer to jump from 5% to 65%
Influence Diagrams
Weather
no rainrain
70.030.0
Satisfaction
Decide Umbrella
take itleave at home
35.000070.0000
Forecast
sunnycloudyrainy
53.521.525.0
UmbrellaDistributed by Norsys Software Corp.
A n Influence Diagram is a Bayesian Network that also includes
Decision and Utility nodes
Library Description
Get Belief
BeliefState#
The Netica library for Extend is a set of modeling blocks that allows you perform any function on a Netica Bayesian Network or Influence Diagramthat can be done using the Netica graphical user interface. Inputs an outputsallow for dynamic interaction with the rest of the Extend model.
Input desired
state number
Output belief
Why is this Unique?
Extend Netica API
ModL(Pascal-based)
C++(C-based)
Qu'est que c'est le croyanceque le noeud de rayons X estsur l'etat un?
Extend and Netica can not communicate with each other directly
What?
Custom Translator Allows Communications
Extend Netica API
ModL(Pascal-based)
C++(C-based)
Qu'est que c'est le croyance que le noeud de rayons Xest sur l'etat un?
.675
Translator(C++)
What is the belief that node XRay is in state one?
Applications for Netica Users
• Test a network you have created in its simulated operating environment
• Generate probabilities and utilities for CPT tables by having the network learn from a simulation
• Develop networks that can change over time• Batch process a large number of cases by reading
and writing to an Excel worksheet• Reduce complexity by building multiple, smaller
networks and then using Extend to have them operate as one
Applications for Extend Users
• Have networks make complex, multi-attribute decisions during the simulation
– Network can control the simulation
• Model a complex phenomenon that can not be described mathematically
Netica Library
Close Network
Initialize/Open
Network
Initialize/Open/
Compile Network
Open/ Compile
Network Sav e Network
File Functions
Network Functions
Enter Finding Enter Finding Not Enter Likelihood
1 2 3 4 5
Set Node Value
Value
Set State
State
Set State Not
State
Set Utility Value
Value
Enter/Set Functions
Get Belief
Belief
Get Belief
BeliefState#
Get Decision
Decision#
Get Likelihood
LikelihoodState#
Most Likely State
State
Most Likely Value
Value
Get Statistics
Mean Std
Dev
Get Value
Value
Get Functions
Compile Network Fade Node
degree
Retract All
FindingsRetract Node
Findings
Rev ise
Probabilities
degree
Select Network
Integrated Simulation Example
42
Radar
Equation Model
ExtendSim
Aircraft Motion
Equation Model
ExtendSim
Radar Cross Section
Bayesian Network
Netica
Shoot Decision
Influence Diagram
Netica
Aircraft Radar Cross Section
Bayesian Network RCS Model
0
5
10
15
20
25
30
35
dBsm
Test Data
Model Prediction
Bayesian network provides a good representation of the RCS
Radar Target Track(F-16 FMS Radar vs. B-29)
20
25
30
35
40
45
60 70 80 90 100 110 120 130
XRange (NM)
YR
an
ge (
NM
)
No Detection
Detection
Model displays target scintillation (fades in and out) like a real engagement
Combat ID Network
Position
AirRouteReturnToForceNeither
20.211.568.3
Identity
HostileNeutralFriendly
42.025.532.5
RSM
F14Mig29BoeingAirbusOtherNone
30.824.39.257.255.4023.0
IFF
ValidReplyNoReply
5.6094.4
Comms
TrueFalse
33.966.1
Classification
Mig29MissileBoeingAirbusF14
30.05.0015.010.040.0
Kinematics
GT700ktss500to700KtsLT500kts
40.341.518.3
EW
F14RadarCommRadar1CommRadar2Mig29RadarMissileRadarNoRadar
27.011.713.221.57.7518.8
Intel
HostileNeutralFriendlyNone
18.415.116.550.0
Courtesy of CDR George Laskey
Evaluation of Utility
Action/Hypothesis Friendly Commercial Hostile
Shoot - Destroy friendly
aircraft.
- Damage US
prestige.
- Tens of million of
dollars in damage
and loss of pilot
- Possible loss of job
- Destroy
commercial airliner
and kill possibly
hundreds of civilians
and cause tens of
million of dollars in
damage
- No harm to US
forces but significant
damage to US
prestige.
- Destroy enemy
aircraft.
- Reaffirms US
forces are capable of
defending
themselves.
Don’t Shoot - No harm to US
forces or prestige.
- No harm to US
forces or prestige
- Significant damage
to US fleet and
prestige on the order
of hundreds to
thousands of lives
lost and hundreds of
millions to billions $
in damage
47
Expert Elicitation Network Test
0
50
100
150
200
250
MIG-29 Missile Boeing Airbus F-14
Aircraft
En
ga
ge
me
nts
Shoot
No_Shoot
49
Network Modification• Network was then modified by adding arcs from node
“Identity” to nodes “EW” and “Kinematics”. • A new policy that a MIG-29 flying at the radar at speeds
greater than 500 knots and with their radar on is considered to be hostile. Otherwise, these aircraft are neutral.
• The influence diagram was cleared of all probabilities and utility values.
• The equation-based model generated random aircraft engagements, but was modified to randomly make the shoot decision and then determine the utility of that decision.
• Once all node states for the influence diagram were set, the probabilities and utility values were updated
Simulation Learning Network Test
0
50
100
150
200
250
MIG-29 Missile Boeing Airbus F-14
Aircraft
En
ga
ge
me
nts
Shoot
No_Shoot
Genetic Agents Teach an Influence Diagram
count
OpEMCSS
CSS
Priority
Initialize
B
Def ine Rewards
Ev olv e
Agent2 Ev olv e
Local
Agent1 Reward
Local
Agent2 Reward
Logic
AssembleSplit
Initialize/Open/
Compile Network
Game
Set Node Value
Value
Agent1
A
Get
Agent1 Mov e
A
Get
Agent2 Mov e
Statistics
EDef ine MOEs
Set Node Value
Value
Agent2
Set Utility Value
Value
Utility
Reward1 Reward2
Mov e Statistics
Agent1 Mov e Agent2 Mov e
Local
Agent1 Best
Ev olv e
Agent1 Ev olv e
Local
Agent2 Best
Set Game ParametersFirst Move
Multiple Games to Find Best Strategy
Results
Current Game Results
Rev ise
Probabilities
degree
degree
Sav e Network
Game2
A
Set A
degree
Agent1
Agent2
a
b
Close Network
Agent1
Agent2
A
Set A
A
Set A
A
Set A
A
Set A
?