Overall Plan of Simulation and Modeling I. Chapters
|
|
- Emery Jones
- 6 years ago
- Views:
Transcription
1 Overall Plan of Simulation and Modeling I Chapters Introduction to Simulation Discrete Simulation Analytical Modeling Modeling Paradigms Input Modeling Random Number Generation Output Analysis Continuous and Hybrid Simulation Simulation Software Simulation and Modeling I Discrete Simulation 1
2 Discrete Simulation Goals understand event list processing as the core of discrete simulation use of high-level simulation environments simulation at the programming language level Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation with OMNeT++ Simulation with Syntony Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 2
3 Organization of Discrete-Event Simulation Recall: in discrete-event simulation, events occur instantaneously at separate points in time and change the state variables Two mechanisms to advance the simulated time: next-event time advance the simulation clock is always advanced to the time of the next event, the state variables are updated and future event times are determined, until termination is used by all major simulation software and by most people coding their model in a general-purpose language will be used throughout the lectures fixed-increment time advance the simulation clock is always advanced in increments of t time units useful for systems in which the time advances in fixed increments (e.g., economic systems with annual change, slotted communication systems) Simulation and Modeling I Discrete Simulation 3
4 Organization of Discrete-Event Simulation (cont.) Recall: the single-server queue (SSQ) arrival of customers customers depart from system waiting room (queue) service unit although this model seems simple compared with those usually of real interest, how it is simulated is actually quite representative we will use it for illustrations throughout this and later lectures Simulation and Modeling I Discrete Simulation 4
5 Organization of Discrete-Event Simulation (cont.) Events and times in the single-server queue t i = time of arrival of the i'th customer (i=1,2,3, ) A i = t i t i-1 = inter-arrival time between the (i-1)st and the i'th arrivals of customers (t 0 = 0) S i = time the server spends serving the i'th customer (without the customer s waiting time) W i = waiting time of the i'th customer D i = W i + S i = time in system of the i'th customer (also often called total delay or response time of the system) c i = t i + W i + S i = t i + D i = time i'th customer completes service and departs e i = time of occurrence of i'th event of any type Simulation and Modeling I Discrete Simulation 5
6 Organization of Discrete-Event Simulation (cont.) State in the single-server queue given by the number of customers in waiting room and service unit, i.e., number of customers in system at time t: N(t) in contrast, we denote by Q(t) the number of customers in the waiting room (queue length) Simulation and Modeling I Discrete Simulation 6
7 Organization of Discrete-Event Simulation (cont.) Next-event time advance the simulation clock jumps from e i to e i+1 e 0 e 1 e 2 e 3 e 4 e 5 0 t 1 t 2 c 1 t 3 c 2 Time A 1 A 2 A 3 S 1 S 2 Simulation and Modeling I Discrete Simulation 7
8 Organization of Discrete-Event Simulation (cont.) Fixed-increment time advance the simulation clock jumps t time units after clock update, a check is made whether any events have occurred during the previous interval if one or more have occurred, they are considered to occur at the end of the interval and the state is updated accordingly if two or more events have occurred in the same interval, rules are required to decide in which order they are processed this complicates matters, therefore the approach is not common 0 e 1 t 2 t e 2 e 3 3 t e Time 4 4 t Simulation and Modeling I Discrete Simulation 8
9 Organization of Discrete-Event Simulation (cont.) Typical components in DES (with next-event time approach): system state: collection of state variables necessary to describe the system at a particular time simulation clock: variable giving the current value of simulated time event list: list containing the next time when each type of event will occur statistical counters: variables used for storing statistical information about system performance initialization routine: subprogram to initialize the simulation model at time 0 timing routine: subprogram that determines the next event from the event list and then advances the simulation clock to the time when that event is to occur Simulation and Modeling I Discrete Simulation 9
10 Organization of Discrete-Event Simulation (cont.) event routine: subprogram that updates the system state when a particular type of event occurs (there is one event routine for each event type) library routines: set of subprograms used to generate random observations from probability distributions that were determined as part of the simulation model (and other statistical features) report generator: subprogram that computes estimates (from the statistical counters) of the desired measures of performance and produces a report when the simulation ends main program: subprogram that invokes the timing routine to determine the next event and then transfers control to the corresponding event routine to update the system state appropriately. The main program may also check for termination and invoke the report generator when the simulation is over Simulation and Modeling I Discrete Simulation 10
11 Organization of Discrete-Event Simulation (cont.) Flow of control Start Initialization routine Main program Timing routine 1. Set simulation clock = 0 2. Initialize system state and statistical counters 3. Initialize event list 0 0. Invoke the initialization routine 1. Invoke the timing routine 2. Invoke event routine i Repeatedly 1 i 1. Determine the next event type, say, i 2. Advance the simulation clock Event routine i 2 1. Update system state 2. Update statistical counters 3. Generate future events and add to event list, eventually remove others from the event list Library routines Generate random variates Is simulation over? No Report generator Yes 1. Compute estimates of interest 2. Write report Simulation and Modeling I Discrete Simulation 11 Stop
12 Discrete Simulation Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation with OMNeT++ Simulation with Syntony Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 12
13 Simulation of a Single-Server Queue Consider the single-server queue with the random inter-arrival times A 1, A 2,... the random service times S 1, S 2,... upon completing service of a customer, the server chooses a customer from the queue (if any) in a FIFO manner at time 0 no customers are present and the server is idle termination of simulation when n'th customer enters service Simulation and Modeling I Discrete Simulation 13
14 Simulation of a Single-Server Queue (cont.) Define 3 measures of system performance for SSQ d(n) = expected mean time in system (delay) of the first n customers q(n) = expected mean queue length until n customers have been served u(n) = expected utilization until n customers have been served = expected average proportion of time that the server is busy until n customers have been served Random characteristics of the measures on a given run of the simulation (or on a day of the real system) the observed means depend on the inter-arrival and service times on another run of the simulation (or on a different day of the real system), there would be probably different inter-arrival and service times, leading to different means thus, the means are random variables themselves we want to estimate the expected values of these random variables Simulation and Modeling I Discrete Simulation 14
15 Simulation of a Single-Server Queue (cont.) Estimation of the system time / delay / response time: from a single run of the simulation resulting in customer delays D 1, D 2, D 3,..., an obvious estimator of d(n) is dˆ 1 n n D i i= 1 ( n) = which is just the arithmetic mean of the n D i s that were observed in the simulation as a common convention, ^ (circumflex) above a symbol denotes an estimator since the average (arithmetic mean) is taken over a finite number of values (a subcase of a countable set), this measure is an example of a discrete-time statistics the expected mean waiting time is similarly estimated from W 1, W 2, Simulation and Modeling I Discrete Simulation 15
16 Simulation of a Single-Server Queue (cont.) Estimation of the queue length: average is now taken over continuous time, rather than over customers thus we get a continuous-time statistics let Q(t) be the queue length at time t (customers in the waiting room), T(n) the termination time of the simulation (service completion of n'th customer), and t = 0 be the starting point, then formally qˆ ( n) ( ) for computing it easily, let T i be the total time during the simulation that the queue is of length i, then qˆ = ( n) 1 T n = the area can be accumulated as rectangles as the simulation progresses over time T 1 T n ( n) 0 ( ) = i ( ) Q t 0 it i dt Simulation and Modeling I Discrete Simulation 16
17 Simulation of a Single-Server Queue (cont.) Q(t) for a possible realization with n = 5: Q(t) t Arrivals e 1 =0.4 e 2 =1.6 e 3 =2.1 e 7 =3.8 e 8 =4.0 e 10 =5.6 e 11 =5.8 e 12 =7.2 Departures e 4 =2.4 e 5 =3.1 e 6 =3.3 e 9 =4.9 e 13 =8.6=T (5) Simulation and Modeling I Discrete Simulation 17
18 Simulation of a Single-Server Queue (cont.) arrivals occur at times 0.4, 1.6, 2.1, 3.8, 4.0, 5.6, 5.8, 7.2 service completions occur at times 2.4, 3.1, 3.3, 4.9, 8.6 termination at T(6) = 8.6 T 0 = ( ) + ( ) + ( ) = 3.2 T 1 = ( ) + ( ) + ( ) + ( ) = 2.3 T 2 = ( ) + ( ) = 1.7 T 3 = ( ) = 1.4 T i = 0 for i > 3 test: 3 i= 0 numerator: Ti = = 8.6 = T(5) 3 i= 0 iti = = 9.9 our estimate of the average number in queue gets: ( 5) = 9.9 / qˆ = Simulation and Modeling I Discrete Simulation 18
19 Simulation of a Single-Server Queue (cont.) Estimation of the utilization define a busy function (an indicator function) B(t) = 1 0 server server is busy at time t is idle at time t then the estimate can be expressed as a continuous-time statistics, as the proportion of time B(t) is equal to 1: ( ) û n = 1 T n ( ) T ( n) 0 B(t)dt Simulation and Modeling I Discrete Simulation 19
20 Simulation of a Single-Server Queue (cont.) In the example realization we get B(t) t Arrivals Departures e 1 =0.4 e 2 =1.6 e 3 =2.1 e 4 =2.4 e 5 =3.1 e 8 =4.0 e 7 =3.8 e 6 =3.3 e 9 =4.9 e 11 =5.8 e 10 =5.6 e 12 =7.2 e 13 =8.6=T (5) ( ) + ( ) and û ( 5) = = = Simulation and Modeling I Discrete Simulation 20
21 Discrete Simulation Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation with OMNeT++ Simulation with Syntony Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 21
22 Hand Simulation of the Queue Hand simulation we step through the first steps of a simulation to illustrate the changes and data structures involved in carrying out a DES the assumed inter-arrival times are: A 1 = 0.4, A 2 = 1.2, A 3 = 0.5, A 4 = 1.7, A 5 = 0.2, A 6 = 1.6, A 7 = 0.2, A 8 = 1.4, A 9 = 1.9,... the assumed service times are: S 1 = 2.0, S 2 = 0.7, S 3 = 0.2, S 4 = 1.1, S 5 = 3.7, S 6 = 0.6,... inter-arrival times and service time are consistent with running example all time quantities are expressed in the same units, whatever one unit will be (minutes, hours,...) each figure shows the situation after the occurrence of an event, the system and the computer representation are shown in the situation after all changes have been made the status of the system is on the left side the variables of the computer representation are on the right side Simulation and Modeling I Discrete Simulation 22
23 Hand Simulation of the Queue (cont.) Initialization time = 0 idle System state 0 Clock Arrival Departure 0.4 Event list poisoning server Server status Number in queue Times of arrival of queued customers Time of last event Number served Statistical counters Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 23
24 Hand Simulation of the Queue (cont.) Arrival time = System state 0.4 Clock Arrival Departure Event list arrival time Server status Number in queue Times of arrival of queued customers Time of last event Statistical counters Number served Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 24
25 Hand Simulation of the Queue (cont.) Arrival time = System state Clock Arrival Departure Event list queued customer and his arrival time Server status Number in queue Times of arrival of queued customers Time of last event Number served Statistical counters Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 25
26 Hand Simulation of the Queue (cont.) Arrival time = System state Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Number served Statistical counters Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 26
27 Hand Simulation of the Queue (cont.) Departure time = System state Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Statistical counters Number served Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 27
28 Hand Simulation of the Queue (cont.) Departure time = System state 3.1 Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Statistical counters Number served Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 28
29 Hand Simulation of the Queue (cont.) Departure time = 3.3 idle System state 3.3 Clock Arrival Departure 3.8 Event list Server status Number in queue Times of arrival of queued customers Time of last event Statistical counters Number served Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 29
30 Hand Simulation of the Queue (cont.) Arrival time = System state 3.8 Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Statistical counters Number served Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 30
31 Hand Simulation of the Queue (cont.) Arrival time = System state Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Statistical counters Number served Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 31
32 Hand Simulation of the Queue (cont.) Departure time = System state 4.9 Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Statistical counters Number served Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 32
33 Hand Simulation of the Queue (cont.) Arrival time = System state Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Statistical counters Number served Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 33
34 Hand Simulation of the Queue (cont.) Arrival time = System state Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Number served Statistical counters Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 34
35 Hand Simulation of the Queue (cont.) Arrival time = System state Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Number served Statistical counters Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 35
36 Hand Simulation of the Queue (cont.) Departure time = System state Clock Arrival Departure Event list Server status Number in queue Times of arrival of queued customers Time of last event Number served Statistical counters Total waiting time Area under Q(t) Area under B(t) System Computer representation Simulation and Modeling I Discrete Simulation 36
37 Hand Simulation of the Queue (cont.) Compute estimates of interest from statistical counters in report routine (simulation) clock = 8.6 (simulated time at service completion of 5th customer) estimate of utilization: û(5) = [ Area under B(t) ] / clock = 7.7/8.6 = 0.9 compare with slide 20 estimate of average number in queue: ( ) qˆ 5 = [ Area under Q(t) ] / clock = 9.9/8.6 = 1.15 compare with slide 18 estimate of expected mean waiting time: ŵ(5) = [ Total waiting time ] / [ Number served ] = 5.7/5 = 1.14 not computed before estimate for expected mean system time (dˆ 5) is obtained similarly in hand simulation Simulation and Modeling I Discrete Simulation 37
38 Hand Simulation of the Queue (cont.) Remarks key element in the dynamics of a simulation is the interaction between the simulation clock and the event list while processing an event, no simulated time passes. Care must be taken to process updates of the state variables in the right order (e.g., first update the area calculators and only then the time of last event) it is sometimes easy to overlook certain updates of the state variables and counters (e.g., after a departure leaving the system empty, the server must be idled) it can happen that two (or more) entries in the event list are tied for smallest and a decision rule must be incorporated to break such time ties. The tie-breaking rule can sometimes significantly affect the result of the simulation next we turn to the use of computer software Simulation and Modeling I Discrete Simulation 38
39 Discrete Simulation Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation with OMNeT++ Simulation with Syntony Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 39
40 Simulation with AnyLogic High-level simulation environment general purpose discrete, continuous, and hybrid modeling paradigm is a variant of the Unified Modeling Language for real-time systems (RT-UML) Basic model elements active objects: model real-world objects statecharts: internal behavior of active objects ports: asynchronous message passing variables: shared variables all can be visualized Java-based textual model parts in Java executable model + simulation engine mapped on Java other Java code can be linked Simulation and Modeling I Discrete Simulation 40
41 Simulation with AnyLogic (cont.) Visualization of active objects: encapsulated object this object connector output variable (deprecated) variable reference (deprecated) port (with queue; deprecated) input variable (deprecated) port reference text box parameter variable port (without queue) statechart event dynamic event collection variable (may be used to implement port queue) Simulation and Modeling I Discrete Simulation 41
42 Simulation with AnyLogic (cont.) A statechart: [Not all items checked] /get next item start Checking do/check item /get first item [All items checked && all items available] Dispatching do/initiate delivery [All items checked && some items not in stock] aktivity Delivered Item Received [some items not in stock] transition Waiting Delivered self-transition State Simulation and Modeling I Discrete Simulation 42
43 Simulation with AnyLogic (cont.) Interpretation of statecharts states represent system states (states of object) transitions represent state changes transition label: event [guard] / action a transition may be taken if the trigger event occurs and the specified guard condition is true an action can be performed when the transition is taken all statecharts execute concurrently more details later Simulation and Modeling I Discrete Simulation 43
44 Simulation with AnyLogic (cont.) Possible events timeout: after a fixed time has elapsed (timeout may be computed according to some distribution) rate: after an exponentially distributed time has elapsed (special case) condition: when an expression becomes true message: after arrival of a message at the statechart queue; occurs, when Java object arrives at port, which is connected to statechart (via port.map(statechart)) when explicitly called from Java code (via statechart.fireevent()or statechart.receivemessage()) Underlying is discrete-event simulation simulation clock is always advanced to the time of the next event (anywhere in the model) and the event is then executed (transition is taken and the actions are performed) time ties are broken randomly Simulation and Modeling I Discrete Simulation 44
45 Simulation with AnyLogic (cont.) Single-server queue with RT-UML, conceptual: client server generate port port q (q.size()>0)/ q.removefirst() idle exp(1/9) exp(1/10)/port.send() busy 2 active objects: client and server connected via ports, with a queue at server port 2 timed events: exponentially distributed inter-arrival and service times with means equal to 10 and 9 Simulation and Modeling I Discrete Simulation 45
46 Simulation with AnyLogic (cont.) Implementation in AnyLogic: Rate Trigger 0.1 Action port.send(new Object()); On Receive Action CustomerQueue.addLast(msg); Rate Trigger Condition Trigger CustomerQueue.size()>0 Action CustomerQueue.removeFirst(); Simulation and Modeling I Discrete Simulation 46
47 Simulation with AnyLogic (cont.) Runtime view windows to inspect model execution Simulation and Modeling I Discrete Simulation 47
48 Simulation with AnyLogic (cont.) Measures for the single-server queue mean waiting time = average time messages spend in port at server mean queue length = average number of messages in port at server utilization = average portion of time the server is in state busy throughput = average number of transitions from busy to idle per time unit Implementation in AnyLogic: Simulation and Modeling I Discrete Simulation 48
49 Simulation with AnyLogic (cont.) Messages get time stamps in Client : send a Double object with current time instead of object of class Object method time() delivers value of simulation clock Rate Trigger 0.1 Action port.send(new Double(time())); Simulation and Modeling I Discrete Simulation 49
50 Simulation with AnyLogic (cont.) Statistical counters and state variables plain variables are defined as orange circles with a `V` (e.g., Throughput in class Server) collection variables (arrays or lists, three orange dots) may serve to implement queues for ports (see CustomerQueue) variables may also be defined in Additional Class Code for each class Simulation and Modeling I Discrete Simulation 50
51 Simulation with AnyLogic (cont.) Statistics generated data for measure computation can be collected in Statistics obj. here: QueueLength.update() adds current number of customers in collection variable CustomerQueue (see Value field of QueueLength) functions for basic statistics (mean, variance, etc.) are built-in (see page 47) select buttons for continuous-time statistics, like queue length or discrete-time statistics, like waiting time Simulation and Modeling I Discrete Simulation 51
52 Simulation with AnyLogic (cont.) Actions executed in Server: when message is received at port when service is started when service ends On Receive action CustomerQueue.addLast(msg) QueueLength.update(); Condition Trigger CustomerQueue.size() > 0 Action WaitingTime.add( time() CustomerQueue.removeFirst().doubleValue()); QueueLength.update(); BusyFunction.add(1, time());; Rate Trigger Action Throughput = (++CustomersServed)/time(); BusyFunction.add(0, time()); Simulation and Modeling I Discrete Simulation 52
53 Simulation with AnyLogic (cont.) Graphical output (initial plots) and statistics (at t= sec) flexible visualization of data via various types of charts (time plots, histograms, bar, stack and pie charts, etc.) usual procedure: collect data in Data Set objects connect data set to desired visualization object data is displayed during simulation run drawback: each graphic below requires two data sets (actual value and mean) in addition to Statistics objects (WaitingTime, QueueLength, BusyFunction) Simulation and Modeling I Discrete Simulation 53
54 Simulation with AnyLogic (cont.) Summary: simulation with AnyLogic modeling identify main system objects and map them on active objects identify states and actions of objects and map them on statechart states and transitions model interaction between objects by message passing (and shared variables) no care required for dealing with event handling identify measures of interest and collect relevant statistics in Statistics objects of appropriate type (basic properties like mean and variance are then available); sophisticated measures require additional Java coding graphical output and built-in statistical evaluation reveals system behavior More information exercise class practice in various assignments detailed description in AnyLogic User s Manual distributed with the tool Simulation and Modeling I Discrete Simulation 54
55 Discrete Simulation Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation with OMNeT++ Simulation with Syntony Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 55
56 Simulation with AutoMod High-level simulation environment a major commercial tool for manufacturing system simulation specialized model elements underlying discrete-event simulation Basic model elements loads: dynamic entities which are moved around queues: buffers where loads can reside (i.e., wait or are being processed) resources: needed for processing loads processes: logical control of movement and resource usage of loads, executed by loads, causes events to happen many more model elements for manufacturing systems conveyors, AGVs automated storage/retrieval systems (AS/RS) bridge cranes tanks & pipes (continuous)... Simulation and Modeling I Discrete Simulation 56
57 Simulation with AutoMod (cont.) Single-Server queue with AutoMod queue Q_waitingroom models the waiting room, infinite capacity queue Q_service models the server room, capacity = 1 resource R_server models the server load L_customer models customers exponentially distributed inter-arrival times with mean 10 min. first process: P_control process P_control models the flow of customers: begin P_control arriving move into Q_waitingroom move into Q_service use R_server for exponential 9 min send to die end Simulation and Modeling I Discrete Simulation 57
58 Simulation with AutoMod (cont.) Graphical representation Result display standard statistics about all modeling entities (queues, resources,...): current value, mean, min, max,... customized graphs (e.g., business graphics) Simulation and Modeling I Discrete Simulation 58
59 Simulation with AutoMod (cont.) Queue length of Q_waitingroom (1 day) current value averaged value Simulation and Modeling I Discrete Simulation 59
60 Simulation with AutoMod (cont.) Queue length of Q_waitingroom (1 month) current value averaged value, 5 Simulation and Modeling I Discrete Simulation 60
61 Simulation with AutoMod (cont.) Queue length of Q_waitingroom (1 year) current value averaged value, 8.1 Simulation and Modeling I Discrete Simulation 61
62 Simulation with AutoMod (cont.) Mean waiting time in Q_waitingroom (in sec) 79 min Simulation and Modeling I Discrete Simulation 62
63 Simulation with AutoMod (cont.) Utilization of Q_service: 0.9 Simulation and Modeling I Discrete Simulation 63
64 Simulation with AutoMod (cont.) More information exercise class practice in assignment tutorial: Getting Started with AutoMod with AutoMod installation, lecture Web page Simulation and Modeling I Discrete Simulation 64
65 Discrete Simulation Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation with OMNeT++ Simulation with Syntony Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 65
66 Simulation with OPNET High-level simulation environment a major commercial simulation tool for communication systems underlying discrete-event simulation libraries for all relevant networking protocols and systems Modeling similar to AnyLogic state-transition diagrams at the core, here called Finite-State Machines (FSMs) communication via packets ( messages) hierarchical structure (network, module and process level with dedicated editors: Project, Node and Process editor) Main differences for modeling the M/M/1 queue packet streams are similar to connected ports, but the FSM itself must react to a reception (in AnyLogic port actions after a reception) initial states are needed in each FSM events have to be scheduled explicitly coding in C/C++ and Proto-C (OPNET-specific kernel procedures) even simple models require various kernel procedures Simulation and Modeling I Discrete Simulation 66
67 Simulation with OPNET (cont.) Single-server queue with OPNET, conceptual: client server ARRIVAL init generate Packet init idle_and_busy Stream op_dist_exponential(10)/ op_intrpt_schedule_self() SVC_COMPLETION 2 modules (here processes) with an extended FSM each connected via a packet stream with a queue the guards ARRIVAL and SCV_COMPLETION control which transition may be taken causing specific actions (C code) ARRIVAL: get packet from stream; start service if end of idle period SVC_COMPLETION: start new service unless end of busy period Simulation and Modeling I Discrete Simulation 67
68 Simulation with OPNET (cont.) Implementation in OPNET: Project/Network level Attribute (instance of SSQ_node) Client.InterarrivalMean : 10 Server.ServiceMean : 9 Node/Module level Attribute process model : SSQ_generator InterarrivalMean : promoted Attribute process model : SSQ_service_unit ServiceMean : promoted Simulation and Modeling I Discrete Simulation 68
69 Simulation with OPNET (cont.) Process level: Finite State Machines and their initialization procedures (for state init) Simulation and Modeling I Discrete Simulation 69
70 Simulation with OPNET (cont.) Packet Generation: kernel procedures to generate packet (op_pk_create()) and send it to a packet stream (op_pk_send()) generated packets implicitly get a time stamp! kernel procedures to generate exponentially distributed interrarrival times (op_dist_exponential()) and to schedule an interrupt for the next arrival time (op_intrpt_schedule_self()) Simulation and Modeling I Discrete Simulation 70
71 Simulation with OPNET (cont.) Packet Arrival and Service: transition executives interrupt from packet stream interrupt from ended service Simulation and Modeling I Discrete Simulation 71
72 Discrete Simulation Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation with OMNeT++ Simulation with Syntony Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 72
73 Simulation with OMNeT++ Simulation tool for communication systems public-source, modular components embeddable discrete-event simulation kernel modeling frameworks for networking protocols mainly for scientific research Modeling similar to OPNET Finite-State Machines (FSMs) as C++ code, no graphical representation communication via messages hierarchical structure (network, complex and simple modules) textual representation of model structure: ned files graphical model structure editor: GNED initial states are needed in each FSM events have to be scheduled explicitly coding in C/C++ using the OMNeT++ API INET framework for internet protocols, mobility, wireless channels (loss, fading) used in a joint simulation study of our group and Siemens Industry for sensor networks in automation QoS in Communication Systems Discrete Simulation 73
74 Simulation with OMNeT++ Single-server queue with OMNeT++, conceptual: client server generate gate connector gate init exponential(10)/ scheduleat() 2 simple modules with an extended FSM for the server, no FSM for the client connected gates queue explicitly represented in model queue idle timer handlemessage() busy handlemessage() QoS in Communication Systems Discrete Simulation 74
75 Simulation with OMNeT++ model structure in ned file: simple modules simple client parameters: interarrivalmean: numeric; gates: out: out; endsimple simple module client : one parameter gate and direction simple server parameters: servicemean: numeric; gates: in: in; endsimple simple module server : one parameter gate and direction QoS in Communication Systems Discrete Simulation 75
76 Simulation with OMNeT++ model structure in ned file: module MM1 submodules: Client: client; Server: server; connections: Client.out --> Server.in; endmodule network mm1 : MM1 endnetwork complex module MM1 : submodules connection of gates network structure mm1 : one complex module MM1 graphical representation of model structure: QoS in Communication Systems Discrete Simulation 76
77 Simulation with OMNeT++ C++ implementation for the client: kernel procedures to generate packet (new cmessage()) and send it to a port (send()) generated packets implicitly get a time stamp! kernel procedures to generate exponentially distributed interrarrival times (exponential()) and to schedule an event for the next arrival time (scheduleat()) QoS in Communication Systems Discrete Simulation 77
78 Simulation with OMNeT++ C++ implementation for the server: Declaration of the FSM, timers, queues and counters Initial setup of server operation and statistics collection Recording of statistics at the end of a simulation run QoS in Communication Systems Discrete Simulation 78
79 Simulation with OMNeT++ C++ implementation for the server (cont.): Entering and exiting the IDLE state QoS in Communication Systems Discrete Simulation 79
80 Simulation with OMNeT++ C++ implementation for the server (cont.): Entering and exiting the BUSY state QoS in Communication Systems Discrete Simulation 80
81 Simulation with OMNeT++ graphical output during simulation: QoS in Communication Systems Discrete Simulation 81
82 Simulation with OMNeT++ visualization of statistics: QoS in Communication Systems Discrete Simulation 82
83 Discrete Simulation Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation with OMNeT++ Simulation with Syntony Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 83
84 Simulation with Syntony UML-based simulation environment for the network domain + general-purpose standard-compliant simulation approach allows integration into model driven design by our group in cooperation with Fraunhofer IIS Modeling paradigm composite structure diagrams for hierarchical structuring state machine diagrams for behavioral specification detailed action specification with activity diagrams or action language Casual non-functional aspects (times, randomness,...) with MARTE profile (Modeling and Analysis of Real-Time and Embedded systems) communication via signals sent over ports Syntony translates UML2 diagrams to C++ (for OMNeT++) or Java (for J-Sim) execution on simulation engines and backpropagation of measures tested for larger scenarios in inter-vehicle communication and for sensor networks in logistics QoS in Communication Systems Discrete Simulation 84
85 Simulation with Syntony Single-server queue with Syntony, conceptual: Client Server generate Connector idle client busy Completion exponential(10)/ create new client signal 2 composite structures with a state machine each connected via two ports and a connector the trigger client (arrival of a client signal) causes transition to busy state where the service is performed completion of service causes transition back to idle; next client may be served instantly QoS in Communication Systems Discrete Simulation 85
86 Simulation with Syntony UML model: Network stereotype to indicate which resources are present in the network stereotype to record utilization and throughput of server cpu QoS in Communication Systems Discrete Simulation 86
87 Simulation with Syntony UML model: Analysis stereotype indicating which model (or part of the model) should be simulated Definition of variables (and their values) that can be accessed in the model QoS in Communication Systems Discrete Simulation 87
88 Simulation with Syntony UML model: Client stereotype specifying the points in time when a new client is generated Casual statement specifying the action to be taken on transition execution: Create a new client signal (client.create()) and send it to the port called departures (sendto(departures)) QoS in Communication Systems Discrete Simulation 88
89 Simulation with Syntony UML model: Server stereotype to record queue size statistics stereotypes to handle queueing of arriving client signals at the server stereotype specifying service times demanded by clients on the server cpu stereotype to record waiting times for clients at the server QoS in Communication Systems Discrete Simulation 89
90 Simulation with Syntony User Interface: based on Eclipse control translation process, simulation parameters and evaluation analysis of model structure generated by the translator select UML model for simulation QoS in Communication Systems Discrete Simulation 90
91 Simulation with Syntony User Interface: simulation animation (OMNeT++) contents of the server module event log network view QoS in Communication Systems Discrete Simulation 91
92 Simulation with Syntony User Interface: evaluation of results Histogram of the queue length at the server of a singleserver queue select simulation results to plot set the options for the plot (name, labels, colors,...) QoS in Communication Systems Discrete Simulation 92
93 Simulation with Syntony User Interface: evaluation of results time series plot of the queue length at the server of a single-server queue select simulation results to plot set the options for the plot (name, labels, colors,...) QoS in Communication Systems Discrete Simulation 93
94 Discrete Simulation Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation with OMNeT++ Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 94
95 Simulation in Java Coding simulations in Java use of a general-purpose language we must pay attention to every detail and get a better understanding of how simulations operate sometimes necessary to code a simulation in a general-purpose language, since certain system aspects do not fit in the pre-programmed frameworks of simulation tools and languages still common to do the entire simulation this way SSJ: Stochastic Simulation in Java Java library from Paul L Ecuyer, University of Montreal primarily for DES (event-/process-oriented), also continuous and hybrid classes for simulation clock and event list processing generating random numbers collecting statistics, writing output Simulation and Modeling I Discrete Simulation 95
96 Simulation in Java (cont.) Single-Server queue with SSJ inter-arrivals and services exponentially distributed 3 event classes Arrival Departure EndOfSim event list processing event instances are inserted into event list with time of occurrence and executed when simulation clock reaches this time executing an event means invoking its actions method statistical counters Tally: discrete-time Accumulate: continuous-time Simulation and Modeling I Discrete Simulation 96
97 Simulation in Java (cont.) Beginning of the code, basic definitions: public class QueueEv { static final double meanarr = 10.0; static final double meanserv = 9.0; static final double timehorizon = ; RandMrg genarr = new RandMrg (); RandMrg genserv = new RandMrg (); List waitlist = new List ("Customers in queue"); List servlist = new List ("Customers in service"); Tally queuingd = new Tally ("Queuing delay"); Accumulate queuel = new Accumulate ("Queue length"); class Customer { double arrivtime, servtime; }... some constants 2 random number streams 2 lists: queue + service unit 2 counters: mean queuing delay, mean queue length customers with their arrival and service times Simulation and Modeling I Discrete Simulation 97
98 Simulation in Java (cont.) Construction of simulation:... public static void main (String[] args) { new QueueEv(); } public QueueEv() { Sim.init(); new EndOfSim().schedule (timehorizon); new Arrival().schedule (Rand1.expon (genarr, meanarr)); Sim.start(); }... constructor initialization schedule EndOfSim schedule Arrival start event processing Simulation and Modeling I Discrete Simulation 98
99 Simulation in Java (cont.) Flow of control when an Arrival event is executed: Simulation and Modeling I Discrete Simulation 99
100 Simulation in Java (cont.) Arrival event execution:... class Arrival extends Event { public void actions() { new Arrival().schedule (Rand1.expon (genarr, meanarr));... } Customer cust = new Customer(); cust.arrivtime = Sim.time(); cust.servtime = Rand1.expon (genserv, meanserv); if (servlist.size() > 0) { waitlist.insert (cust, List.LAST); queuel.update (waitlist.size()); } else { servlist.insert (cust, List.LAST); new Departure().schedule (cust.servtime); queuingd.update (0.0); } } schedule next arrival create new customer, set arrival time, generate service time join queue, update counter enter service, schedule Departure, update counter Simulation and Modeling I Discrete Simulation 100
101 Simulation in Java (cont.) Flow of control when a Departure event is executed: Simulation and Modeling I Discrete Simulation 101
102 Simulation in Java (cont.) Departure event execution:... class Departure extends Event { public void actions () { servlist.remove (List.FIRST); if (waitlist.size () > 0) { Customer cust = (Customer) waitlist.remove (List.FIRST); servlist.insert (cust, List.LAST); new Departure().schedule (cust.servtime); queuingd.update (Sim.time () - cust.arrivtime); queuel.update (waitlist.size ()); } } }... remove customer move customer from queue to service unit, schedule Departure, update counters Simulation and Modeling I Discrete Simulation 102
103 Simulation in Java (cont.) EndOfSim event execution:... class EndOfSim extends Event { public void actions () { queuingd.report(); queuel.report(); Sim.stop(); } } } write statistical report for the two counters stop event processing Simulation and Modeling I Discrete Simulation 103
104 Simulation in Java (cont.) Output of the program: REPORT on Tally stat. collector ==> Queuing delay min max average standard dev nb. obs REPORT on Accumulate stat. collector ==> Queue length From time To time Min Max Average Values differ from AutoMod results, 1000 minutes correspond to 16 hours only! Simulation and Modeling I Discrete Simulation 104
105 Simulation in Java (cont.) SSJ classes Sim: maintains simulation clock and event list EventList: event list, implemented as doubly linked list Event: abstract class for events, methods for scheduling and cancelling of events RandMrg: random number generators (uniform from 0 to 1) Rand1: random variate generators for various distributions Tally: discrete-time statistics Accumulate: continuous-time statistics List: lists of any type of object, implemented as doubly linked lists Details in SSJ User s Guide Simulation and Modeling I Discrete Simulation 105
106 Simulation in Java (cont.) Main parts of the Sim class: public abstract class Sim implements Runnable { public static double currenttime = 0.0; public static EventList eventlist = new DoublyLinked (); public static boolean stopped = false; simulation clock event list public static double time () {return currenttime;} returns value of simulation clock public static void init () {currenttime = 0.0; eventlist.cleanup (); stopped = false;} initialization public static void init (EventList evlist) {init(); eventlist = evlist;}... initialization with event list Simulation and Modeling I Discrete Simulation 106
107 Simulation in Java (cont.) }... public static void start () { if (eventlist.isempty ()) error ("Sim.start with empty event list"); Event ev = eventlist.removefirst(); while (ev!= null &&!stopped) { currenttime = ev.eventtime; ev.actions(); ev = eventlist.removefirst(); } } public static void stop () {stopped = true;} start event list processing get first event set sim. clock, execute event, get next event stop when start takes control (dealing with processes is omitted) Simulation and Modeling I Discrete Simulation 107
108 Simulation in Java (cont.) Main parts of the Event class: public abstract class Event implements Cloneable { protected double eventtime; time of event occurrence public static String descriptor; event type identification public Event (double delay) { if (delay >= 0.0) { eventtime = Sim.time() + delay; Sim.eventList.insert (this); } else error ("Scheduling an event in the past."); } construct + schedule event determine event time, insert in event list Simulation and Modeling I Discrete Simulation 108
109 Simulation in Java (cont.)... public void schedule (double delay) { if (delay < 0.0) error ("Scheduling an event in the past."); eventtime = Sim.time() + delay; Sim.eventList.insert (this); } schedule event public final boolean cancel (String type) { Event ev = Sim.eventList.viewFirstOfClass (type); return ev.cancel(); } remove event from event list } public final double time() {return eventtime;} public abstract void actions(); return event time method actions, invoked when event is executed Simulation and Modeling I Discrete Simulation 109
110 Simulation in Java (cont.) Summary: programming in event-oriented style 1. identify system states events measures of interest 2. implement data structures for system states (typically lists) and statistical counters, in example: lists: waitlist, servlist counters: here implicit as waitlist.size(), servlist.size() 3. write an event handling routine for each event in SSJ a class with an actions method for each event here: Arrival, Departure, EndOfSim Higher level modeling paradigm and tool environment makes modeling less tedious Simulation and Modeling I Discrete Simulation 110
111 Discrete Simulation Contents Organization of Discrete-Event Simulation (DES) Simulation of a Single-Server Queue Hand Simulation of the Queue Simulation with AnyLogic Simulation with AutoMod Simulation with OPNET Simulation in Java List Processing in Simulation Simulation and Modeling I Discrete Simulation 111
112 List Processing in Simulation In the shown queue simulation event list (objects: events, variables: time of occurrence) list of customers waiting in the queue (objects: customers, variables: arrival time, service time) General use of lists in simulations most simulations require many lists which may contain many objects, consisting of several variables often necessary to process these lists other than FIFO lists are the dominating data structures in simulation programs usual implementation: pointers and dynamic memory allocation Simulation and Modeling I Discrete Simulation 112
113 List Processing in Simulation (cont.) Doubly linked lists first object object object object last can be implemented by using pointers (links) in C, Java (or arrays in languages without dynamic data structures such as FORTRAN) each object has a link to its successor and predecessor special links to the first and the last object of the list typical operations: insert an object in the list such that the list is sorted (increasing/decreasing) according to a certain variable get an object at the i'th position of the list (get the first, get the last element) remove a certain object according to its variable or position Simulation and Modeling I Discrete Simulation 113
114 List Processing in Simulation (cont.) More sophisticated data structures for complex simulations involving a large number of events, much of the computer time required to perform the simulation can be expended on event-list processing implementing the event list as described leads to a linear search for events in it one way to improve the efficiency is to use other search techniques and the appropriate data structures for them binary search + search tree a pointer to the middle of the lists and other variants Simulation and Modeling I Discrete Simulation 114
Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic
Exercise Unit 2: Modeling Paradigms - RT-UML UML: The Unified Modeling Language Statecharts RT-UML in AnyLogic Simulation and Modeling I Modeling with RT-UML 1 RT-UML: UML Unified Modeling Language a mix
More informationSIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM
SIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM Will show how to simulate a specific version of the single-server queuing system Though simple, it contains many features found in all simulation models 1-
More informationCPSC 531: System Modeling and Simulation. Carey Williamson Department of Computer Science University of Calgary Fall 2017
CPSC 531: System Modeling and Simulation Carey Williamson Department of Computer Science University of Calgary Fall 2017 Recap: Simulation Model Taxonomy 2 Recap: DES Model Development How to develop a
More informationBISS 2013: Simulation for Decision Support
BISS 2013: Simulation for Decision Support Lecture 18 Discrete Event Modelling and Simulation in AnyLogic (Practice) Peer-Olaf Siebers (Nottingham University) Stephan Onggo (Lancaster University) pos@cs.nott.ac.uk
More informationSSJ. A Java Library for Stochastic Simulation. User s Guide. Version: February 3, 2001
SSJ A Java Library for Stochastic Simulation User s Guide Version: February 3, 2001 Pierre L Ecuyer 1 Département d Informatique et de Recherche Opérationnelle Université de Montréal SSJ (an acronymn for
More informationGeneral Simulation Principles
1 / 24 General Simulation Principles Christos Alexopoulos and Dave Goldsman Georgia Institute of Technology, Atlanta, GA, USA 10/16/17 2 / 24 Outline 1 Steps in a Simulation Study 2 Some Definitions 3
More informationNumerical approach estimate
Simulation Nature of simulation Numericalapproachfor investigating models of systems. Data are gathered to estimatethe true characteristics of the model. Garbage in garbage out! One of the techniques of
More informationChapter 3 General Principles. Banks, Carson, Nelson & Nicol Discrete-Event System Simulation
Chapter 3 General Principles Banks, Carson, Nelson & Nicol Discrete-Event System Simulation Purpose Develops a common framework for the modeling of complex systems. Covers the basic blocks for all discrete-event
More informationPerformance Evaluation
Performance Evaluation Chapter 4 A Complicated Queuing System (Acknowledgement: These slides have been prepared by Prof. Dr. Holger Karl) 1 Goal of this chapter! Understand implementation issues and solutions
More informationSSJ User s Guide. Package simevents Simulation Clock and Event List Management
SSJ User s Guide Package simevents Simulation Clock and Event List Management Version: December 21, 2006 This package provides the simulation clock and tools to manage the future events list. These are
More informationSimulation Models for Manufacturing Systems
MFE4008 Manufacturing Systems Modelling and Control Models for Manufacturing Systems Dr Ing. Conrad Pace 1 Manufacturing System Models Models as any other model aim to achieve a platform for analysis and
More informationRicardo Rocha. Department of Computer Science Faculty of Sciences University of Porto
Ricardo Rocha Department of Computer Science Faculty of Sciences University of Porto Slides based on the book Operating System Concepts, 9th Edition, Abraham Silberschatz, Peter B. Galvin and Greg Gagne,
More informationPetri Nets. Petri Nets. Petri Net Example. Systems are specified as a directed bipartite graph. The two kinds of nodes in the graph:
System Design&Methodologies Fö - 1 System Design&Methodologies Fö - 2 Petri Nets 1. Basic Petri Net Model 2. Properties and Analysis of Petri Nets 3. Extended Petri Net Models Petri Nets Systems are specified
More informationSSJ User s Guide. Package simevents Simulation Clock and Event List Management
SSJ User s Guide Package simevents Simulation Clock and Event List Management Version: June 18, 2014 This package provides the simulation clock and tools to manage the future events list. These are the
More informationSSJ: A FRAMEWORK FOR STOCHASTIC SIMULATION IN JAVA. Pierre L Ecuyer, Lakhdar Meliani, and Jean Vaucher
Proceedings of the 2002 Winter Simulation Conference E. Yücesan, C.-H. Chen, J. L. Snowdon, and J. M. Charnes, eds. SSJ: A FRAMEWORK FOR STOCHASTIC SIMULATION IN JAVA Pierre L Ecuyer, Lakhdar Meliani,
More informationProcess- Concept &Process Scheduling OPERATING SYSTEMS
OPERATING SYSTEMS Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne PROCESS MANAGEMENT Current day computer systems allow multiple
More informationCourse: Operating Systems Instructor: M Umair. M Umair
Course: Operating Systems Instructor: M Umair Process The Process A process is a program in execution. A program is a passive entity, such as a file containing a list of instructions stored on disk (often
More informationCS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017
CS 471 Operating Systems Yue Cheng George Mason University Fall 2017 Outline o Process concept o Process creation o Process states and scheduling o Preemption and context switch o Inter-process communication
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 Lecture 8 Threads and Scheduling Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ How many threads
More informationCPS221 Lecture: Threads
Objectives CPS221 Lecture: Threads 1. To introduce threads in the context of processes 2. To introduce UML Activity Diagrams last revised 9/5/12 Materials: 1. Diagram showing state of memory for a process
More informationModeling and Simulation (An Introduction)
Modeling and Simulation (An Introduction) 1 The Nature of Simulation Conceptions Application areas Impediments 2 Conceptions Simulation course is about techniques for using computers to imitate or simulate
More informationChapter 6: CPU Scheduling. Operating System Concepts 9 th Edition
Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time
More informationLecture Transcript While and Do While Statements in C++
Lecture Transcript While and Do While Statements in C++ Hello and welcome back. In this lecture we are going to look at the while and do...while iteration statements in C++. Here is a quick recap of some
More informationSWE 760 Lecture 1: Introduction to Analysis & Design of Real-Time Embedded Systems
SWE 760 Lecture 1: Introduction to Analysis & Design of Real-Time Embedded Systems Hassan Gomaa References: H. Gomaa, Chapters 1, 2, 3 - Real-Time Software Design for Embedded Systems, Cambridge University
More informationSimulation. Faking reality: How? 1) Pretending the causes 2) Faking the effects 3) Trying to obtain the same output (red card)
Simulation Faking reality: How? 1) Pretending the causes 2) Faking the effects 3) Trying to obtain the same output (red card) 1 Observing reality Modeling Implementation Scenario Creation Overview 2 2
More informationOPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:
OPERATING SYSTEMS UNIT II Sections A, B & D PREPARED BY ANIL KUMAR PRATHIPATI, ASST. PROF., DEPARTMENT OF CSE. PROCESS CONCEPT An operating system executes a variety of programs: Batch system jobs Time-shared
More informationCHAPTER 2: PROCESS MANAGEMENT
1 CHAPTER 2: PROCESS MANAGEMENT Slides by: Ms. Shree Jaswal TOPICS TO BE COVERED Process description: Process, Process States, Process Control Block (PCB), Threads, Thread management. Process Scheduling:
More informationReal-Time Component Software. slide credits: H. Kopetz, P. Puschner
Real-Time Component Software slide credits: H. Kopetz, P. Puschner Overview OS services Task Structure Task Interaction Input/Output Error Detection 2 Operating System and Middleware Application Software
More informationIntroduction to Omnet++
Introduction to Omnet++ Paolo Giaccone paolo.giaccone@polito.it TLC Network Group - Politecnico di Torino 1 Copyright Quest opera è protetta dalla licenza Creative Commons NoDerivs-NonCommercial. Per vedere
More informationCS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University
Frequently asked questions from the previous class survey CS 370: SYSTEM ARCHITECTURE & SOFTWARE [CPU SCHEDULING] Shrideep Pallickara Computer Science Colorado State University OpenMP compiler directives
More informationOSEK/VDX. Communication. Version January 29, 2003
Open Systems and the Corresponding Interfaces for Automotive Electronics OSEK/VDX Communication Version 3.0.1 January 29, 2003 This document is an official release and replaces all previously distributed
More informationCS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010
CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011 Lectures 1-22 Moaaz Siddiq Asad Ali Latest Mcqs MIDTERM EXAMINATION Spring 2010 Question No: 1 ( Marks: 1 ) - Please
More informationMODEL-BASED DEVELOPMENT -TUTORIAL
MODEL-BASED DEVELOPMENT -TUTORIAL 1 Objectives To get familiar with the fundamentals of Rational Rhapsody. You start with the simplest example possible. You end with more complex functionality, and a more
More informationIntroduction to OMNeT++
Introduction to OMNeT++ Acknowledgment The source material for this presentation was borrowed from the OMNeT++ User Manual Version 4.1 What is OMNeT++ OMNeT++ is an object-oriented modular discrete event
More informationProcesses and Threads
TDDI04 Concurrent Programming, Operating Systems, and Real-time Operating Systems Processes and Threads [SGG7] Chapters 3 and 4 Copyright Notice: The lecture notes are mainly based on Silberschatz s, Galvin
More informationiscrete-event System Simulation of Queues with Spreadsheets Combined with Simple VBA Code: A Teaching Case
Nithipat Kamolsuk D iscrete-event System Simulation of Queues with Spreadsheets Combined with Simple VBA Code: A Teaching Case Chairperson, Department of General Science Faculty of Engineering and Technology
More informationProcesses and Threads
OPERATING SYSTEMS CS3502 Spring 2018 Processes and Threads (Chapter 2) Processes Two important types of dynamic entities in a computer system are processes and threads. Dynamic entities only exist at execution
More informationChapter 3 Processes. Process Concept. Process Concept. Process Concept (Cont.) Process Concept (Cont.) Process Concept (Cont.)
Process Concept Chapter 3 Processes Computers can do several activities at a time Executing user programs, reading from disks writing to a printer, etc. In multiprogramming: CPU switches from program to
More informationLecture 2 Process Management
Lecture 2 Process Management Process Concept An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks The terms job and process may be interchangeable
More informationA Case Study. Objective
A Case Study Dr. Xiao Qin New Mexico Tech http://www.cs.nmt.edu/~xqin xqin@cs.nmt.edu Fall, 2006 These slides are adapted from notes by Dr. Anirban Mahanti (U. of Calgary) CS589-6, New Mexico Tech 1 Objective
More informationFrequently asked questions from the previous class survey
CS 370: OPERATING SYSTEMS [CPU SCHEDULING] Shrideep Pallickara Computer Science Colorado State University L14.1 Frequently asked questions from the previous class survey Turnstiles: Queue for threads blocked
More informationCHAPTER 5 GENERATING TEST SCENARIOS AND TEST CASES FROM AN EVENT-FLOW MODEL
CHAPTER 5 GENERATING TEST SCENARIOS AND TEST CASES FROM AN EVENT-FLOW MODEL 5.1 INTRODUCTION The survey presented in Chapter 1 has shown that Model based testing approach for automatic generation of test
More informationLecture: Simulation. of Manufacturing Systems. Sivakumar AI. Simulation. SMA6304 M2 ---Factory Planning and scheduling. Simulation - A Predictive Tool
SMA6304 M2 ---Factory Planning and scheduling Lecture Discrete Event of Manufacturing Systems Simulation Sivakumar AI Lecture: 12 copyright 2002 Sivakumar 1 Simulation Simulation - A Predictive Tool Next
More informationPerformance Evaluation of Scheduling Mechanisms for Broadband Networks
Performance Evaluation of Scheduling Mechanisms for Broadband Networks Gayathri Chandrasekaran Master s Thesis Defense The University of Kansas 07.31.2003 Committee: Dr. David W. Petr (Chair) Dr. Joseph
More informationCOSC 243. Data Representation 3. Lecture 3 - Data Representation 3 1. COSC 243 (Computer Architecture)
COSC 243 Data Representation 3 Lecture 3 - Data Representation 3 1 Data Representation Test Material Lectures 1, 2, and 3 Tutorials 1b, 2a, and 2b During Tutorial a Next Week 12 th and 13 th March If you
More informationGeneral Objectives: To understand the process management in operating system. Specific Objectives: At the end of the unit you should be able to:
F2007/Unit5/1 UNIT 5 OBJECTIVES General Objectives: To understand the process management in operating system Specific Objectives: At the end of the unit you should be able to: define program, process and
More informationIntroduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras
Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Week 05 Lecture 18 CPU Scheduling Hello. In this lecture, we
More informationIntroduction to Electronic Design Automation. Model of Computation. Model of Computation. Model of Computation
Introduction to Electronic Design Automation Model of Computation Jie-Hong Roland Jiang 江介宏 Department of Electrical Engineering National Taiwan University Spring 03 Model of Computation In system design,
More informationAC OB S. Multi-threaded FW framework (OS) for embedded ARM systems Torsten Jaekel, June 2014
AC OB S Multi-threaded FW framework (OS) for embedded ARM systems Torsten Jaekel, June 2014 ACOBS ACtive OBject (operating) System Simplified FW System for Multi-Threading on ARM embedded systems ACOBS
More information8th Slide Set Operating Systems
Prof. Dr. Christian Baun 8th Slide Set Operating Systems Frankfurt University of Applied Sciences SS2016 1/56 8th Slide Set Operating Systems Prof. Dr. Christian Baun Frankfurt University of Applied Sciences
More informationUnified Modeling Language 2
Unified Modeling Language 2 State machines 109 History and predecessors 1950 s: Finite State Machines Huffmann, Mealy, Moore 1987: Harel Statecharts conditions hierarchical (and/or) states history states
More informationThe control of I/O devices is a major concern for OS designers
Lecture Overview I/O devices I/O hardware Interrupts Direct memory access Device dimensions Device drivers Kernel I/O subsystem Operating Systems - June 26, 2001 I/O Device Issues The control of I/O devices
More informationShort Notes of CS201
#includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system
More informationChapter 6 Communication Mechanisms
Chapter 6 Communication Mechanisms 395-Comec 396-Comec Modeling Concepts Modeling Concepts Introduction Comec.1 Introduction Most OPNET models can be classified as distributed systems composed of multiple
More informationDynamic Modeling - Finite State Machines
Dynamic Modeling - Finite State Machines SWE 321 Fall 2014 Rob Pettit 1 Finite State Machines Finite number of states Only in one state at a time Transition Change of state Caused by event Transition to
More informationStatecharts 1.- INTRODUCTION 1.- INTRODUCTION
Statecharts INDEX 1.- Introduction 2.- When to use Statecharts 3.- Basic components 4.- Connectors and compound transitions Mª Ángeles Martínez Ibáñez University of Bergen Selected topics in programming
More informationREAL-TIME MULTITASKING KERNEL FOR IBM-BASED MICROCOMPUTERS
Malaysian Journal of Computer Science, Vol. 9 No. 1, June 1996, pp. 12-17 REAL-TIME MULTITASKING KERNEL FOR IBM-BASED MICROCOMPUTERS Mohammed Samaka School of Computer Science Universiti Sains Malaysia
More informationREVIEW OF COMMONLY USED DATA STRUCTURES IN OS
REVIEW OF COMMONLY USED DATA STRUCTURES IN OS NEEDS FOR EFFICIENT DATA STRUCTURE Storage complexity & Computation complexity matter Consider the problem of scheduling tasks according to their priority
More informationCS201 - Introduction to Programming Glossary By
CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with
More informationUML for Real-Time Overview
Abstract UML for Real-Time Overview Andrew Lyons April 1998 This paper explains how the Unified Modeling Language (UML), and powerful modeling constructs originally developed for the modeling of complex
More informationChapter -5 QUALITY OF SERVICE (QOS) PLATFORM DESIGN FOR REAL TIME MULTIMEDIA APPLICATIONS
Chapter -5 QUALITY OF SERVICE (QOS) PLATFORM DESIGN FOR REAL TIME MULTIMEDIA APPLICATIONS Chapter 5 QUALITY OF SERVICE (QOS) PLATFORM DESIGN FOR REAL TIME MULTIMEDIA APPLICATIONS 5.1 Introduction For successful
More informationMultiprogramming. Evolution of OS. Today. Comp 104: Operating Systems Concepts 28/01/2013. Processes Management Scheduling & Resource Allocation
Comp 104: Operating Systems Concepts Management Scheduling & Resource Allocation Today OS evolution Introduction to processes OS structure 1 2 Evolution of OS Largely driven by desire to do something useful
More informationModeling Complex Systems Using SimEvents. Giovanni Mancini SimEvents Product Marketing Manager The MathWorks 2006 The MathWorks, Inc.
Modeling Complex Systems Using SimEvents Giovanni Mancini SimEvents Product Marketing Manager The MathWorks 2006 The MathWorks, Inc. Topics Discrete Event Simulation SimEvents Components System Example
More informationSimulation Software: Omnet++ GTNetS GlomoSim / QualNet
Simulation Software: Omnet++ GTNetS GlomoSim / QualNet Holger Füßler Holger Füßler Course overview 1. Introduction 7. NS-2: Fixed networks 2. Building block: RNG 8. NS-2: Wireless networks 3. Building
More informationby I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS
by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests
More informationActivities Radovan Cervenka
Unified Modeling Language Activities Radovan Cervenka Activity Model Specification of an algorithmic behavior. Used to represent control flow and object flow models. Executing activity (of on object) is
More informationCourse Syllabus. Operating Systems
Course Syllabus. Introduction - History; Views; Concepts; Structure 2. Process Management - Processes; State + Resources; Threads; Unix implementation of Processes 3. Scheduling Paradigms; Unix; Modeling
More informationPrinciples of Operating Systems
Principles of Operating Systems Lecture 21-23 - Virtual Memory Ardalan Amiri Sani (ardalan@uci.edu) [lecture slides contains some content adapted from previous slides by Prof. Nalini Venkatasubramanian,
More informationA Predictable RTOS. Mantis Cheng Department of Computer Science University of Victoria
A Predictable RTOS Mantis Cheng Department of Computer Science University of Victoria Outline I. Analysis of Timeliness Requirements II. Analysis of IO Requirements III. Time in Scheduling IV. IO in Scheduling
More informationPromela and SPIN. Mads Dam Dept. Microelectronics and Information Technology Royal Institute of Technology, KTH. Promela and SPIN
Promela and SPIN Mads Dam Dept. Microelectronics and Information Technology Royal Institute of Technology, KTH Promela and SPIN Promela (Protocol Meta Language): Language for modelling discrete, event-driven
More informationAGENT-BASED MODELING BOOTCAMP FOR HEALTH RESEARCHERS AUGUST 2012 A SIMPLE NETWORK-BASED INFECTION SPREAD AGENT-BASED MODEL
Rating: Basic Prerequisites: Building a Minimalist Network-Based Model Framework Estimated Time Required: 1 hour This exercise rehearses basic steps that can be used to create a model of infection spread..
More informationProcesses and More. CSCI 315 Operating Systems Design Department of Computer Science
Processes and More CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating Systems Concepts,
More informationA DEVS LIBRARY FOR LAYERED QUEUING NETWORKS
A DEVS LIBRARY FOR LAYERED QUEUING NETWORKS Dorin B. Petriu and Gabriel Wainer Department of Systems and Computer Engineering Carleton University, 1125 Colonel By Drive Ottawa, Ontario K1S 5B6, Canada.
More informationInput/Output Systems
Input/Output Systems CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those from an earlier edition of the course text Operating
More informationChapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin
Chapter 10 Object-Oriented Analysis and Modeling Using the UML McGraw-Hill/Irwin Copyright 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Objectives 10-2 Define object modeling and explain
More informationLecture 21. Reminders: Homework 6 due today, Programming Project 4 due on Thursday Questions? Current event: BGP router glitch on Nov.
Lecture 21 Reminders: Homework 6 due today, Programming Project 4 due on Thursday Questions? Current event: BGP router glitch on Nov. 7 http://money.cnn.com/2011/11/07/technology/juniper_internet_outage/
More informationChapter 13: I/O Systems
Chapter 13: I/O Systems Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance 13.2 Silberschatz, Galvin
More informationRoadmap. Tevfik Ko!ar. CSC Operating Systems Fall Lecture - III Processes. Louisiana State University. Processes. September 1 st, 2009
CSC 4103 - Operating Systems Fall 2009 Lecture - III Processes Tevfik Ko!ar Louisiana State University September 1 st, 2009 1 Roadmap Processes Basic Concepts Process Creation Process Termination Context
More informationFaculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology
Faculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology exam Embedded Software TI2726-B January 29, 2018 13.30-15.00 This exam (6 pages) consists of 60 True/False
More informationProtocol Specification. Using Finite State Machines
Protocol Specification Using Finite State Machines Introduction Specification Phase of Protocol Design allows the designer to prepare an abstract model of the protocol for testing and analysis. Finite
More informationOperating Systems 2010/2011
Operating Systems 2010/2011 Input/Output Systems part 1 (ch13) Shudong Chen 1 Objectives Discuss the principles of I/O hardware and its complexity Explore the structure of an operating system s I/O subsystem
More informationCPU scheduling. Alternating sequence of CPU and I/O bursts. P a g e 31
CPU scheduling CPU scheduling is the basis of multiprogrammed operating systems. By switching the CPU among processes, the operating system can make the computer more productive. In a single-processor
More informationWhat s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable
What s An OS? Provides environment for executing programs Process abstraction for multitasking/concurrency scheduling Hardware abstraction layer (device drivers) File systems Communication Do we need an
More informationSimulative Evaluation of Internet Protocol Functions
Simulative Evaluation of Internet Protocol Functions Introduction Course Objectives & Introduction Performance Evaluation & Simulation A Manual Simulation Example Resources http://www.tu-ilmenau.de/fakia/simpro.html
More informationOverview of the Simulation Process. CS1538: Introduction to Simulations
Overview of the Simulation Process CS1538: Introduction to Simulations Simulation Fundamentals A computer simulation is a computer program that models the behavior of a physical system over time. Program
More information[08] IO SUBSYSTEM 1. 1
[08] IO SUBSYSTEM 1. 1 OUTLINE Input/Output (IO) Hardware Device Classes OS Interfaces Performing IO Polled Mode Interrupt Driven Blocking vs Non-blocking Handling IO Buffering & Strategies Other Issues
More informationUML-based framework for simulation of distributed ECU systems in automotive applications
UML-based framework for simulation of distributed ECU systems in automotive applications Frank Steinert protime GmbH Prien Germany A UML based framework for the simulation of distributed systems of embedded
More informationIndustrial Engineering Department
Industrial Engineering Department Engineering Faculty Hasanuddin University INDUSTRIAL SYSTEMS SIMULATION ARENA BASIC The Basic Process Panel This SECTION describes the flowchart and data modules that
More informationState Machine Specification Directly in Java and C++ Alexander Sakharov
State Machine Specification Directly in Java and C++ Alexander Sakharov 1 Problem Statement Finite state machines (FSM) have become a standard model for representing object behavior. UML incorporates FSM
More informationIT 540 Operating Systems ECE519 Advanced Operating Systems
IT 540 Operating Systems ECE519 Advanced Operating Systems Prof. Dr. Hasan Hüseyin BALIK (3 rd Week) (Advanced) Operating Systems 3. Process Description and Control 3. Outline What Is a Process? Process
More informationObject Oriented Modeling
Object Oriented Modeling Object oriented modeling is a method that models the characteristics of real or abstract objects from application domain using classes and objects. Objects Software objects are
More informationOperating Systemss and Multicore Programming (1DT089)
Operating Systemss and Multicore Programming (1DT089) Introduction to Operating Systemss (Chapter 1) Wednesday january 23 Uppsala University 2013 karl.marklund@it.uu.se Chapter 1: Introduction Chapter
More informationNext-Event Simulation
Next-Event Simulation Lawrence M. Leemis and Stephen K. Park, Discrete-Event Simulation - A First Course, Prentice Hall, 2006 Hui Chen Computer Science Virginia State University Petersburg, Virginia March
More informationDOWNLOAD PDF LINKED LIST PROGRAMS IN DATA STRUCTURE
Chapter 1 : What is an application of linear linked list data structures? - Quora A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements
More information1 PROCESSES PROCESS CONCEPT The Process Process State Process Control Block 5
Process Management A process can be thought of as a program in execution. A process will need certain resources such as CPU time, memory, files, and I/O devices to accomplish its task. These resources
More informationExam TI2720-C/TI2725-C Embedded Software
Exam TI2720-C/TI2725-C Embedded Software Wednesday April 16 2014 (18.30-21.30) Koen Langendoen In order to avoid misunderstanding on the syntactical correctness of code fragments in this examination, we
More informationSMD149 - Operating Systems
SMD149 - Operating Systems Roland Parviainen November 3, 2005 1 / 45 Outline Overview 2 / 45 Process (tasks) are necessary for concurrency Instance of a program in execution Next invocation of the program
More informationCS 3733 Operating Systems
What will be covered in MidtermI? CS 3733 Operating Systems Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio Basics of C programming language Processes, program
More informationSoftware Service Engineering
Software Service Engineering Lecture 4: Unified Modeling Language Doctor Guangyu Gao Some contents and notes selected from Fowler, M. UML Distilled, 3rd edition. Addison-Wesley Unified Modeling Language
More informationFollowing are a few basic questions that cover the essentials of OS:
Operating Systems Following are a few basic questions that cover the essentials of OS: 1. Explain the concept of Reentrancy. It is a useful, memory-saving technique for multiprogrammed timesharing systems.
More information