Presentation is loading. Please wait.

Presentation is loading. Please wait.

Generalized Perturbation and Simulation

Similar presentations


Presentation on theme: "Generalized Perturbation and Simulation"— Presentation transcript:

1 Generalized Perturbation and Simulation
Version 3.1 Date: Reference: CLB 11.10 The main purpose of this week is to talk about the simulation from the practical view. Thus some new views of simulation are introduced. And a useful technique, concurrent and parallel simulation, is mainly talked about.

2 Ideas of Generalized PA
Generate one set of common random variables for sample paths with different q’s Timing and State transition are independent mechanisms In Markov case standard clock cut-&-paste of trajectory segments Real time applications The basic idea of PA is to extract more information from one sample path. One application is to get the performance derivative. That is the main part of week 5. Other application of such idea can also help us a lot in the simulation and analysis. These are called Generalized PA, since they have the similar basic idea. The main idea of GPA is to implement Timing and State transition separately. Details of such independence are introduced in the following slides. Assume such independence is available, the simulation can be simplified in two aspects. In the timing aspect, common random variables can be used for sample paths with different parameters. Thus, they can be generate together first. This save the time for repeating such generation. In the state transition aspect, such transition is decided by the present state and the next triggering event. In some special cases, there are some common event series in the sample paths with different parameters. In Markov case, the interpretation above is clearer. In the timing aspect, standard clock mechanism is introduced to simplify the generation of random variables. In the state transition aspect, trajectory segments in the observed sample path can be cut-and-paste to construct the sample path in different parameters. The independence of timing and state transition help to implement the real time applications. Copyright by Yu-Chi Ho

3 Review of the Clock Mechanism
Introduction of “TIME” for quantitative performance analysis purposes Clock Mechanism (a two dimensional array of numbers) cn(a) = the nth lifetime of the event a ta(n) = the time of the nth occurrence of the event a cn(a) ta(1) ta(2) ta(n-1) ta(n) Event type a time Clock mechanism is relevant to the concept of timed automaton. See also CLB 5.2. The introduction of “time” is just for quantitative performance analysis purposes. Clock mechanism is a two dimensional array of numbers to each event. E.g. there are two kinds of events in a M/M/1 queue, a for arrivals and d for departures. To implement a simulation, two kinds of information are needed. One for the nth lifetime of the event and the other for the time of the nth occurrence of the event. Thus two series of random variables are needed. One series describe the lifetime of event a, the inter-arrival times. One describe the lifetime of event d, the service times. Attention, at the end of the (n-1)th lifetime of event a, the nth a is activated and the nth lifetime is assigned. But the nth lifetime of the departure event is assigned when the nth service start. It may be different from the end of the (n-1)th lifetime of event d, since the queue may be empty after customer n-1 leaves. Copyright by Yu-Chi Ho

4 Time Evolution of a DEDS
Event enabling G(x) One event delay Life time generation Min. Of lifetimes State transition x a a* cn(a) Simulation of a DEDS The independence of timing and state transition can be clarified in the coming two slides. First, the time evolution of a DEDS is described in the upper figure. Assume the present stats is x. Then the feasible event set G(x) can be get. For each event in G(x), if it is not assigned a lifetime, generate the lifetime according to its distribution. Then select the event with the minimal lifetime, say a*. State transition implements by the function of present state, x, and the next event, a*. And after the transition, set the present state x. Thus the following process is similar. Second, the process of the simulation of DEDS is also shown in the lower figure. It is based on the event scheduling algorithm. Start from the new state. Only the new event is not assigned a lifetime. Generate the lifetime of the new event. Predict an event corresponding to the end of the lifetime. Place this event in the future event list. Search in the future event list for the next one to occur. Then transit to the next state. Set the new state the present state. Thus the following process is similar. Timing part in the process is the “lifetime generation”. And the state transition part is the “state transition”. Thus they are independent in the figures above. Search for next event to occur New state Generate life time of new event Place in future event list Transition to next state Copyright by Yu-Chi Ho

5 Standard Clock Mechanism
Under Markov Assumption further simplification is possible! t (exponentially distributed inter-arrival times with rates = sum of all event rates) t Can be thinned into component exponential event streams of lesser rate =>the Clock Mechanism Under Markov Assumption, further simplification of the clock mechanism is possible. In other words, if all the event lifetimes contain exponential distribution, a series of random numbers contains exponential distribution of summation of all event rates can be generated, say the master stream. Then, simply determine the event type for each event of the master stream. This is equivalent to generate a series of random variables for each event lifetime. See also CLB Determining event type and timing separately for each event on the master stream Copyright by Yu-Chi Ho

