Вы находитесь на странице: 1из 6

Modelling and Simulation System is defined as a group of objects that are joined together in some regular interaction or interdependence

toward the accomplishment of some purpose. System Environment: changes occurring outside the system. The decision on the boundary between the system and its environment may depend on the purpose of the study. Components of a system: Entity: an object of interest in the system. Attribute: a property of an entity. Activity: a time period of specified length. State: the collection of variables necessary to describe the system at any time, relative to the objectives of the study. Event: an instantaneous occurrence that may change the state of the system. Endogenous: to describe activities and events occurring within a system. Exogenous: to describe activities and events in an environment that affects the system.

Discrete and Continuous System: Systems can be categorized as discrete or continuous. Bank: a discrete system The head of water behind a dam: a continuous system

Model of a system: a representation of a system for the purpose of studying the system a simplification of the system sufficiently detailed to permit valid conclusions to be drawn about the real system

Types of models: Static or Dynamic Simulation Models Static simulation model (called Monte Carlo simulation) represents a system at a particular point in time. Dynamic simulation model represents systems as they change over time Deterministic or Stochastic Simulation Models Deterministic simulation models contain no random variables and have a known set of inputs which will result in a unique set of outputs Stochastic simulation model has one or more random variables as inputs. Random inputs lead to random outputs. The model of interest in this class is discrete, dynamic, and stochastic. Steps in Simulation Study:

Problem formulation Policy maker/Analyst understands and agrees with the formulation. Setting of objectives and overall project plan Model conceptualization The art of modeling is enhanced by an ability to abstract the essential features of a problem, to select and modify basic assumptions that characterize the system, and then to enrich and elaborate the model until a useful approximation results.

Data collection As the complexity of the model changes, the required data elements may also change. Model translation GPSS/HTM or special-purpose simulation software Verified? Is the computer program performing properly? Debugging for correct input parameters and logical structure Validated? It is a determination that a model is an accurate representation of the real system. Validation is achieved through the calibration of the model Experimental design It is a decision on the length of the initialization period, the length of simulation runs, and the number of replications to be made of each run. Production runs and analysis To estimate measures of performances More runs? Documentation and reporting Program documentation: for the relationships between input parameters and output measures of performance, and for a modification Progress documentation: the history of a simulation, a chronology of work done and decision made. Implementation Four phases according to Figure 1.3 First phase : a period of discovery or orientation (step 1, step2) Second phase : a model building and data collection (step 3, step 4, step 5, step 6, step 7) Third phase : running the model (step 8, step 9, step 10) Fourth phase : an implementation (step 11, step 12) Single Server Queue: A system with just one server where the customers (jobs) arrive according to a Poisson process (with rate ). If the server is free at that moment, the customer enters the service or else joins the waiting queue. When the server completes serving a customer, the next customer waiting in line enters the service (the customer who has waited the longest the first in/first out rule). If there are no waiting customers, the server remains free until the next customers arrival. The amount of time taken by server to complete service for a customer is a random variable with probability distribution G (for M/M/1 queues, G = exponential dist. function). All the service times are independent of each other. Assume that after a fixed time T, no customers are allowed to enter the system, although the server completes servicing all those that are already in the system at time T. Performance parameters: 1. The average time a customer spends in the system (W). 2. The average time past T that the last customer departs the average time at which the server finally becomes idle. Simulation variables Time variables : t (current time) Counter variables : NA the # of arrivals by time t; ND the # of departures by time t. System state variables : n the # of customers in the system at time t. Event-list: EL = tA, tD. tA is the time of next arrival (after t) and tD is the service completion time of customer presently being served. If there is no customer presently being served, then tD is set equal to infinity. The output variables that will be collected are:

A(i) the arrival time of customer i; D(i) the departure time of customer i; and Tp -- the time past T that the last customer departs. Initialize: Set t = 0, NA = 0, ND = 0. Set SS = 0. Generate T0, and set tA = T0, tD = . To update the system, we move along the time axis until we encounter the next event. The next event is decided by comparing tA and tD, and choosing the smaller value. Every time a customer starts service at the server, we generate a random variable Y with a distribution G to obtain the service time for that customer and use it to obtain tD t = time variable; SS = n; EL = tA, tD. Case I: Reset t = tA (we move along to time tA). Reset NA = NA + 1 (since there is a new arrival at time tA) Reset n = n + 1 (because there is one more customer in the system). Generate Tt. And reset tA = Tt (this is the time for next arrival). If n = 1, generate Y and reset tD = t + Y (because the system had been empty and so we need to generate the service time of the new customer). Collect output data A(NA) = t (because customer NA arrived at time t). Case II: Reset t = tD (we move along to time tD). Reset ND = ND + 1 (since there is a departure at time tD) Reset n = n - 1 (one customer is left the system). If n = 0, reset tD = ; otherwise generate Y and reset tD = t + Y . Collect output data D(ND) = t (because customer ND departed at time t). Case III: min (tA, tD) > T; n > 0. Reset t = tD. Reset ND = ND + 1. Reset n = n - 1. If n > 0, generate Y and reset tD = t + Y . Collect output data D(ND) = t. Case IV: min (tA, tD) > T; n = 0. Collect output data Tp = max (t - T, 0). Two Server Queue: Two-server system in which customers arrive according to a Poisson process. Suppose that each arrival must first be served by server 1 and upon completion of service at 1, the customer goes over to server 2. This system is called tandem or sequential queuing system. Upon arrival the customer will either enter service with server 1 if that server is free, or join the queue for server 1 otherwise. Tandem Queues: When the customer completes the service at server 1, then (s/)he either enters the service with server 2 if that server is free, or else it joins its queue. After being served at server 2 the customer departs the system. The service times at server i have distribution Gi, i = 1, 2. We are interested in the distribution of time that a customer spends at both servers. That is, W and WQ at server 1 and server 2. List of variables Time variable: t System state (SS) variable: (n1, n2) where ni is the number of customers at server i.

