Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Покрыха.doc
Скачиваний:
9
Добавлен:
22.02.2015
Размер:
3.52 Mб
Скачать

1 Prior to the next nearest event (synchronous-event-method):

  .

Method 2 fixed pitch (synchronous-time):

  ,

and all activity with the initialization time, caught between the old and the new point are considered ready for initialization, as if simultaneous. Their implementation takes place in undefined order. Clearly, in this case modeling error can occur.

Example 2: QS with a place in the queue. ALi1, ALi2 - algorithm source: the appearance of the application, setting it in place, or loss, if there is no place in the queue. ALk1 - algorithm for channel maintenance: the willingness to accept the bid.

In fact, the loss of a client should not be, but at the time algorithms perform well: ALi1, ALi2, ALk1 then ALi2 already cause loss. Therefore, it is desirable to take less. Synchronously-time method is used when the events occur at fixed intervals or when a lot of them and they appear in groups. In all other cases, a synchronous event-method.

Example 5.3. QS (M | M | 1 | ∞). This designation chetyrёhpolnom first field defines the distribution of time intervals between applications source (M - exponential, ie. E. A Poisson process); second field defines the distribution of execution times of applications service channels; the third - the number of channels; fourth - the number of places in the queue.

Let the intensity of the flow of requests la = 9 applications / h; service rate mu = 12 requests / hour; simulation time tsmax = 100 h.

This check routine conditions initialization activities and create a list.

Activity of the source. If it is not zero application (which actually was not), then put it in place, take into account the number of applications, modifies its local time of occurrence of the next application.

Channel activity. If the queue is not empty, if the channel is busy, the issue handled the application of the new inlet channel - in a state of "busy", modifies its local end time of service. If the queue was empty when the channel was busy, the issue handled, the channel - "free", the regular activation - to enhance the source. While it is set equal to tsmax, so as not to unnecessarily initialization list at the same time.

As a result of the simulation we obtain an estimate of average queue length 2,987 applications. This result is discussed in Section 6.4. Estimate of the standard deviation of the queue length - 3,447 applications.

This program can be easily generalized to the simulation of the system (reg | M | 1 | ∞), with a regular flow of applications and (M | M | 1 | m), with a finite number of places in the queue, as well as to broach the system time synchronization and temporal manner.

Organization kvaziparallelizma transactional method

This method is particularly suitable for the simulation of queuing systems (QS). Each received an application (TRANSACT) forms a component of the system, it is set to the local time coordinate. Activity shown here is not equipment service (channels), and transacts themselves, taking one or the other free device and modifying the time the next initialization:.

There are special modeling languages ​​transactional manner, e.g. GPSS (General Purpose System Simulator).

Example 5.4. Modeling GPSS the same system as in Example 5.3.

Barber STORAGE 1 - description of Barber as one parallel to the operating channel.

GENERATE (Exponential (1,0,1 / 9)) - generation of TRANSACT random intervals with an exponential distribution, 1 - seed, 0 - shift 09.01 - the average time between requests.

QUEUE Hall record TRANSACT queue named Hall

ENTER Barber TRANSACT input channel

DEPART Hall care of the queue

ADVANCE (Exponential(1,0,1/12)) delay in the channel (service)

LEAVE Barber release channel

TERMINATE Remove TRANSACT

GENERATE 100 100 simulation time units

TERMINATE 1 the end of the simulation

Writing a program, go to the menu CommandCreate Simulation, CommandStart [Start1]→OK.

report:

START TIME END TIME BLOCKS FACILITIES STORAGES

0.000 100.000 9 0 1

NAME VALUE

BARBER 10000.000

HALL 10001.000

LABEL LOC BLOCK TYPE ENTRY COUNT CURRENT COUNT RETRY

1 GENERATE 922 0 0

2 QUEUE 922 0 0

3 ENTER 922 0 0

4 DEPART 922 0 0

5 ADVANCE 922 1 0

6 LEAVE 921 0 0

7 TERMINATE 921 0 0

8 GENERATE 1 0 0

9 TERMINATE 1 0 0

QUEUE MAX CONT. ENTRY ENTRY(0) AVE.CONT. AVE.TIME AVE.(-0) RETRY

HALL 17 0 922 192 3.133 0.340 0.429 0

STORAGE CAP. REM. MIN. MAX. ENTRIES AVL. AVE.C. UTIL. RETRY DELAY

BARBER 1 0 0 1 922 1 0.813 0.813 0 0

In all included 922 applications, the maximum number of requests in the queue 17 The relationship between the average number of requests in the queue 3.133 and average waiting time of 0.340, is discussed in Section 6.4. Average number of requests in the channel service 0.813.

To get the next run Command → Reset → Start, if you need to reset the seed in the initial state of the Command → Retranslate.

You can add graphics output queue Window → Simulation Window → Plot Window. Label Queue, Expression Q $ Hall → Plot, Command → Start.

Similarly - dates of employment channel.

Testing and operation of simulation models

Once the simulation model is implemented on a computer up and running, use the following steps.