6 Clock Mechanism (collection of random variable samples)
The GSMP Model for DEDS One period delay Next State State Transition function Feasible events Current State cn(a) ta(1) ta(2) ta(n-1) Event type Clock Mechanism (collection of random variable samples) ta(n) time Based on the clock mechanism and the independence of timing and state transition, the GSMP model for DEDS can be illustrated in the figure above. Start from the current state. It determines a feasible event set. For each new event, generate a lifetime from the clock mechanism. Obviously, in the general sense one such clock mechanism is needed for each event. In the Markov cases, only a standard clock mechanism is needed. Then select the event with the least lifetime, say a. Of course, the lifetime of the other events should be updated to the time when a triggers. The state transition function determines the next state according to the current state and the triggering event a. Set the next state the current state. Thus the following process is similar. Determining triggering event Copyright by Yu-Chi Ho

7 Observations Clock mechanism is independent of state transition function Event type and event timing are separate issues under Markov assumption state transition can be arbitrarily complex permit parallel implementation (only separate state registers are needed). Thus the clock mechanism is independent of state transition function, as seen from the previous two slides. Under Markov assumption, only a master stream of random variables is needed. It determines all the event timing. And the event type can be determined separately, according to the ratio of its rate to the summation of all the events’ rates. This simplifies the simulation further. State transition is a function of current state and the triggering event. It is can be arbitrarily complex. But we can deal with it independently with the timing part of the simulation. Since the sample paths with different parameters can share a common series of random variables, it permit parallel implementation. The difference of the sample paths is caused by the difference of the parameters. But with the inverse technique, the generation of random variables containing uniform distribution is the common part. And only several separate state registers are needed to record the different current state of such sample paths. This speed up the simulation sharply. Copyright by Yu-Chi Ho

8 A different view of simulation
Model<=>mapping of the clock mechanism to the sample path through the state transition function. Eliminate as many duplication as possible Squeeze out extra information from a single sample path through calculus and event time perturbation. Take advantage of parallel computation Thus a different view of simulation can be gain through the previous discussion. Intuitively, the clock mechanism determine the timing part of the dynamic. The state transition function determines the state series of the dynamic. Thus a simulation is a mapping of the clock mechanism to the sample path through the state transition function. The basic idea of simplification in the discussion above is to eliminate as many duplication as possible. E.g. the sample paths with different parameters share a common series of random variables. And since the clock mechanism can be separate from the whole simulate module, a clock mechanism can be used to save the time. If the different parameters are just the perturbed ones of the nominal one, such implementation of sample paths constructs the perturbed sample paths. Thus, the analysis of performance sensitivities can be done. The GSMP model of DEDS shows that it is easy to implement the parallel simulation in this model. Thus it takes advantage of parallel computation. Copyright by Yu-Chi Ho

9 The Constructability Condition
The observability condition (OB) the state in the observed sample path the state in the constructed sample path (OB) Matching event lifetime distributions CLB The basic idea of concurrent estimation or parallel simulation is to construct the sample paths with different parameters from the observed sample path. To do this, the Constructability Condition should be met. There are two parts in CC. The Observability Condition (OB). It requires the feasible event set of the state in the sample path to be constructed is always a subset of the feasible event set of the state in the observed sample path. In other words, all the events in the sample path to be constructed should be observable in the observed sample path. Otherwise, the unobservable events cannot be determined in the construction. The match of the event lifetime distributions. Since the sample path is constructed from the observed one, it seems to be different from the one gained directly from the simulation under the different parameters. If all the event lifetime distributions can match in the constructed sample path, such construction is reasonable. E.g. in a M/M/1 queue, a sample path under service rate m2 can be constructed from the observed one under service rate m1. If the service rate in the constructed sample path is really m2, such construction is reasonable. If an approach meets CC, it can be used to construct another sample path. CC sometimes limits the application of some approaches. This can be see further in the following slides. Copyright by Yu-Chi Ho

10 Standard Clock Mechanism
Application: models with exponentially distributed event lifetimes Explanation: Standard clock Determine triggering event Update state Rescale interevent time Suited for parallel processing Drawback: expense for some fictitious events Some important extensions in GPA are introduced in the following slides. Standard Clock (SC) Mechanism has been introduced in the previous slides. The summation of this approach is shown above. It is a useful approach, but the Markov assumption is strict. And the expense for some fictitious events is hard to overcome. The fictitious events are introduced in the process of uniformization. (See also CLB ) These events do not change the state. Thus they are the additional expense. E.g. in a M/M/1 queue, if the service rate is much larger than the arrival rate, the server will always be idle. In the uniformization, the master stream will generate random variables at the rate of (l+ m). Since l<<m, many of the departure events are fictitious events, because of the empty queue. Thus dealing with these events is a big expense. Copyright by Yu-Chi Ho

