Title: Viskit: Rapid Modeling of Event Graph Components
1Viskit Rapid Modeling of Event Graph Components
- Arnold Buss
- MOVES Institute
2Overview
- Introduction
- Event Graph Methodology
- Simkit Java Implementation
- XML Schema for Event Graph Representation
- Viskit, Visual Tool for Event Graph Construction
- XML Schema for DES Model Assemblies
3Introduction
- Barriers to use of simulation models
- Simulation Big and Costly
- Time to develop model
- Lack of rigorous methodology
- Lack of rapid-development tools
4Introduction (cont)
- Breaking the Barriers
- Event Graph Methodology
- Simkit Programming API
- Viskit Graphical Tool
- XML Schema for Component Representations
5Event Graph Methodology
- Pure Discrete Event Simulation (DES)
- Four Elements to DES Model
- Parameters
- State Variables
- Events (State Transition Functions)
- Scheduling Relationships Between Events
6Event Graph Methodology (cont)
7Simple Event Graph
8More Complicated Event Graph
9Event Graph Components
- Based on Listener Pattern
- Loosely Coupled Simulation Components
- Listener Event Graph Objects (LEGO)
10SimEventListener Pattern
- SimEvent Source dispatches its SimEvent to
registered SimEvent Listeners - All SimEvents (except Run) are heard by
Listener - Used for assembling models from components
11Example Multiple Server Queue
12Property Change Listener Pattern
- PropertyChangeEvents fired at every state
transition - Listener may register for specific or all
PropertyChange Events - Used for statistics, graphing, etc.
13Property Change Listener Example
14Adapter Pattern
- Used when event name change is desired in
listener object - When Event A in source occurs, Event B in
Listener is triggered
15Adapter Representation
Is represented
16Simkit
- Java API for creating Event Graph models
- Open Source
- Effective for teaching DES
- Used in more than 30 NPS Masters Theses
- Implements Listener Event Graph Object pattern
17Simkit
- Based on solid Event Graph methodology
- Enables reasonably rapid construction of DES
models - NPS OR/MV students able to implement models in
matter of a few months - Enabler for implementing new features in DES
models
18Recent NPS Theses using Simkit
- REMUS vehicle for mine detection (Allen, 2004)
- Repair and Sparing of Jet Engines (Schoch, 2003)
- Operational Availability of MMA (Margolis, 2003)
- Submarine Mine avoidance (Nawara, 2003)
- Dynamic Allocation of Fires and Sensors (Havens,
2002)
19Simkit Relation to Event Graph
20Sample Code Snippet
- public class Server extends SimEntityBase
- . . .
- private RandomVariate serviceTime
- protected int numberInQueue
- protected int numberAvailableServers
- public void doArrival()
- numberInQueue numberInQueue 1
- firePropertyChange("numberInQueue",
numberInQueue 1, numberInQueue) - if (getNumberAvailableServers() gt 0)
- waitDelay("StartService", 0.0)
-
-
- public void doStartService()
- numberInQueue numberInQueue 1
- firePropertyChange("numberInQueue",
numberInQueue 1, numberInQueue) - numberAvailableServers
numberAvailableServers 1 - firePropertyChange("numberAvailableServers
", numberAvailableServers 1,
21Listener Patterns in Simkit
- ArrivalProcess arrival new ArrivalProcess(. .
.) - Server server new Server(. . .)
- arrival.addSimEventListener(server)
- PropertyChangeListener numInQueueStat
- new SimpleStatsTimeVarying(numberInQueue)
- server.addPropertyChangeListener(numInQueueStat)
- PropertyChangeListener numAvailableServerStat
- new SimpleStatsTimeVarying(numberAvailableServer
s) - server.addPropertyChangeListener(
- numAvailableServerStat, numberAvailableServers)
22Viskit Motivation
- Simkit requires Java programming
- Need for non-programmer use
- Need for rapid development tool
- Organize reusable components
- Repository of existing models and components for
reuse
23XML for Event Graph Components
- Data-centric representation of Event Graph
Components - XML is standard, open data format
- Language and Implementation independent
- Enabler for web services
24Event Graph/XML Translation
25Example XML Snippet
ltSimEntity name"SimpleServer" version"0.1"gt
ltParameter type"simkit.random.RandomVariate"
name"serviceTime"/gt ltParameter type"int"
name"totalNumberServers"/gt ltStateVariable
name"numberInQueue" type"int"/gt
ltStateVariable name"numberAvailableServers"
type"int"/gt ltEvent name"Run"gt
ltStateTransition state"numberInQueue"gt
ltAssignment value"0"/gt
lt/StateTransitiongt ltStateTransition
state"numberAvailableServers"gt
ltAssignment value"totalNumberServers"/gt
lt/StateTransitiongt lt/Eventgt . .
. lt/SimEntitygt
26XML Snippet (cont)
ltEvent name"Arrival"gt ltStateTransition
state"numberInQueue"gt ltAssignment
value"numberInQueue 1"/gt
lt/StateTransitiongt ltSchedule
condition"numberAvailableServers gt 0"
priority"1.0" delay"0.0" event"StartService"/
gt lt/Eventgt ltEvent name"StartService"gt
ltStateTransition state"numberInQueue"gt
ltAssignment value"numberInQueue - 1"/gt
lt/StateTransitiongt ltStateTransition
state"numberAvailableServers"gt
ltAssignment value"numberAvailableServers - 1"/gt
lt/StateTransitiongt ltSchedule
delay"serviceTime.generate()"
event"EndService"/gt lt/Eventgt
27Code Generator
- Generates Simkit Java code from XML document
- SimEntity XML document -gt SimEntityBase subclass
- Assembly XML document -gt instances of SimEntities
and Listeners
28Viskit Event Graph Editor
- Even more rapid development of Event Graph
Components - Exposes Event Graph structure better than code
- Modeler draws Event Graph and fills in
information - Open Source
29Viskit Event Graph Editor
Scheduling/Canceling Edge
Create New Event
Self-Scheduling Edge
State Variables
Drawing Canvas
Simulation Parameters
30Server Component in Viskit
31Viskit Assembly Editor
- Assembly consists of
- Instances of SimEntities and PropertyChangeListene
rs - Listening connections
32Viskit Assembly Editor
Event Graph Components
Listener Connection Toolbar
New Instance Wizard
Assembly Canvas
PropertyChangeListeners
Execution Controls
33Example Viskit Assembly
34Summary
- Rapid DES modeling is possible
- Event Graph Methodology robust
- Simkit implementation mature, stable
- Viskit application accelerates development time
- Basic features and design of Viskit complete
35Ongoing Work and Improvements
- Improve user-friendliness of Viskit
- Add Experimental Design and execution features
- Execution on computer clusters
- Documentation, Help and Tutorial
- Incorporate features based on user feedback and
testing
36Questions