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

the parsimony project a distributed simulation testbed in
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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

slide-2
SLIDE 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

slide-3
SLIDE 3

Requirements for Distributed Discrete-Event Simulation

  • modeling support
  • dynamic loading
  • support for multiple execution threads
  • transparent and extensible networking support

3

slide-4
SLIDE 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

slide-5
SLIDE 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

slide-6
SLIDE 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

slide-7
SLIDE 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

slide-8
SLIDE 8

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

slide-9
SLIDE 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

slide-10
SLIDE 10

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

slide-11
SLIDE 11

Simulators

  • SequentialSimulator
  • MultiListSimulator
  • ThreadedMLSimulator
  • ThreadedCMBSimulator
  • ThreadedTWSimulator
  • RealTimeSimulator

11

slide-12
SLIDE 12

Distributed Simulators

  • DistributedMLSimulator
  • DistributedCMBSimulator
  • DistributedTWSimulator
  • DistributedRTSimulator

12

slide-13
SLIDE 13

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

slide-14
SLIDE 14

An Example—A Single-Server Queueing Network

chan0 chan1 Source QueueAndServer Sink customers 14

slide-15
SLIDE 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

slide-16
SLIDE 16

Sink Model

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

slide-17
SLIDE 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

slide-18
SLIDE 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

slide-19
SLIDE 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

slide-20
SLIDE 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