Полезное:
Как сделать разговор полезным и приятным
Как сделать объемную звезду своими руками
Как сделать то, что делать не хочется?
Как сделать погремушку
Как сделать так чтобы женщины сами знакомились с вами
Как сделать идею коммерческой
Как сделать хорошую растяжку ног?
Как сделать наш разум здоровым?
Как сделать, чтобы люди обманывали меньше
Вопрос 4. Как сделать так, чтобы вас уважали и ценили?
Как сделать лучше себе и другим людям
Как сделать свидание интересным?
Категории:
АрхитектураАстрономияБиологияГеографияГеологияИнформатикаИскусствоИсторияКулинарияКультураМаркетингМатематикаМедицинаМенеджментОхрана трудаПравоПроизводствоПсихологияРелигияСоциологияСпортТехникаФизикаФилософияХимияЭкологияЭкономикаЭлектроника
|
Simulation in Progress. ⇐ ПредыдущаяСтр 3 из 3 A Simulation in an Experiment has ended. Clock is 48000.000000. Simulation in Progress. A Simulation in an Experiment has ended. Clock is 528000.000000. 05/20/10 15:18:04 "Run 8. Yield=.8736787710809414. S_1=6.000027138110013; S_2=4.999854398723966;" Experiment ended. Полученное уравнение поверхности отклика имеет вид: Y = 28.4923 +0.0023674 A -9.46114 B -0.000108229 A B +2.11338 A^2 +0.946206 B^2
Время обслуживания 6 и 5 минут соответственно первым и вторым сотрудниками магазина включено в оптимальные условия. При этом оптимальное значение вероятности обслуживания заявок составит 0.8737.
Выводы
В ходе выполнения лабораторной работы был проведен анализ предметной области задачи. На основании проведенного анализа была построена модель двухканальной разомкнутой системы массового обслуживания MAG. Данная модель была смоделирована в среде GPSS World и исследована посредством пользовательского эксперимента. По результатам дисперсионного и регрессионного анализов видно, что для обеспечения максимальной вероятности обслуживания заявок модель со временем обслуживания клиентов 6 первым продавцом и 5 минут вторым продавцом смоделирована оптимально.
Приложение А Текст программы Дисперсионный анализ ********************************************** * Моделирование работы магазина * ********************************************** INFORM QTABLE mag,0,10,70 GENERATE (Exponential (1,0,3));Поступление покупателей в магазин QUEUE mag;Вход покупателей в очередь к сотруднику магазина TRANSFER BOTH,SOT_1,SOT_2;Переход покупателя к свободному сотруднику магазина SOT_1 SEIZE SOTRUDNIK_1;Определение занятости 1-го сотрудника магазина DEPART mag;Выход покупателя из очереди от сотрудника магазина ADVANCE 6,2;Обслуживание покупателя 1-ым сотрудником магазина RELEASE SOTRUDNIK_1;Освобождение 1-го сотрудника TRANSFER,NEXT;Переход к оператору с меткой NEXT SOT_2 SEIZE SOTRUDNIK_2;Определение занятости 2-го сотрудника магазина DEPART mag;Выход покупателя из очереди от сотрудника магазина ADVANCE 5,2.989;Обслуживание покупателя 2-ым сотрудником магазина RELEASE SOTRUDNIK_2;Освобождение 2-го сотрудника NEXT SAVEVALUE Ave_Queue,QT$mag; Сохранение времени пребывания в очереди TERMINATE;Выход покупателя из системы GENERATE 480;Моделирование работы магазина в течение смены TERMINATE 1 START 1
******************************************************* * * * MAG * * Factorial Screening Experiment * * * ******************************************************* MAG_Results MATRIX,2,2 INITIAL MAG_Results,UNSPECIFIED MAG_NextRunNumber EQU 0
EXPERIMENT MAG() BEGIN
/* Run 1 */ S_1 = 4; S_2 = 2.011; IF (StringCompare(DataType(MAG_Results[1,1]),"UNSPECIFIED")'E'0) THEN BEGIN /* Set the Run Number Variable at the beginning. */
MAG_NextRunNumber = 1; /* Log the Run and Execute the Simulation */ MAG_GetResult(); MAG_Results[1,1] = N$SOT_1/N$SOT_2; END;
/* Run 2 */ S_1 = 4; S_2 = 7.989; IF (StringCompare(DataType(MAG_Results[1,2]),"UNSPECIFIED")'E'0) THEN BEGIN /* Log the Run and Execute the Simulation */ MAG_GetResult(); MAG_Results[1,2] = N$SOT_1/N$SOT_2; END;
/* Run 3 */ S_1 = 8; S_2 = 2.011; IF (StringCompare(DataType(MAG_Results[2,1]),"UNSPECIFIED")'E'0) THEN BEGIN /* Log the Run and Execute the Simulation */ MAG_GetResult(); MAG_Results[2,1] = N$SOT_1/N$SOT_2; END;
/* Run 4 */ S_1 = 8; S_2 = 7.989; IF (StringCompare(DataType(MAG_Results[2,2]),"UNSPECIFIED")'E'0) THEN BEGIN /* Log the Run and Execute the Simulation */ MAG_GetResult(); MAG_Results[2,2] = N$SOT_1/N$SOT_2; END;
/* Aliased Effects in Fractional Factorial Experiment */ SE_Effects(MAG_Results,"I");
END;
******************************************************* * The Run Execution Procedure * *******************************************************
PROCEDURE MAG_GetResult() BEGIN
/* Run Simulation and Log Results. */ /* Treatments have already been set for this run. */
TEMPORARY CurrentYield,ShowString,CommandString;
/* Run Procedure Call */
MAG_RUN(MAG_NextRunNumber); CurrentYield = N$SOT_1/N$SOT_2; ShowString = PolyCatenate("Run ",String(MAG_NextRunNumber),". ", "");
ShowString = PolyCatenate(ShowString," Yield=",String(CurrentYield),". "); ShowString = PolyCatenate(ShowString," S_1=",String(S_1), ";"); ShowString = PolyCatenate(ShowString," S_2=",String(S_2), ";"); CommandString = PolyCatenate("SHOW """,ShowString,"""", ""); DoCommand(CommandString); MAG_NextRunNumber = MAG_NextRunNumber + 1; RETURN CurrentYield;
END;
******************************************************* * Run Procedure * ******************************************************* PROCEDURE MAG_RUN(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 15,NP"); /* Get past the Startup Period. */ DoCommand("RESET"); /* Begin the Measurement Period. */ DoCommand("START 100,NP"); /* Run the Simulation. */ END; *******************************************************
Приложение Б Текст программы Регрессионный анализ ********************************************** * Моделирование работы магазина * ********************************************** INFORM QTABLE mag,0,10,70 GENERATE (Exponential (1,0,3));Поступление покупателей в магазин QUEUE mag;Вход покупателей в очередь к сотруднику магазина TRANSFER BOTH,SOT_1,SOT_2;Переход покупателя к свободному сотруднику магазина SOT_1 SEIZE SOTRUDNIK_1;Определение занятости 1-го сотрудника магазина DEPART mag;Выход покупателя из очереди от сотрудника магазина ADVANCE 6,2;Обслуживание покупателя 1-ым сотрудником магазина RELEASE SOTRUDNIK_1;Освобождение 1-го сотрудника TRANSFER,NEXT;Переход к оператору с меткой NEXT SOT_2 SEIZE SOTRUDNIK_2;Определение занятости 2-го сотрудника магазина DEPART mag;Выход покупателя из очереди от сотрудника магазина ADVANCE 5,2.989;Обслуживание покупателя 2-ым сотрудником магазина RELEASE SOTRUDNIK_2;Освобождение 2-го сотрудника NEXT SAVEVALUE Ave_Queue,QT$mag; Сохранение времени пребывания в очереди TERMINATE;Выход покупателя из системы GENERATE 480;Моделирование работы магазина в течение смены TERMINATE 1 START 1
******************************************************* * * * mag_Opt * * Response Surface Exploration * * * ******************************************************* mag_Opt_RunMatrix MATRIX,24,2 INITIAL mag_Opt_RunMatrix,UNSPECIFIED mag_Opt_RunYields MATRIX,24,1 INITIAL mag_Opt_RunYields,UNSPECIFIED mag_Opt_TreatmentLevels MATRIX,2,1 INITIAL mag_Opt_TreatmentLevels,UNSPECIFIED mag_Opt_TreatmentHalfRange MATRIX,2,1 INITIAL mag_Opt_TreatmentHalfRange,UNSPECIFIED mag_Opt_MovementVector MATRIX,2,1 INITIAL mag_Opt_MovementVector,UNSPECIFIED mag_Opt_BestYields MATRIX,2,1 INITIAL mag_Opt_BestYields,UNSPECIFIED mag_Opt_CurrentBestTC MATRIX,2,1 INITIAL mag_Opt_CurrentBestTC,UNSPECIFIED mag_Opt_OptimumTC MATRIX,2,1 INITIAL mag_Opt_OptimumTC,UNSPECIFIED mag_Opt_NextRunNumber EQU 0 mag_Opt_RunIndex EQU 0
EXPERIMENT mag_Opt() BEGIN
TEMPORARY Moving,InitialMove,OptimumType,CurrentYield,TRUE,FALSE; TEMPORARY FitCode,LackOfFit,DirectionFound,OptimumPredicted,OptimumContained; /* Return codes from surface fit. */ TRUE=1;FALSE=0;FitCode=TRUE;InitialMove=FALSE; LackOfFit=1;DirectionFound=2;OptimumPredicted=3;OptimumContained=4; OptimumType = 1; /* Look for Maximum */ mag_Opt_DirectionLimit = 2; mag_Opt_NextRunNumber = 1;
mag_Opt_TreatmentLevels[1,1] = ((8)+(4))/2; mag_Opt_TreatmentHalfRange[1,1] = ((8)-(4))/2; mag_Opt_TreatmentLevels[2,1] = ((7.989)+(2.011))/2; mag_Opt_TreatmentHalfRange[2,1] = ((7.989)-(2.011))/2; Moving = TRUE;
WHILE ((Moving'E'TRUE)'AND'(mag_Opt_DirectionLimit>0)) DO BEGIN /* Repeat for each direction */ /* Set up the ascent vector. */ /* Run the unaugmented factorial experiment. */ DoCommand("INITIAL mag_Opt_RunYields,UNSPECIFIED"); mag_Opt_FullPlusCenter(); /* If we have moved, run the augmented experiment. */ IF (InitialMove'E'TRUE) THEN mag_Opt_Augmented(); FitCode = RSM_FitSurfaceToData(mag_Opt_RunMatrix,mag_Opt_RunYields,mag_Opt_TreatmentLevels, mag_Opt_TreatmentHalfRange,OptimumType,mag_Opt_BestYields, mag_Opt_CurrentBestTC,mag_Opt_MovementVector,mag_Opt_OptimumTC); IF (FitCode'LE'LackOfFit) THEN BEGIN /* Factorial experiment fails. Try the augmented. */ mag_Opt_Augmented(); FitCode = RSM_FitSurfaceToData(mag_Opt_RunMatrix,mag_Opt_RunYields,mag_Opt_TreatmentLevels, mag_Opt_TreatmentHalfRange,OptimumType,mag_Opt_BestYields, mag_Opt_CurrentBestTC,mag_Opt_MovementVector,mag_Opt_OptimumTC); END; IF (FitCode'LE'LackOfFit) THEN BEGIN /* All Models Fail. RSM Fails.*/ DoCommand("SHOW ""ERROR: Response Surface Fails. Optimum not found."""); RETURN 0; END; IF (FitCode'L'OptimumContained) THEN BEGIN /* The Move Vector is in place.*/ mag_Opt_Move(OptimumType); InitialMove=TRUE; /* Reset the Experimental Region, */ mag_Opt_TreatmentLevels[1,1] = mag_Opt_CurrentBestTC[1,1]; /* Don't exceed limits. */ IF (mag_Opt_TreatmentLevels[1,1]'LE'((7.989)+1.000000)) THEN BEGIN mag_Opt_TreatmentLevels[1,1] = (7.989) + 1.000000; END; IF (mag_Opt_TreatmentLevels[1,1]'GE'((8)-1.000000)) THEN BEGIN mag_Opt_TreatmentLevels[1,1] = (8) - 1.000000; END; mag_Opt_TreatmentLevels[2,1] = mag_Opt_CurrentBestTC[2,1]; IF (mag_Opt_TreatmentLevels[2,1]'LE'((2.011)+1.000000)) THEN BEGIN mag_Opt_TreatmentLevels[2,1] = (2.011) + 1.000000; END; IF (mag_Opt_TreatmentLevels[2,1]'GE'((4)-1.000000)) THEN BEGIN mag_Opt_TreatmentLevels[2,1] = (4) - 1.000000; END; mag_Opt_DirectionLimit = mag_Opt_DirectionLimit-1; END; ELSE Moving = FALSE; END;
IF (FitCode<OptimumContained) THEN BEGIN /* Fit the augmented model. */ DoCommand("INITIAL mag_Opt_RunYields,UNSPECIFIED"); mag_Opt_FullPlusCenter(); mag_Opt_Augmented(); FitCode = RSM_FitSurfaceToData(mag_Opt_RunMatrix,mag_Opt_RunYields,mag_Opt_TreatmentLevels, mag_Opt_TreatmentHalfRange,OptimumType,mag_Opt_BestYields, mag_Opt_CurrentBestTC,mag_Opt_MovementVector,mag_Opt_OptimumTC); END;
IF (FitCode<OptimumPredicted) THEN BEGIN /* All Models Fail. RSM Fails.*/ DoCommand("SHOW ""ERROR: Response Surface Fails. Optimum not found."""); END;
IF (FitCode'GE'OptimumPredicted) THEN BEGIN /* Verify the Optimum.*/ IF ((OptimumType#mag_Opt_BestYields[2,1])>(OptimumType#mag_Opt_BestYields[1,1])) THEN BEGIN DoCommand("SHOW ""Running the predicted Optimum."""); S_1 = mag_Opt_OptimumTC[1,1]; S_2 = mag_Opt_OptimumTC[2,1]; /* Do the Simulation */ CurrentYield = mag_Opt_GetResult(); IF ((OptimumType#CurrentYield)>(OptimumType#mag_Opt_BestYields[1,1])) THEN BEGIN mag_Opt_BestYields[1,1]=CurrentYield; mag_Opt_CurrentBestTC[1,1] = S_1; mag_Opt_CurrentBestTC[2,1] = S_2; END; END; END;
END;
******************************************************* * Move Procedure * * * * OptimumType = 1 - Maximize * * = -1 - Minimize * *******************************************************
PROCEDURE mag_Opt_Move(OptimumType) BEGIN
/* RSM_FitSurfaceToData must return a code > 0 before moving. */
TEMPORARY CurrentYield,KeepMoving,TRUE,FALSE;
TRUE=1;FALSE=0;KeepMoving=TRUE; DoCommand("INITIAL mag_Opt_RunYields,UNSPECIFIED "); DoCommand("SHOW ""Moving...""");
/* Backup a half step so that the first step is a small one. */ S_1 = mag_Opt_CurrentBestTC[1,1]-mag_Opt_MovementVector[1,1]/2; S_2 = mag_Opt_CurrentBestTC[2,1]-mag_Opt_MovementVector[2,1]/2;
WHILE (KeepMoving) DO BEGIN
S_1 = S_1 + mag_Opt_MovementVector[1,1]; S_2 = S_2 + mag_Opt_MovementVector[2,1]; /* Don't exceed limits. */ IF ((S_1)'LE'((7.989)+1.000000)) THEN BEGIN S_1 = 7.989 + 1.000000; KeepMoving = FALSE; END; IF ((S_1)'GE'((8)-1.000000)) THEN BEGIN S_1 = 8 - 1.000000; KeepMoving = FALSE; END; IF ((S_2)'LE'((2.011)+1.000000)) THEN BEGIN S_2 = 2.011 + 1.000000; KeepMoving = FALSE; END; IF ((S_2)'GE'((4)-1.000000)) THEN BEGIN S_2 = 4 - 1.000000; KeepMoving = FALSE; END;
/* Do the Simulation */ mag_Opt_RunIndex = 1; /* Don't let the Run Index Advance */ CurrentYield = mag_Opt_GetResult(); IF ((OptimumType#CurrentYield)>(OptimumType#mag_Opt_BestYields[1,1])) THEN BEGIN mag_Opt_BestYields[1,1]=CurrentYield; mag_Opt_CurrentBestTC[1,1] = S_1; mag_Opt_CurrentBestTC[2,1] = S_2; END; ELSE BEGIN /* We have passed the optimum. */ KeepMoving = FALSE; END; END; DoCommand("SHOW ""Move ending.""");
END;
******************************************************* * * * mag_Opt_FullPlusCenter * * * *******************************************************
PROCEDURE mag_Opt_FullPlusCenter() BEGIN
/* Full Factorial Experiment Using Previous Results */
TEMPORARY CurrentYield,IndexI,IndexJ;
mag_Opt_RunIndex = 1;
IndexI=1; WHILE (IndexI<3) DO BEGIN IndexJ=1; WHILE (IndexJ<3) DO BEGIN /*********************************************/ IF (StringCompare(DataType(mag_Opt_RunYields[mag_Opt_RunIndex,1]),"UNSPECIFIED")'E'0) THEN BEGIN /* Run Procedure Call */ IF (IndexI'E'1) THEN S_1 = mag_Opt_TreatmentLevels[1,1]-mag_Opt_TreatmentHalfRange[1,1]; ELSE S_1 = mag_Opt_TreatmentLevels[1,1]+mag_Opt_TreatmentHalfRange[1,1]; IF (IndexJ'E'1) THEN S_2 = mag_Opt_TreatmentLevels[2,1]-mag_Opt_TreatmentHalfRange[2,1]; ELSE S_2 = mag_Opt_TreatmentLevels[2,1]+mag_Opt_TreatmentHalfRange[2,1]; /* Do the Simulation */ mag_Opt_GetResult(); END; /*********************************************/ IndexJ = IndexJ+1; END; IndexI = IndexI+1; END;
/*********************************************/ /* Evaluate 3 Center Points */ /*********************************************/ mag_Opt_CenterTheFactors(); IndexI=1; WHILE (IndexI<4) DO BEGIN IF (StringCompare(DataType(mag_Opt_RunYields[mag_Opt_RunIndex,1]),"UNSPECIFIED")'E'0) THEN BEGIN /* Do the Simulation */ mag_Opt_GetResult(); END; IndexI = IndexI+1; END;
END;
******************************************************* * * * mag_Opt_Augmented * * * *******************************************************
PROCEDURE mag_Opt_Augmented() BEGIN
/* Augmented Experiment */
/* Add the Augmentation Points. */ mag_Opt_CenterTheFactors(); S_1 = mag_Opt_TreatmentLevels[1,1] + 1.000000 # mag_Opt_TreatmentHalfRange[1,1]; mag_Opt_GetResult(); S_1 = mag_Opt_TreatmentLevels[1,1] - 1.000000 # mag_Opt_TreatmentHalfRange[1,1]; mag_Opt_GetResult(); mag_Opt_CenterTheFactors(); S_2 = mag_Opt_TreatmentLevels[2,1] + 1.000000 # mag_Opt_TreatmentHalfRange[2,1]; mag_Opt_GetResult(); S_2 = mag_Opt_TreatmentLevels[2,1] - 1.000000 # mag_Opt_TreatmentHalfRange[2,1]; mag_Opt_GetResult();
END;
******************************************************* * * * mag_Opt_CenterTheFactors * * * ******************************************************* PROCEDURE mag_Opt_CenterTheFactors() BEGIN /* Return all Treatment Levels to the Center Point */ S_1 = mag_Opt_TreatmentLevels[1,1]; S_2 = mag_Opt_TreatmentLevels[2,1]; END;
******************************************************* * The Run Execution Procedure * *******************************************************
PROCEDURE mag_Opt_GetResult() BEGIN
/* Run Simulation and Log Results. */ /* Treatments have already been set for this run. */
TEMPORARY CurrentYield,ShowString,CommandString;
/* Run Procedure Call */
mag_Opt_RUN(mag_Opt_NextRunNumber); CurrentYield = N$SOT_1/N$SOT_2; mag_Opt_RunYields[mag_Opt_RunIndex,1] = CurrentYield; mag_Opt_RunMatrix[mag_Opt_RunIndex,1] = S_1; mag_Opt_RunMatrix[mag_Opt_RunIndex,2] = S_2;
ShowString = PolyCatenate("Run ",String(mag_Opt_NextRunNumber),". ", "");
ShowString = PolyCatenate(ShowString," Yield=",String(CurrentYield),". "); ShowString = PolyCatenate(ShowString," S_1=",String(S_1), ";"); ShowString = PolyCatenate(ShowString," S_2=",String(S_2), ";"); CommandString = PolyCatenate("SHOW """,ShowString,"""", ""); DoCommand(CommandString); mag_Opt_RunIndex = mag_Opt_RunIndex + 1; mag_Opt_NextRunNumber = mag_Opt_NextRunNumber + 1; RETURN CurrentYield;
END;
******************************************************* * Run Procedure * ******************************************************* PROCEDURE mag_Opt_RUN(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; *******************************************************
|