the parsimony project a distributed simulation testbed in
play

The Parsimony Project: A Distributed Simulation Testbed in Java - PowerPoint PPT Presentation

The Parsimony Project: A Distributed Simulation Testbed in Java Bruno R. Preiss Ka Wing Carey Wan Electrical and Computer Engineering University of Waterloo http://www.pads.uwaterloo.ca/Bruno.Preiss/talks/1999/websim/slides.ps 1 Outline of


  1. The Parsimony Project: A Distributed Simulation Testbed in Java Bruno R. Preiss Ka Wing Carey Wan Electrical and Computer Engineering University of Waterloo http://www.pads.uwaterloo.ca/Bruno.Preiss/talks/1999/websim/slides.ps 1

  2. Outline of the Talk • requirements for distributed discrete-event simulation • how Java supports distributed discrete-event simulation • modeling and simulation in Parsimony • Parsimony simulators • an example • conclusions 2

  3. Requirements for Distributed Discrete-Event Simulation • modeling support • dynamic loading • support for multiple execution threads • transparent and extensible networking support 3

  4. How Java Supports Distributed Discrete-Event Simulation • models as classes, events as runnable objects • logical processes as threads • the Java Virtual Machine as simulation engine • object serialization • remote method invocation (RMI) 4

  5. Coupling Event Objects and Model Instances class Model { State state = new State(); class Event implements java.lang.Runnable { public void run() { modify(state); schedule(new Event()); } } } 5

  6. Modeling and Simulation in Parsimony • physical processes → logical processes • simulation vs. simulator • entity models and the system model • events as run-once runnable objects • message+handler=event 6

  7. The Entity Model and System Model Classes • entity models are derived from AbstractModel class • events are derived from AbstractEvent class • system model is derived from AbstractSimulation class • message handlers implement the MessageHandler interface 7

  8. Classes defined in the Parsimony Package AbstractSimulation AbstractEvent AbstractModel MessageHandler extends extends extends implements instantiates system model events message handlers entity models User-defined Classes 8

  9. Achieving the Separation of Concerns • separate user-defined, application-specific simulation code from domain of the simulator • allow completely transparent support for multiple simulators 9

  10. calls method createProcess simulator is bound to system model instance instance creates creates calls methods send(Message m) schedule(Event e) system process is bound to entity model instance instance logical process provided by Parsimony user-defined 10

  11. Simulators • SequentialSimulator • MultiListSimulator • ThreadedMLSimulator • ThreadedCMBSimulator • ThreadedTWSimulator • RealTimeSimulator 11

  12. Distributed Simulators • DistributedMLSimulator • DistributedCMBSimulator • DistributedTWSimulator • DistributedRTSimulator 12

  13. AbstractDistributedSimulator ThreadedXSimulator extends extends aggregates n X.Master X.Slave DistributedXSimulator 13

  14. An Example—A Single-Server Queueing Network customers chan0 chan1 Source QueueAndServer Sink 14

  15. Source Model class Source extends AbstractModel { RandomVariable interDepartureTime; public Source (long mean) { super(0, 1); interDepartureTime = new ExponentialRV(mean); } public void initialize (long time) { schedule(new Departure(time)); } class Departure extends AbstractEvent { Departure(long time) { super(time); } public void run () { send(new VoidMessage(getTime())); schedule(new Departure(Math.round(getTime() + interDepartureTime.nextDouble()))); } } } 15

  16. Sink Model class Sink extends AbstractModel { Sink () { super(1, 0); setMessageHandler(new ArrivalHandler()); } class ArrivalHandler implements MessageHandler { public void run(Message message) {} } } 16

  17. Queue-and-Server Model class QueueAndServer extends AbstractModel { RandomVariable serviceTime; int numberInQueue = 0; boolean serverBusy = false; QueueAndServer (long mean) { super(1, 1); serviceTime = new ExponentialRV(mean); setMessageHandler(new ArrivalHandler()); } class ArrivalHandler implements MessageHandler { public void run (Message message) { if (serverBusy) ++numberInQueue; else { serverBusy = true; schedule(new Departure(Math.round(getTime() + serviceTime.nextDouble()))); } } } 17

  18. class Departure extends AbstractEvent { Departure (long time) { super(time); } public void run () { send(new VoidMessage(getTime())); if (numberInQueue == 0) serverBusy = false; else { --numberInQueue; schedule(new Departure(Math.round(getTime() + serviceTime.nextDouble()))); } } } } 18

  19. System Model class Queueing extends AbstractSimulation { public void run () { Channel chan0 = createChannel(); Channel chan1 = createChannel(); createProcess(new Source(1000), new ChannelHead[] {}, new ChannelTail[] { chan0 }); createProcess(new QueueAndServer(1000), new ChannelHead[] { chan0 }, new ChannelTail[] { chan1 }); createProcess(new Sink(), new ChannelHead[] { chan1 }, new ChannelTail [] {}); super.run(); } } 19

  20. Summary and Conclusions • Parsimony as vehicle for research in distributed discrete-event simulation • project goals and status • contributions of paper: – identification of requirements of discrete-event simulation with respect to the underlying implementation technology – show how Java language and JVM directly support these requirements 20

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend