SIMUTools, Rome, Italy 2009
CoSMoS: A Visual Environment for Component-Based Modeling,
Experimental Design, and Simulation
Vignesh [email protected]
Content Management and Archiving EMC Corporation, CA, USA
Hessam [email protected]
ACIMSDept. of Computer Science and Engineering
School of Computing and InformaticsArizona State University, Tempe, AZ, USA
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Motivation
Simulation modeling is complex
Theoretical models are domain-neutral Visual modeling notations are restrictive Domain knowledge is unstructured Automated code generation is incomplete Design of experiments are unconstrained
Modeling
&
Simulation
SoftwareModels
ProgrammingLanguages
ModelSpecification
SimulationProtocols
M&S research and practices: various combinations of methods, tools, and processes spanning software engineering and modeling and simulation are commonly used
Paper/pencilStandalone tools
IDEssimulators
StandardsIntegrated M&S Development Environment
Eclipse
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Some M&S Frameworks Many modeling approaches exist
General-purpose and domain-specific, e.g., DEVS Opnet Ptolemy SimEvents
Ptolemy II: • pre-built components can be visually
synthesized; • domain-specific model libraries
reduce efforts in model development
tool
High Level Architecture with Federation Development Process are aimed at simplifying and reducing cost/effort M&S activities such as simulation validation
software-centric
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Modeling & Simulation LifecycleCommon steps (a simplified view)
• Conceptual or (Semi-)Formal specification• Software design• Code development• Simulation experiments• Evaluating model dynamics
public void deltext(double e, msg x){Continue(e);
if (phaseIs("passive")) for (int i=0; i< x.getLength();i++) if (messageOnPort(x,"in",i)){ job = x.getValOnPort("in",i); holdIn("busy",processing_time);}}
Experiments
High-Level Model Design
Simulation Model Development
3 exte
s
s
2e1e
AbstractDetectorController_Observ er
update(subject_in : AbstractDetectorController_Subject) : v oid
(from Mount)
AbstractDetectorController
subjectState : String
getState() : String
(from Detector)AbstractMountController
observ erState : String
(from Mount)
<<realize>>
1
-subject
1
<<subscribe>>
Observ atory ControlSy stem <<creates>>
AbstractDetectorControllerNode
(from Detector)
1
1
1
1
AbstractDetectorController_Subject
observ ers : Array
attach(observ er : AbstractDetectorController_Observ er) : v oiddettach(observ er : AbstractDetectorController_Observ er) : v oidnotif y () : v oid
(from Detector)
n
-observ ers
n
<<uses>>
1..n
1
1..n
1
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Component-Based System Modeler (CoSMo) Specifying a family of models
System-theoretic component models supports DEVS supports XML-schema can support other component-based models
e.g., differential equation models
Model persistence Full structure, partial behavior, and complexity metrics
Definitions AxiomsPrimitive Model Composite ModelSpecializationTemplate Model Instance Template Model
Instance Model
Typing InheritanceUniformityStrict Hierarchy
VisualModeling
LogicalModeling
PersistentModeling
ModelTranslators
Simulation language
Markup Language
modeling
started in 2001
H.S. SarjoughianSIMUTools, Rome, Italy 2009
CoSMo Environment
H.S. SarjoughianSIMUTools, Rome, Italy 2009
DEVS-Suite Simulator
A discrete-event simulator supporting parallel DEVS modeling formalism DEVSJAVA
Logical and soft real-time execution Interactions (messages) is animated Requires compiled simulation code
DEVS Tracking Environment Design of experiments for any component’s I/O Data collection and storage (tabular and CSV)
TimeView Generating I/O time trajectories with select state
variables
simulation
started in 1996
H.S. SarjoughianSIMUTools, Rome, Italy 2009
CoSMoS: Concept and Base Architecture
repositories
models
simulatable,non-simulatable
code
visualization
data sets
translators
CDNS
DEVS
transla
tor
XML
transla
tor
SO
A
MIP
S3
2
manufa
cturin
gDEVS-Suite
CA
connectivityschemes
CoSMo
component-based
CA: Cellular AutomataSOA: Service Oriented ArchitectureCDNS: Collaborative Distributed Network System
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Process LifecycleModels– component-based model specificationRepositories – persistent modelsVisualization –
Model notation for defining model specifications
Simulation plots/graphs for simulations
Code – Simulation model generates behaviorTranslators – generating simulation code from model specificationsData – simulated model dynamics
Select database
Select an existing template model or create new
model
Select instance template model and create its
instance models
Transform instance models
Database
Add behavior to simulation models
Partial DEVS-Suite
ModelsMod
el D
evel
opm
ent
Select and load simulation models
Select visualization modes ( SimView,
TimeView and Tracking Log)
JVM
Select input/output
ports of models for tracking
Completed and compiled
DEVS-Suite files
Execute
Exp
erim
enta
tion
D
esig
n a
nd
C
onfi
gura
tion
SimView Tracking Log TimeViewSim
ula
tion model
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Unique Instance Model Names
10
Specialization
Primitive Models
Composite Models
family of Instance Template Models are systematically mapped to multiple Instance Models
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Model / Class Name Relationship
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Model/Data Categories
discrete-eventcontinuous
RootRoot
Mb_models
<Name of Database 1> <Name of Database 2> <Name of Database 3>
XML Models
Database1.mdb
Model1.Java
Model2.Java
Model3.Java
Model1.class
Model2.class
Model3.class SES DTD Models SES XSD Models CoSMo DTD Models
JAVA Models NSM Models
CompiledModelsDEVS_SuiteGeneratedModelsDEVS_Suite
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Consistency: Models and Code
13
1-to-1 relationship between logical model and generated code holds (uni-directional)
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Generation/Viewing of Simulation Results
Select Database
Select an existing template model or create new
model
Select instance template model and create its
instance models
Transform instance models
CoSMoDatabase
Add behavior to simulation models
Select and load simulation models
Select visualization modes ( SimView,
TimeView and Tracking Log)
JVM
Select input/output
ports of models for tracking
Partial DEVSJAVA
Models
Completed and compiled
DEVSJAVA files
Execute
CoSMo
CoSMoS
DEVS-Suite
SimView Tracking Log TimeView
animation tabulated results time trajectories
H.S. SarjoughianSIMUTools, Rome, Italy 2009
A Comparison: Visual Complexity
Metrics Ptolemy IISimEvent
sCoSMo
Slogical components 9 11 5ports 15 29 10couplings 11 14 4monitoring components 2 4 0*trajectory viewers 2 4 4
• Logical components with messages among ports and couplings are animated
• Monitoring components represent time-based trajectories (trend charts) in the model layout.
• Trajectory viewers refers to the different views that show up on simulation.
* Pops-up dialog boxes to select the trajectory viewers.
15
Metrics Ptolemy IISimEvent
sCoSMo
Slogical components 9 11 5ports 15 29 10couplings 11 14 4monitoring components 2 4 0*trajectory viewers 2 4 4total # of components
39 62 23
H.S. SarjoughianSIMUTools, Rome, Italy 2009
Summary
Supports
Automated consistency among a family of logical/visual models
Automated generation of simulatable code (e.g., DEVS-Suite) for target simulators or code for data (XML Schema)
Visual configuration for experiments
Simplifies M&S verification, validation, and accreditation activities
Supports Future Research (easy hard)
Automated consistency among a family of logical/visual models
Consistency between logical models and user-modified code is bi-directional Reverse Modeling
Automated generation of partial simulatable code (e.g., DEVS-Suite) for target simulators or code for data processing (XML Schema)
Behavioral modeling is completely supported; separation between domain-neutral and domain-specific is supported
Visual configuration for experimentsExperimental data storage and meta knowledge about models and data are managed
Simplifies M&S verification, validation, and accreditation activities
Collaborative M&S is supported
Hybrid modeling is supported (e.g., continuous, discrete, cellular automata models)
?
Integrated Modeling and Simulation with CoSMoS: First Generation
H.S. SarjoughianSIMUTools, Rome, Italy 2009
DEVS-Suite and CoSMoS
DEVS-Suite
http://devs-suitesim.sourceforge.net/
CoSMo and CoSMoS (soon will be made available at SourceForge)