11 Augmented System Analysis
Application: at most one non-exponential distributed event lifetime, discrete parameters Explanation: (Event Matching) When , wait until Cut-and-paste Augmented System Analysis (ASA) is also an important approach in concurrent estimation. In some sense, it is more general than SC, since it permits at most one non-exponential distributed event lifetime. There are mainly two algorithm in ASA, the Event Matching algorithm and Age Matching algorithm. xm is the state in the sample path to be constructed, and x is the state in the observed sample path. G(x) is the feasible event set of state x. According to the CC, the construction only pauses when OB is break. In other words, some events in the feasible event set of the sample path to be constructed are unobservable. Then such construction must wait until the OB is met again. With the virtue of Markov Property, such construction is reasonable. An intuitive implementation of the event matching is Cut-and-Paste. When OB is met, the construction only copy the nominal sample path to the sample path to be constructed. When CC is break, a cut point is added to the nominal sample path and the construction is halted. When CC is met again, a pasted point is also added to the nominal sample path. The trajectory between the cut and paste points on the sample path is moved. And the copy from the nominal one to the constructing one after the paste point is continued right after the halted point in the sample path to be constructed. This has been introduced in week 5. Copyright by Yu-Chi Ho

12 ASA (Age Matching) When , wait and record AGE, until and AGE match.
Why one non-exponentially distributed event lifetime is permitted? Observed sample path (k=2) Construction suspended The different between Age Matching and Event Matching is that AM introduces the match of the event lifetimes. When CC is break, the construction is halted. In AM, the program record all the event lifetime in the constructed sample path, san AGE. When CC is met again, the program is also halted until all the event lifetime in the nominal sample path is the same as the record AGE. In other words, although all the events in the feasible event set of the constructed sample path is observable again, the construction will also be halted until the AGE match. Thus, the event lifetime in the constructed sample path contains the required distribution. Check the OB and the requirement of matching event lifetime distributions separately is the basic idea of AM. The figure explain why one non-exponentially distributed event lifetime is permitted. It is an M/M/1/k queue. x=0, xm=1, G(x)={a}, G(xm)={a,d}. The d event is unobservable in the nominal sample path. Thus a cut point is added to the nominal one, as shown by a red point. Since d has just happened, its lifetime is 0. While the lifetime of a should be recorded in AGE. Thus the construction is halted until the next customer arrives in the observed sample path. Then the OB is met. Since the inter-arrival time contains exponential distribution, the lifetimes of the event a in the nominal one and in the constructed one are stochastically the same. Since event d is newly activated in the nominal sample path, its lifetime is just 0. Thus the event lifetimes in the nominal sample path match AGE. The construction is continued. From the figure, the distribution of the d lifetime does not affect the analysis above. Thus the construction is the same to an M/G/1/k queue. Thus in Age Matching, one non-exponentially distributed event lifetime is permitted. The drawback of AM is that, when they are two or more non-exponentially distributed event lifetime, such AGE is hard to match. cut paste Constructed sample path (k=3) Copyright by Yu-Chi Ho

13 Time Warping Algorithm
Application: arbitrarily distribution event lifetime. Explanation: only cut the “sample path” of the infeasible events. Effectively usage of the nominal sample path. Strongpoint: less computation requirements Drawback: storage of the information during the waiting. The Time Warping Algorithm (TWA) is another extension in GPA. Its basic idea is to use the information in the nominal sample path more effectively. In the cut-and-paste algorithm, the sample path between the cut and paste points are rejected directly. The information in this part is wasted. Remember the clock mechanism of GSMP model of DEDS. Assume the series of random variables of the event lifetimes have been generated at the first of the simulation. When the OB is break, the event lifetime of the unobservable events can be found some time later in the observed sample path. And the lifetime of the still observable events can still be used in the construction. Thus the information of the still observable events during the waiting period can be used. TWA stores more information during the waiting. Besides the AGE, the dynamic of the observable events are still stored for later use. Thus it saves the computation to generate the random variables for these observable events, which should do in the previous algorithms, but need more storage. TWA shows the general frame of GPA. See also CLB Copyright by Yu-Chi Ho


Download ppt "Generalized Perturbation and Simulation"

Similar presentations


Ads by Google