Download - Web-based Simulation
![Page 1: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/1.jpg)
Web-based SimulationWeb-based Simulation
Course: 60-520Course: 60-520Instructor: Dr. A.K. AggarwalInstructor: Dr. A.K. Aggarwal
By Sheng BaiBy Sheng Bai
![Page 2: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/2.jpg)
AgendaAgenda
• IntroductionIntroduction
• Client-basedClient-based
• Server-basedServer-based
• DistributedDistributed
• SummarySummary
• ReferenceReference
![Page 3: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/3.jpg)
What’s SimulationWhat’s Simulation
• Building a softwareBuilding a software
• Based on an algorithmic logicBased on an algorithmic logic
• Simulate some phenomenonSimulate some phenomenon
• With some purposeWith some purpose– Observing systemsObserving systems– Finding analytical solutionsFinding analytical solutions– Predicting system behaviorsPredicting system behaviors
![Page 4: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/4.jpg)
Types of simulationTypes of simulation
• Stochastic or deterministicStochastic or deterministic
• Continuous or discreteContinuous or discrete
• Local or distributedLocal or distributed
![Page 5: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/5.jpg)
Web-based SimulationWeb-based Simulation
• A driver of software technologiesA driver of software technologies
• A rapidly emerging areaA rapidly emerging area– WEBSIM;WEBSIM;– Winter Simulation Conference Sessions;Winter Simulation Conference Sessions;– WSC Modeling Methodology Track;WSC Modeling Methodology Track;
• Java Java
![Page 6: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/6.jpg)
ClassificationClassification
• Client-basedClient-based
• Server-basedServer-based
• DistributedDistributed
![Page 7: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/7.jpg)
Client-based Client-based
• Browser & Server StructureBrowser & Server Structure
• Download logic to client sideDownload logic to client side
• Running and analyzing on client’s Running and analyzing on client’s sideside
• No communications during the No communications during the simulationsimulation
• Implementation: simjavaImplementation: simjava
![Page 8: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/8.jpg)
simjavasimjava
• A discrete event simulation package A discrete event simulation package
• A Java port of a C++ library, HASE+A Java port of a C++ library, HASE++ +
• HASE++ is based on Jade’s SIM++HASE++ is based on Jade’s SIM++
![Page 9: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/9.jpg)
• A collection of A collection of entities: Sim_entityentities: Sim_entity
• Entities are Entities are connected by connected by ports: Sim_portports: Sim_port
• Communication via Communication via using event using event objects: Sim_eventobjects: Sim_event
• Central controller: Central controller: Sim_systemSim_system
![Page 10: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/10.jpg)
Process Process
Sim_system
.initialize()
Source
Sim_entity
Sink
Sim_entity
Sim
_syste
m.a
dd
()
Sim
_syste
m.a
dd()
Sim_system.link_ports ("Sender", "out", "Receiver", "in");
Sim_system.run()
out in
Sim_port
Sim_port
![Page 11: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/11.jpg)
Animation Animation
• Package: simanim;Package: simanim;
• Class: Anim_applet;Class: Anim_applet;
• Method: Anim_applet.anim_init();Method: Anim_applet.anim_init();
• Driven by trace output of simulationDriven by trace output of simulation– S tracesS traces– P tracesP traces
![Page 12: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/12.jpg)
DemonstrationDemonstration
![Page 13: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/13.jpg)
Analyzing simulation Analyzing simulation resultsresults
• Package: simdiagPackage: simdiag• Java Beans:Java Beans:
– TimingDiagramTimingDiagram– TraceSaverTraceSaver– TraceLoaderTraceLoader– GraphDiagramGraphDiagram
![Page 14: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/14.jpg)
TimingDiagramTimingDiagram
• Stat timing window in anim_init()Stat timing window in anim_init()• Attach to a trace saverAttach to a trace saver• A TraceEventObjectA TraceEventObject
– Trace lineTrace line– A command:A command:
•TRACE; LAYOUT; RUN; PAUSE; STOP; DISPLAYTRACE; LAYOUT; RUN; PAUSE; STOP; DISPLAY
![Page 15: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/15.jpg)
Example trace FileExample trace File
$types $types State IDLE BUSY SEND RECV State IDLE BUSY SEND RECV
$bars $bars p[0] State p[0] State p[1] State p[1] State
$events $events u:p[0] at 1.234: P IDLE u:p[0] at 1.234: P IDLE u:p[1] at 4.567: P BUSY u:p[1] at 4.567: P BUSY ......
![Page 16: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/16.jpg)
TimingDiagramTimingDiagram
![Page 17: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/17.jpg)
GraphDiagramGraphDiagram
![Page 18: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/18.jpg)
GraphDiagramGraphDiagram
![Page 19: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/19.jpg)
Problems Problems
• Take time to downloadTake time to download
• Unsteady performanceUnsteady performance
• Can’t run sophisticate simulationsCan’t run sophisticate simulations
![Page 20: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/20.jpg)
Server sideServer side
• RMI (Remote Method Invocation)RMI (Remote Method Invocation)– Distributed simjavaDistributed simjava
• EJB (Enterprise JavaBeans)EJB (Enterprise JavaBeans)– JSIMJSIM
![Page 21: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/21.jpg)
RMI ArchitectureRMI Architecture
![Page 22: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/22.jpg)
User Machine
Web Browser
Server
RMI Runtime
Process Process
Sim_system
Source Sink
Client Applet
Sim_systemRI
Sim
_syste
m.a
dd()
Sim
_syste
m.a
dd()
Sim_system.link_ports ("Sender", "out", "Receiver", "in")
java.rmi.Remote
implements Sim_systemRI
![Page 23: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/23.jpg)
EJBsEJBs
• Independence form messaging Independence form messaging middleware, transaction support, middleware, transaction support, naming & directory services…naming & directory services…
• Delegates difficult tasks to EJB serverDelegates difficult tasks to EJB server
• Simplify application developmentSimplify application development
![Page 24: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/24.jpg)
Client-Server InteractionClient-Server Interaction
![Page 25: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/25.jpg)
JSIM ArchitectureJSIM Architecture
![Page 26: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/26.jpg)
Simulation processSimulation process
![Page 27: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/27.jpg)
Distributed systemDistributed system
• EJB solution has all the tradition EJB solution has all the tradition weakness weakness
• ReuseReuse
• CollaborateCollaborate
![Page 28: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/28.jpg)
Standardization Standardization
• High Level Architecture (DoD)High Level Architecture (DoD)• Components based ArchitectureComponents based Architecture• Runtime infrastructure (RTI)Runtime infrastructure (RTI)
– Federation managementFederation management– Declaration managementDeclaration management– Object managementObject management– Ownership managementOwnership management– Time managementTime management– Data distribution managementData distribution management
![Page 29: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/29.jpg)
Solution: Jini & XML + JSIMSolution: Jini & XML + JSIM
• Jini: a universal network-computing Jini: a universal network-computing modelmodel
• XML: a universal format for data XML: a universal format for data exchangeexchange
![Page 30: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/30.jpg)
JiniJini
• Java dynamic networkingJava dynamic networking
• Distributed, highly adaptive to changeDistributed, highly adaptive to change
• Open softwareOpen software
• Originally created by Sun Originally created by Sun MicrosystemsMicrosystems
• Contributed to Jini Community in 1999Contributed to Jini Community in 1999
![Page 31: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/31.jpg)
Jini ArchitectureJini Architecture
InfrastructureInfrastructure ProgrammingProgramming
ModelModelServicesServices
BaseBase
JavaJavaJava VMJava VM Java APIsJava APIs JNDIJNDI
RMIRMI Java BeansJava Beans Enterprise Enterprise BeansBeans
Java SecurityJava Security …… JTSJTS
JavaJava
++
JiniJini
Discovery/Join Discovery/Join Leasing Leasing Printing Printing
Distributed Distributed Security Security
TransactionsTransactions Transaction Transaction Manager Manager
Lookup Lookup Events Events JavaSpaces JavaSpaces Service Service
![Page 32: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/32.jpg)
InfrastructureInfrastructure
• Distributed securityDistributed security– Integrated into RMI, Integrated into RMI, – extends to world of distributed systemsextends to world of distributed systems
• Discovery/Join protocolDiscovery/Join protocol– Allows services to discover, advertiseAllows services to discover, advertise
• Lookup serviceLookup service– A repository of servicesA repository of services
![Page 33: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/33.jpg)
Programming ModelProgramming Model
• Leasing interface Leasing interface – Allocating and Freeing resources Allocating and Freeing resources
• Event and notification interfaceEvent and notification interface– Enabling Event-based communication Enabling Event-based communication
• Transaction interfaceTransaction interface– Ensuring properly coordination of state Ensuring properly coordination of state
changes.changes.
![Page 34: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/34.jpg)
ServicesServices
• Builds on top of InfrastructureBuilds on top of Infrastructure
• Has an interface defining its Has an interface defining its operationsoperations
• Both user and program orientedBoth user and program oriented
• Examples:Examples:– A printing serviceA printing service– A JavaSpaces serviceA JavaSpaces service– A transaction managerA transaction manager
![Page 35: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/35.jpg)
1. Discovery1. Discovery
![Page 36: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/36.jpg)
2. Join2. Join
![Page 37: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/37.jpg)
3. Lookup3. Lookup
![Page 38: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/38.jpg)
Process4: InvokeProcess4: Invoke
![Page 39: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/39.jpg)
XMLXML
• Self-descriptive, text-based, universalSelf-descriptive, text-based, universal
• Two ways to access XML documentsTwo ways to access XML documents– Element level: standard APIsElement level: standard APIs
•Simple APIs for XML (SAX): efficientSimple APIs for XML (SAX): efficient
•Document Object Model (DOM): flexibleDocument Object Model (DOM): flexible
– Object level: programmatic manipulationObject level: programmatic manipulation• Java XML Data Binding project (Sun)Java XML Data Binding project (Sun)
•Dynamic XML (Object Space)Dynamic XML (Object Space)
![Page 40: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/40.jpg)
JSIM Federated Simulation with JSIM Federated Simulation with Jini and XMLJini and XML
![Page 41: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/41.jpg)
SummarySummary
• Three typesThree types
• A young disciplineA young discipline
• Reuse of existing simulation modelsReuse of existing simulation models
• Federated is the most promising oneFederated is the most promising one
![Page 42: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/42.jpg)
ReferenceReference• [1] Xeuqin Huang and John A. Miller, "Building a Web-Based [1] Xeuqin Huang and John A. Miller, "Building a Web-Based
Federated Simulation System with Jini and XML," Proceedings of the Federated Simulation System with Jini and XML," Proceedings of the 34th Annual Simulation Symposium (ANSS'01), Seattle, Washington, 34th Annual Simulation Symposium (ANSS'01), Seattle, Washington, United States, April 2001United States, April 2001
• [2] Z.Y. Du, “LBSim: A Simulation System for Dynamic Load-[2] Z.Y. Du, “LBSim: A Simulation System for Dynamic Load-Balancing Algorithms for Distributed Systems”, Technical Report in Balancing Algorithms for Distributed Systems”, Technical Report in University of Windsor, Canada, 2004.University of Windsor, Canada, 2004.
• [3][3] John A. Miller, Andrew F. Seila and Xuewei Xiang, "The JSIM John A. Miller, Andrew F. Seila and Xuewei Xiang, "The JSIM Web-Based Simulation Environment," Future Generation Computer Web-Based Simulation Environment," Future Generation Computer Systems (FGCS), Special Issue on Web-Based Modeling and Systems (FGCS), Special Issue on Web-Based Modeling and Simulation, Vol. 17, No. 2 (October 2000) pp. 119-133. Elsevier Simulation, Vol. 17, No. 2 (October 2000) pp. 119-133. Elsevier North-Holland.North-Holland.
• [4] Ernest H. Page, Robert L. Moose Jr. and Sean P. Griffn, “Web-[4] Ernest H. Page, Robert L. Moose Jr. and Sean P. Griffn, “Web-based simulation in simjava using remote method invocation”, based simulation in simjava using remote method invocation”, Proceedings of the 29th conference on Winter simulation Atlanta, Proceedings of the 29th conference on Winter simulation Atlanta, Georgia, United States, 1997Georgia, United States, 1997
• [5][5] Fred Howell and Ross McNab "simjava: a discrete event Fred Howell and Ross McNab "simjava: a discrete event simulation package for Java with applications in computer systems simulation package for Java with applications in computer systems modelling", in proc. First International Conference on Web-based modelling", in proc. First International Conference on Web-based Modelling and Simulation, San Diego CA, Society for Computer Modelling and Simulation, San Diego CA, Society for Computer Simulation, Jan 1998.Simulation, Jan 1998.
![Page 43: Web-based Simulation](https://reader035.vdocuments.net/reader035/viewer/2022062314/56814023550346895dab80da/html5/thumbnails/43.jpg)
Questions?Questions?