440 likes | 649 Views
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
E N D
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 .initialize() Sim_system.add() Sim_system Sim_system.add() Sim_entity Sim_entity Sim_port Source Sink Sim_port out in Sim_system.link_ports ("Sender", "out", "Receiver", "in"); Sim_system.run()
Animation • Package: simanim; • Class: Anim_applet; • Method: Anim_applet.anim_init(); • Driven by trace output of simulation • S traces • P traces
Analyzing simulation results • Package: simdiag • Java Beans: • TimingDiagram • TraceSaver • TraceLoader • GraphDiagram
TimingDiagram • Stat timing window in anim_init() • Attach to a trace saver • A TraceEventObject • 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 ...
Problems • Take time to download • Unsteady performance • Can’t run sophisticate simulations
Server side • RMI (Remote Method Invocation) • Distributed simjava • EJB (Enterprise JavaBeans) • JSIM
Process Server User Machine RMI Runtime Sim_system.link_ports ("Sender", "out", "Receiver", "in") Source Sink Web Browser Sim_system.add() implements Sim_systemRI Sim_system.add() Client Applet Sim_system Sim_systemRI java.rmi.Remote
EJBs • Independence form messaging middleware, transaction support, naming & directory services… • Delegates difficult tasks to EJB server • Simplify application development
Distributed system • EJB solution has all the tradition weakness • Reuse • Collaborate
Standardization • High Level Architecture (DoD) • 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
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 JavaSpaces service • A transaction manager
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)
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 34th 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 29th conference on Winter simulation Atlanta, Georgia, United States, 1997 • [5] Fred Howell and Ross McNab "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.