d5667b709fc681774949ec88f3106054.ppt
- Количество слайдов: 43
Web-based Simulation Course: 60 -520 Instructor: Dr. A. K. Aggarwal By Sheng Bai
Agenda • Introduction • Client-based • Server-based • Distributed • Summary • Reference
What’s Simulation • Building a software • Based on an algorithmic logic • Simulate some phenomenon • With some purpose – Observing systems – Finding analytical solutions – Predicting system behaviors
Types of simulation • Stochastic or deterministic • Continuous or discrete • Local or distributed
Web-based Simulation • A driver of software technologies • A rapidly emerging area – WEBSIM; – Winter Simulation Conference Sessions; – WSC Modeling Methodology Track; • Java
Classification • Client-based • Server-based • Distributed
Client-based • Browser & Server Structure • Download logic to client side • Running and analyzing on client’s side • No communications during the simulation • Implementation: simjava
simjava • A discrete event simulation package • A Java port of a C++ library, HASE++ • HASE++ is based on Jade’s SIM++
• A collection of • • • entities: Sim_entity Entities are connected by ports: Sim_port Communication via using event objects: Sim_event Central controller: Sim_system
Process Sim_system Sim_entity Source Sim_system. add() Sim_port . initialize() Sim_entity Sink out in Sim_system. link_ports ("Sender", "out", "Receiver", "in"); Sim_system. run() Sim_port
Animation • Package: simanim; • Class: Anim_applet; • Method: Anim_applet. anim_init(); • Driven by trace output of simulation – S traces – P traces
Demonstration
Analyzing simulation results • Package: simdiag • Java Beans: – Timing. Diagram – Trace. Saver – Trace. Loader – Graph. Diagram
Timing. Diagram • Stat timing window in anim_init() • Attach to a trace saver • A Trace. Event. Object – Trace line – A command: • TRACE; LAYOUT; RUN; PAUSE; STOP; DISPLAY
Example trace File $types State IDLE BUSY SEND RECV $bars p[0] State p[1] State $events u: p[0] at 1. 234: P IDLE u: p[1] at 4. 567: P BUSY. . .
Timing. Diagram
Graph. Diagram
Graph. Diagram
Problems • Take time to download • Unsteady performance • Can’t run sophisticate simulations
Server side • RMI (Remote Method Invocation) – Distributed simjava • EJB (Enterprise Java. Beans) – JSIM
RMI Architecture
Process Server User Machine RMI Runtime Sim_system. link_ports ("Sender", "out", "Receiver", "in") Source Web Browser Sim_system. RI implements Sim_system. RI Sim_system. add() Client Applet Sink java. rmi. Remote
EJBs • Independence form messaging middleware, transaction support, naming & directory services… • Delegates difficult tasks to EJB server • Simplify application development
Client-Server Interaction
JSIM Architecture
Simulation process
Distributed system • EJB solution has all the tradition weakness • Reuse • Collaborate
Standardization • High Level Architecture (Do. D) • Components based Architecture • Runtime infrastructure (RTI) – Federation management – Declaration management – Object management – Ownership management – Time management – Data distribution management
Solution: Jini & XML + JSIM • Jini: a universal network-computing model • XML: a universal format for data exchange
Jini • Java dynamic networking • Distributed, highly adaptive to change • Open software • Originally created by Sun Microsystems • Contributed to Jini Community in 1999
Jini Architecture Infrastructure Java + Jini Services Java VM Java APIs JNDI RMI Java Beans Enterprise Beans Java Security Base Java Programming Model … JTS Discovery/Join Leasing Printing Distributed Security Transactions Transaction Manager Lookup Events Java. Spaces Service
Infrastructure • Distributed security – Integrated into RMI, – extends to world of distributed systems • Discovery/Join protocol – Allows services to discover, advertise • Lookup service – A repository of services
Programming Model • Leasing interface – Allocating and Freeing resources • Event and notification interface – Enabling Event-based communication • Transaction interface – Ensuring properly coordination of state changes.
Services • Builds on top of Infrastructure • Has an interface defining its operations • Both user and program oriented • Examples: – A printing service – A Java. Spaces service – A transaction manager
1. Discovery
2. Join
3. Lookup
Process 4: Invoke
XML • Self-descriptive, text-based, universal • Two ways to access XML documents – Element level: standard APIs • Simple APIs for XML (SAX): efficient • Document Object Model (DOM): flexible – Object level: programmatic manipulation • Java XML Data Binding project (Sun) • Dynamic XML (Object Space)
JSIM Federated Simulation with Jini and XML
Summary • Three types • A young discipline • Reuse of existing simulation models • Federated is the most promising one
Reference • [1] Xeuqin Huang and John A. Miller, "Building a Web-Based Federated • • Simulation System with Jini and XML, " Proceedings of the 34 th Annual Simulation Symposium (ANSS'01), Seattle, Washington, United States, April 2001 [2] Z. Y. Du, “LBSim: A Simulation System for Dynamic Load-Balancing Algorithms for Distributed Systems”, Technical Report in University of Windsor, Canada, 2004. [3] John A. Miller, Andrew F. Seila and Xuewei Xiang, "The JSIM Web. Based Simulation Environment, " Future Generation Computer Systems (FGCS), Special Issue on Web-Based Modeling and Simulation, Vol. 17, No. 2 (October 2000) pp. 119 -133. Elsevier North-Holland. [4] Ernest H. Page, Robert L. Moose Jr. and Sean P. Griffn, “Web-based simulation in simjava using remote method invocation”, Proceedings of the 29 th conference on Winter simulation Atlanta, Georgia, United States, 1997 [5] Fred Howell and Ross Mc. Nab "simjava: a discrete event simulation package for Java with applications in computer systems modelling", in proc. First International Conference on Web-based Modelling and Simulation, San Diego CA, Society for Computer Simulation, Jan 1998.
Questions?
d5667b709fc681774949ec88f3106054.ppt