Presentation is loading. Please wait.

Presentation is loading. Please wait.

Continue the car washer example Experimental frame

Similar presentations


Presentation on theme: "Continue the car washer example Experimental frame"— Presentation transcript:

1 Continue the car washer example Experimental frame
Outline Continue the car washer example Experimental frame Chapter 7 – simple architecture

2 Expectations After This Class
Decide your project topic by Wednesday Know how DEVS works and what it can do Know how to build DEVS models and run simulation using DEVSJAVA Know how your project is going to be accomplished Your should be clear about the problem statement of your project You should be clear about the aim of your project You should have a picture of how you are going to implement your project

3 It is all about modeling
Why DEVS ? It is all about modeling Software Engineering is not only about programming Software Engineering is not only about design Software Engineering is also about specification, analysis, and verification A different level specification from UML MDA (Model Driven Architecture)

4 An carwash example Chapter 4: exercise 1 part a -- car wash
To simplify the problem, let’s first assume the car wash center only takes cars and will reject any incoming cars if it is busy Add random number to the car generator Let’s consider the truck Let’s consider the capacity of the car wash center Let’s analyze this system Add a test file – run simulation without simView

5 Processor with queue illustrating how to process a bag of inputs (multiple concurrent events) accumulate the inputs on port “in” into the queue public class procQ extends proc{ protected Queue q; public procQ(String name, double procTime ){ super(name,procTime); q = new Queue(); } public void deltext(double e, message x){ Continue(e); if (phaseIs("passive")){ for (int i=0; i< x.size(); i++) if (messageOnPort(x, "in", i)){ q.add(x.getValOnPort("in", i)); } holdIn("busy", procTime); job = (entity)q.first(); else if (phaseIs("busy")){ for (int i=0; i< x.size();i++) if (messageOnPort(x, "in", i)) { entity jb = x.getValOnPort("in", i); q.add(jb); class Queue is a container with FIFO discipline this makes sure the processed job is the one at the front public void deltint( ){ q.remove(); if(!q.isEmpty()){ job = (entity)q.first(); holdIn("busy", procTime); } else passivate(); remove the job at the front that was just finished SimpArc .procQ GenCol .Queue

6 Experimental Frame The main model of interest – carWashCenter Although a model, such as the carWashCenter, can be tested in a standalone fashion, it really does not “come to life” until it is coupled with a module capable of providing it input and observing its output. An experimental frame module is a coupled model, which when coupled to a model, generates input external events, monitor its running, and processes its outputs.

7 Experimental Frame (cont.)
The design of an experimental frame reflects the objectives one has in experimenting a model. Thus the same model may be coupled to different experimental frame modules, which observe it under different conditions. Conversely, the same experimental frame module may be employed to experiment with different models under the same conditions. Two major components of a experimental frame are generator and transducer.

8 Experimental Frame for Workflow Performance Measurement
SimpArc ef Output lines may diverge to indicate the occurrence of simultaneous events. When genr sends out a job identifier on port “out”, it goes at the same clock time, both to the “ariv” port of transd and port “out” of ef, hence eventually to some processor model. Input lines may converge, i.e., two or more source ports connected to the same destination port, can occur. Bags represent the collection of inputs that arrive simultaneously at a component. Instances of the classes genr and transd are coupled together to form the experimental frame, ef. The input port “in” of ef is for receiving solved jobs which are sent to the “solved” input port of transd via the external input coupling. There are two output ports: “out”, which transmits job identifiers sent to it by genr, and 'result which transmits the performance measures computed by transd. External output couplings bring about both these transmissions. There are two internal couplings: the output port “out” of genr sends job identifiers to the 'ariv port of transd the output port “out” of transd which couples to the 'stop input port of genr.

9 Experimental Frame in a Flat Coupled Model
SimpArc gpt gpt start start generator (genr) out processor (proc) stop in out out arrived transducer (transd) out solved

10 Experimental Frame/Model Modularity
SimpArc efp efP ef start start start out out generator (genr) processor (proc) stop in out out arrived transducer (transd) out out solved solved

11 ef Hierarchical Coupled Model efP start Processor With Queue (procQ)
SimpArc efp efP ef start start out Processor With Queue (procQ) in out out out solved

12 Multiprocessor Architecture (chapter 7)
Single Processor Multi-Server Pipeline Divide and Conquer Turn around time and throughput

13 Architecture Model proc coord Job_in Job_finished

14 Multiprocessor Architecture (chapter 7)
SimpArc in DEVSJAVA – efp.java Single Processor – proc.java Multi-Server – multiServer.java Pipeline – pipeSimple.java Divide and Conquer – DandC3.java

15 Workflow Coordinator Models
public class Coord extends proc{ public Coord(String name){ super(name,1); inports.add("setup"); inports.add("x"); outports.add("y"); public void initialize(){ passivate(); super.initialize();; } protected void add_procs(devs p){ //use devs for signature System.out.println("Default in Coord is being used"); }} Coord Atomic model I/O Behavior Description divide and conquer coordinator breaks incoming jobs into parts for processing and compiles the results into a final output pipeline coordinator routes incoming jobs through a series of processing states and outputs the results Multiserver coordinator routes incoming jobs for processing and collects the results for final output SimpArc divideCoord SimpArc pipeCoord divide Coord pipe Coord multi Server Coord SimpArc multiServerCoord

16 Workflow Architecture Models
in out x y co p0 p1 p2 Architecture SimpArc DandC3 Coupled model Divide and conquer divide and conquer coordinator with processors Pipeline pipeline coordinator with processors Multiserver multiserver coordinator with processors SimpArc pipeLine SimpArc multiServer

17 Performance of Simple Workflow Architectures
Processing Time Average Turnaround Time Maximum Throughput Simple Processor p 1/p Multiserver homogeneous p1,p2,p3 p1=p2 = p3 =p 3/thruput 1/p+1/p2+ 1/p3 3/p Pipeline p1 + p2 + p3 = p p1=p2 = p3=p/3 1/max{p1,p2,p3} Divide and Conquer p1=p2 = p3 =p/3 max{p1,p2,p3} p/3 SimpArc .proc SimpArc multiServer SimpArc pipeline SimpArc DandC3 Average turnaround time and maximum throughput as a function of processing time

18 Read chapter 7 Project Homework
Send me your project statement by Wednesday Start to exercise DEVSJAVA and build your own models


Download ppt "Continue the car washer example Experimental frame"

Similar presentations


Ads by Google