Counter variables: NA the # of arrivals by time t; ND the # of departures by time t. Output variables: A1(i) the arrival time of customer i; A2(i) the arrival time of customer i at server 2; D(i) the departure time of customer i; Event list: tA, t1, t2 where tA is the time of next arrival; ti is the service completion time of customer presently being served by server i, (i = 1, 2). If there are no customer presently at server i, then ti = , (i = 1, 2). The event list always consists of these three variables: tA, t1, t2 Initialize Set t = 0, NA = 0, ND = 0. Set SS = 0. Generate T0, and set tA = T0, t1 = , t2 = . As always, we move along the time axis until we reach the time for the next event. Depending on what this next event is, we consider different cases. As we did previously, let Yi refer to a random variable having distribution Gi, i = 1, 2, which will be used to calculate t1, t2. Case I: tA = min{tA, t1, t2} Reset t = tA, Reset NA = NA + 1 (since there is a new arrival at time tA) Reset n1 = n1 + 1 (because there is one more customer in the system and that customer is with server 1). Generate Tt , and reset tA = Tt (this is the time for next arrival). If n1 = 1, generate Y1 and reset t1 = t + Y1. Collect output data A1(NA) = t (because customer NA arrived at time t at server 1). Case II: t1 < tA, t1 <= t2. Reset t = t1. Reset n1 = n1 1; n2 = n2 + 1. If n1 = 0, reset t1 = ; otherwise generate Y1 and reset t1 = t + Y1. If n2 = 1, generate Y2, and reset t2 = t + Y2. Collect the output data A2(NA n1) = t. Case III: t2 < tA, t2 < t1. Reset t = t2. Reset ND = ND + 1. Reset n2 = n2 1. If n2 = 0, reset t2 = ; otherwise generate Y2, and reset t2 = t + Y2. Collect the output data D(ND) = t. Inventory System A retailer has to decide inventory for a specialty product which he sells at a rate of Rs. r per piece. Customers for this product come to the retailer at a Poisson rate of . And demand from each of these customers is also random with a probability distribution G. In order to meet this demand, the retailer needs to have enough inventory. However, just enough! Let at any given time, the inventory level be x pieces. Accordingly, the retailer decides whether to place an order to the supplier or not. Suppose that the retailer decides to follow a (s, S) inventory policy. What is (s, S) policy? Cost of ordering y pieces from supplier costs Rs. c(y); and it takes L time periods for the order to reach the retailer.

Additionally, the retailer has to pay Rs. h per piece per unit time to the warehouse where this product is stored. If a customer orders more than what is there in the inventory, then the amount on hand is sold and rest is lost. As against? We want to estimate, using simulation, the retailers profit over a finite time horizon of T time units. List of variables Time variable: t System State variable: (x, y) where x is the amount of inventory on hand, and y is the amount on order. Counter variables: C, the total amount of ordering cost by time t; H, the total amount of inventory holding costs by t; R, the total amount of revenue earned by time t; Event list: Consists of either a customer or order arriving. Let the times for these events be t0, the arrival time of the next customer; t1, the time at which the order being filled will be delivered. If there is no outstanding order then we can take the value of t1 to be . Updating the system is done by considering the event that takes place earlier. We are presently at time t Case I: t0 < t1 Reset H = H + (t0 t)xh. (Since between time t and t0 we incur a holding cost.) Reset t = t0. Generate D, a random variable having distribution G. D is the demand of the customer that arrived at time t0. Let w = min{D, x} be the amount of order that can be filled. The inventory after filling the order is x w. Reset R = R + wr. Reset x = x w. Case I: t0 < t1 continued. If x < s, and y = 0, then reset y = S x. t1 = t + L. Generate the next arrival time of the customer. How? Case II: t1 <= t0. Reset H = H + (t1 t)xh. Reset t = t1. Reset C = C + c(y). Reset x = x + y. Reset y = 0; t1 = .

Вам также может понравиться