- •Тема: имитационное моделирование работы производственного участка цеха
- •Рассмотрено на заседании кафедры атп
- •Введение
- •Постановка задачи
- •Исходные данные
- •Текст программы на gpss (8 часов)
- •Распечатка выходных данных для моделирования работы участка цеха в течение рабочего дня
- •Текст программы на gpss (5 дней)
- •Распечатка выходных данных для моделирования работы участка цеха в течение 5 рабочих дней
- •График для представления длины очереди к оборудованию 2
- •Обсуждение результатов моделирования
- •Отсеивающий эксперимент
- •Код для выполнения отсеивающего эксперимента
- •Результат отсеивающего эксперимента
- •Вывод по отсеивающему эксперименту
- •Обработка результатов и внесение изменений
- •Оптимизационный эксперимент
- •Выводы и рекомендации относительно применения модели
Код для выполнения отсеивающего эксперимента
*******************************************************
* *
* SEM *
* Fractional Factorial Screening Experiment *
* *
*******************************************************
SEM_Results MATRIX ,2,2,2,2,2,2
INITIAL SEM_Results,UNSPECIFIED
SEM_NextRunNumber EQU 0
EXPERIMENT SEM() BEGIN
/* Run 1 */
och1 = 7;
och2 = 10;
och3 = 3;
och33 = 16;
och11 = 7;
och22 = 14;
IF (StringCompare(DataType(SEM_Results[1,1,1,1,1,1]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Set the Run Number Variable at the beginning. */
SEM_NextRunNumber = 1;
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[1,1,1,1,1,1] = Q$AA2;
END;
/* Run 2 */
och1 = 7;
och2 = 10;
och3 = 3;
och33 = 16;
och11 = 13;
och22 = 20;
IF (StringCompare(DataType(SEM_Results[1,1,1,1,2,2]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[1,1,1,1,2,2] = Q$AA2;
END;
/* Run 3 */
och1 = 7;
och2 = 10;
och3 = 7;
och33 = 24;
och11 = 7;
och22 = 14;
IF (StringCompare(DataType(SEM_Results[1,1,2,2,1,1]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[1,1,2,2,1,1] = Q$AA2;
END;
/* Run 4 */
och1 = 7;
och2 = 10;
och3 = 7;
och33 = 24;
och11 = 13;
och22 = 20;
IF (StringCompare(DataType(SEM_Results[1,1,2,2,2,2]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[1,1,2,2,2,2] = Q$AA2;
END;
/* Run 5 */
och1 = 7;
och2 = 20;
och3 = 3;
och33 = 24;
och11 = 7;
och22 = 20;
IF (StringCompare(DataType(SEM_Results[1,2,1,2,1,2]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[1,2,1,2,1,2] = Q$AA2;
END;
/* Run 6 */
och1 = 7;
och2 = 20;
och3 = 3;
och33 = 24;
och11 = 13;
och22 = 14;
IF (StringCompare(DataType(SEM_Results[1,2,1,2,2,1]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[1,2,1,2,2,1] = Q$AA2;
END;
/* Run 7 */
och1 = 7;
och2 = 20;
och3 = 7;
och33 = 16;
och11 = 7;
och22 = 20;
IF (StringCompare(DataType(SEM_Results[1,2,2,1,1,2]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[1,2,2,1,1,2] = Q$AA2;
END;
/* Run 8 */
och1 = 7;
och2 = 20;
och3 = 7;
och33 = 16;
och11 = 13;
och22 = 14;
IF (StringCompare(DataType(SEM_Results[1,2,2,1,2,1]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[1,2,2,1,2,1] = Q$AA2;
END;
/* Run 9 */
och1 = 13;
och2 = 10;
och3 = 3;
och33 = 24;
och11 = 7;
och22 = 20;
IF (StringCompare(DataType(SEM_Results[2,1,1,2,1,2]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[2,1,1,2,1,2] = Q$AA2;
END;
/* Run 10 */
och1 = 13;
och2 = 10;
och3 = 3;
och33 = 24;
och11 = 13;
och22 = 14;
IF (StringCompare(DataType(SEM_Results[2,1,1,2,2,1]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[2,1,1,2,2,1] = Q$AA2;
END;
/* Run 11 */
och1 = 13;
och2 = 10;
och3 = 7;
och33 = 16;
och11 = 7;
och22 = 20;
IF (StringCompare(DataType(SEM_Results[2,1,2,1,1,2]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[2,1,2,1,1,2] = Q$AA2;
END;
/* Run 12 */
och1 = 13;
och2 = 10;
och3 = 7;
och33 = 16;
och11 = 13;
och22 = 14;
IF (StringCompare(DataType(SEM_Results[2,1,2,1,2,1]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[2,1,2,1,2,1] = Q$AA2;
END;
/* Run 13 */
och1 = 13;
och2 = 20;
och3 = 3;
och33 = 16;
och11 = 7;
och22 = 14;
IF (StringCompare(DataType(SEM_Results[2,2,1,1,1,1]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[2,2,1,1,1,1] = Q$AA2;
END;
/* Run 14 */
och1 = 13;
och2 = 20;
och3 = 3;
och33 = 16;
och11 = 13;
och22 = 20;
IF (StringCompare(DataType(SEM_Results[2,2,1,1,2,2]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[2,2,1,1,2,2] = Q$AA2;
END;
/* Run 15 */
och1 = 13;
och2 = 20;
och3 = 7;
och33 = 24;
och11 = 7;
och22 = 14;
IF (StringCompare(DataType(SEM_Results[2,2,2,2,1,1]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[2,2,2,2,1,1] = Q$AA2;
END;
/* Run 16 */
och1 = 13;
och2 = 20;
och3 = 7;
och33 = 24;
och11 = 13;
och22 = 20;
IF (StringCompare(DataType(SEM_Results[2,2,2,2,2,2]),"UNSPECIFIED")'E'0)
THEN BEGIN
/* Log the Run and Execute the Simulation */
SEM_GetResult();
SEM_Results[2,2,2,2,2,2] = Q$AA2;
END;
/* Aliased Effects in Fractional Factorial Experiment */
SE_Effects(SEM_Results,"I=ABCD=CDEF");
END;
*******************************************************
* The Run Execution Procedure *
*******************************************************
PROCEDURE SEM_GetResult() BEGIN
/* Run Simulation and Log Results. */
/* Treatments have already been set for this run. */
TEMPORARY CurrentYield,ShowString,CommandString;
/* Run Procedure Call */
DoTheRun(SEM_NextRunNumber);
CurrentYield = Q$AA2;
ShowString = PolyCatenate("Run ",String(SEM_NextRunNumber),". ", "" );
ShowString = PolyCatenate(ShowString," Yield=",String(CurrentYield),". ");
ShowString = PolyCatenate(ShowString," och1=",String(och1), ";" );
ShowString = PolyCatenate(ShowString," och2=",String(och2), ";" );
ShowString = PolyCatenate(ShowString," och3=",String(och3), ";" );
ShowString = PolyCatenate(ShowString," och33=",String(och33), ";");
ShowString = PolyCatenate(ShowString," och11=",String(och11), ";" );
ShowString = PolyCatenate(ShowString," och22=",String(och22), ";" );
CommandString = PolyCatenate("SHOW """,ShowString,"""", "" );
DoCommand(CommandString);
SEM_NextRunNumber = SEM_NextRunNumber + 1;
RETURN CurrentYield;
END;
*******************************************************
* Run Procedure *
*******************************************************
PROCEDURE DoTheRun(Run_Number) BEGIN
DoCommand("CLEAR OFF"); /* Must use OFF to preserve results. */
/* EXPAND THIS RMULT IF YOU HAVE MORE RNGs. */
/* All Random Number Streams must have new seeds. */
TEMPORARY CommandString;
/* Evaluate before passing to DoCommand. */
CommandString = Catenate("RMULT ",Run_Number#111);
/* DoCommand compiles the string in Global Context. */
DoCommand(CommandString);
/* SET UP YOUR OWN RUN CONDITIONS. */
DoCommand("START 100,NP"); /* Get past the Startup Period. */
DoCommand("RESET"); /* Begin the Measurement Period. */
DoCommand("START 1000,NP"); /* Run the Simulation. */
END;
*******************************************************
