Краткое практическое руководство по GPSS




"Пример моделирования 2А.Система с одним прибором и очередью"


Для установления периода моделирования используется сегмент таймера из двух блоков. На рис.2.10 уже был представлен сегмент, требуемый в нашем случае, в предположении, что единицей времени выбрана 1 мин. Его мы и используем в модели.


Рис.2.10

Логика моделирования. В представленной модели не выполняется никаких дополнительных действий для вывода клиентов из парикмахерской, когда моделирование завершается при значении таймера 480. Если бы в модели был настоящий парикмахер, то он после восьмичасового рабочего дня ушел бы с работы. Если, наоборот, была бы настоящая модель, то моделировалось бы закрытие дверей через 8 ч работы, а моделирование не прерывалось пока все клиенты, находящиеся в парикмахерской в этот момент времени, не были бы обслужены. Как это записывается на GPSS, будет показано дальше.

Использование модели. Бланк, на котором записана перфокарточная версия модели, показан на рис.2А.2, а. Соответствующая ей распечатка программы показана на рис.2А.2, б.

Рис.2A.2. Пример моделирования 2A.
Модель и распечатка программы:
а - заполненный бланк для перфорации модели;
б - распечатка программы для модели, представленной в части а.

На банке показаны поля имени (LOCATION), операции (OPERATION) и операндов (помечено символами А,В,С,D,Е,F,G). На распечатке по- ле имени отмечено символами * LOC.

LOCATION&nbspOPERATIONA,B,C,D,E,F ------------------------>
1234567891 01 11 21 31 41 51 61 71 81 92 02 12 22 32 42 52 62 72 82 93 03 13 23 33 43 53 63 73 83 94 04 14 24 34 44 54 6
&nbsp&nbsp&nbsp&nbsp&nbspSIMULATE&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
*&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
*&nbsp&nbsp&nbsp&nbspMODEL&nbspSEGMENT&nbsp1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
*&nbsp&nbsp&nbsp&nbspGENERATE&nbsp18,6&nbspПРИХОД&nbspКЛИЕНТОВ&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbspQUEUE&nbsp&nbsp&nbsp&nbspJOEQ&nbspПРИСОЕДИНЕНИЕ&nbspК&nbspОЧЕРЕДИ&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbspSEIZE&nbsp&nbsp&nbsp&nbspJOE&nbsp&nbspПРИХОД&nbspВ&nbspКРЕСЛО&nbspПАРИКМАХЕРА
&nbsp&nbsp&nbsp&nbsp&nbspDEPART&nbsp&nbsp&nbspJOEQ&nbspУХОД&nbspИЗ&nbspОЧЕРЕДИ&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbspADVANCE&nbsp&nbsp16,4&nbspОБСЛУЖИВАНИЕ&nbspУ&nbspПАРИКМАХЕРА&nbsp
&nbsp&nbsp&nbsp&nbsp&nbspRELEASE&nbsp&nbspJOE&nbsp&nbspОСВОБОЖДЕНИЕ&nbspПАРИКМАХЕРА&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbspTERMINATE&nbsp&nbsp&nbsp&nbsp&nbspУХОД&nbspИЗ&nbspПАРИКМАХЕРСКОЙ&nbsp&nbsp&nbsp&nbsp&nbsp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ADVANCE 16,4 USE THE BARBER 8 RELEASE JOE FREE THE BARBER 9 TERMINATE LEAVE THE SHOP * * CONTROL CARDS * START 1 START THE RUN END RETURN CONTROL TO OPERATING SYSTEM
Обратите внимание на то, что интерпретатор увеличил объем распечатывающей информации по сравнению с исходным текстом.


Содержание  Назад  Вперед