fork download
  1. Par1 EQU 5
  2. Par2 EQU 10
  3. Par3 EQU 10
  4. generate (Exponential(1, 0, Par1))
  5. Met1 test l q1,Par3,Otkaz
  6. QUEUE 1
  7. SEIZE 1
  8. DEPART 1
  9. ADVANCE (Exponential(2, 0, Par2))
  10. release 1
  11. terminate
  12. Otkaz terminate
  13. GENERATE 1000000
  14. savevalue P_Otk,(N$Otkaz/N$Met1)
  15. terminate 1
  16. start 1
  17.  
  18.  
  19.  
  20. *******************************************************
  21. * *
  22. * SEM *
  23. * Factorial Screening Experiment *
  24. * *
  25. *******************************************************
  26. SEM_Results MATRIX ,2,2,2
  27. INITIAL SEM_Results,UNSPECIFIED
  28. SEM_NextRunNumber EQU 0
  29.  
  30. EXPERIMENT SEM() BEGIN
  31.  
  32. /* Run 1 */
  33. Par1 = 5;
  34. Par2 = 5;
  35. Par3 = 5;
  36. IF (StringCompare(DataType(SEM_Results[1,1,1]),"UNSPECIFIED")'E'0)
  37. THEN BEGIN
  38. /* Set the Run Number Variable at the beginning. */
  39.  
  40. SEM_NextRunNumber = 1;
  41. /* Log the Run and Execute the Simulation */
  42. SEM_GetResult();
  43. SEM_Results[1,1,1] = X$P_Otk;
  44. END;
  45.  
  46. /* Run 2 */
  47. Par1 = 5;
  48. Par2 = 5;
  49. Par3 = 10;
  50. IF (StringCompare(DataType(SEM_Results[1,1,2]),"UNSPECIFIED")'E'0)
  51. THEN BEGIN
  52. /* Log the Run and Execute the Simulation */
  53. SEM_GetResult();
  54. SEM_Results[1,1,2] = X$P_Otk;
  55. END;
  56.  
  57. /* Run 3 */
  58. Par1 = 5;
  59. Par2 = 10;
  60. Par3 = 5;
  61. IF (StringCompare(DataType(SEM_Results[1,2,1]),"UNSPECIFIED")'E'0)
  62. THEN BEGIN
  63. /* Log the Run and Execute the Simulation */
  64. SEM_GetResult();
  65. SEM_Results[1,2,1] = X$P_Otk;
  66. END;
  67.  
  68. /* Run 4 */
  69. Par1 = 5;
  70. Par2 = 10;
  71. Par3 = 10;
  72. IF (StringCompare(DataType(SEM_Results[1,2,2]),"UNSPECIFIED")'E'0)
  73. THEN BEGIN
  74. /* Log the Run and Execute the Simulation */
  75. SEM_GetResult();
  76. SEM_Results[1,2,2] = X$P_Otk;
  77. END;
  78.  
  79. /* Run 5 */
  80. Par1 = 10;
  81. Par2 = 5;
  82. Par3 = 5;
  83. IF (StringCompare(DataType(SEM_Results[2,1,1]),"UNSPECIFIED")'E'0)
  84. THEN BEGIN
  85. /* Log the Run and Execute the Simulation */
  86. SEM_GetResult();
  87. SEM_Results[2,1,1] = X$P_Otk;
  88. END;
  89.  
  90. /* Run 6 */
  91. Par1 = 10;
  92. Par2 = 5;
  93. Par3 = 10;
  94. IF (StringCompare(DataType(SEM_Results[2,1,2]),"UNSPECIFIED")'E'0)
  95. THEN BEGIN
  96. /* Log the Run and Execute the Simulation */
  97. SEM_GetResult();
  98. SEM_Results[2,1,2] = X$P_Otk;
  99. END;
  100.  
  101. /* Run 7 */
  102. Par1 = 10;
  103. Par2 = 10;
  104. Par3 = 5;
  105. IF (StringCompare(DataType(SEM_Results[2,2,1]),"UNSPECIFIED")'E'0)
  106. THEN BEGIN
  107. /* Log the Run and Execute the Simulation */
  108. SEM_GetResult();
  109. SEM_Results[2,2,1] = X$P_Otk;
  110. END;
  111.  
  112. /* Run 8 */
  113. Par1 = 10;
  114. Par2 = 10;
  115. Par3 = 10;
  116. IF (StringCompare(DataType(SEM_Results[2,2,2]),"UNSPECIFIED")'E'0)
  117. THEN BEGIN
  118. /* Log the Run and Execute the Simulation */
  119. SEM_GetResult();
  120. SEM_Results[2,2,2] = X$P_Otk;
  121. END;
  122.  
  123. /* Aliased Effects in Fractional Factorial Experiment */
  124. SE_Effects(SEM_Results,"I");
  125.  
  126. END;
  127.  
  128.  
  129.  
  130. *******************************************************
  131. * The Run Execution Procedure *
  132. *******************************************************
  133.  
  134. PROCEDURE SEM_GetResult() BEGIN
  135.  
  136. /* Run Simulation and Log Results. */
  137. /* Treatments have already been set for this run. */
  138.  
  139. TEMPORARY CurrentYield,ShowString,CommandString;
  140.  
  141. /* Run Procedure Call */
  142.  
  143. Sem1(SEM_NextRunNumber);
  144. CurrentYield = X$P_Otk;
  145. ShowString = PolyCatenate("Run ",String(SEM_NextRunNumber),". ", "" );
  146.  
  147. ShowString = PolyCatenate(ShowString," Yield=",String(CurrentYield),". ");
  148. ShowString = PolyCatenate(ShowString," Par1=",String(Par1), ";" );
  149. ShowString = PolyCatenate(ShowString," Par2=",String(Par2), ";" );
  150. ShowString = PolyCatenate(ShowString," Par3=",String(Par3), ";" );
  151. CommandString = PolyCatenate("SHOW """,ShowString,"""", "" );
  152. DoCommand(CommandString);
  153. SEM_NextRunNumber = SEM_NextRunNumber + 1;
  154. RETURN CurrentYield;
  155.  
  156. END;
  157.  
  158. *******************************************************
  159. * Run Procedure *
  160. *******************************************************
  161. PROCEDURE Sem1(Run_Number) BEGIN
  162. DoCommand("CLEAR OFF"); /* Must use OFF to preserve results. */
  163.  
  164. /* EXPAND THIS RMULT IF YOU HAVE MORE RNGs. */
  165. /* All Random Number Streams must have new seeds. */
  166. TEMPORARY CommandString;
  167. /* Evaluate before passing to DoCommand. */
  168. CommandString = Catenate("RMULT ",Run_Number#111);
  169. /* DoCommand compiles the string in Global Context. */
  170. DoCommand(CommandString);
  171.  
  172. /* SET UP YOUR OWN RUN CONDITIONS. */
  173. DoCommand("START 1,NP"); /* Get past the Startup Period. */
  174. DoCommand("RESET"); /* Begin the Measurement Period. */
  175. DoCommand("START 1,NP"); /* Run the Simulation. */
  176.  
  177.  
  178.  
Success #stdin #stdout #stderr 0.01s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: near line 1: near "Par1": syntax error
Error: near line 34: near "Par2": syntax error
Error: near line 35: near "Par3": syntax error
Error: near line 36: near "IF": syntax error
Error: near line 42: near "SEM_GetResult": syntax error
Error: near line 43: near "SEM_Results": syntax error
Error: near line 44: cannot commit - no transaction is active
Error: near line 47: near "Par1": syntax error
Error: near line 48: near "Par2": syntax error
Error: near line 49: near "Par3": syntax error
Error: near line 50: near "IF": syntax error
Error: near line 54: near "SEM_Results": syntax error
Error: near line 55: cannot commit - no transaction is active
Error: near line 58: near "Par1": syntax error
Error: near line 59: near "Par2": syntax error
Error: near line 60: near "Par3": syntax error
Error: near line 61: near "IF": syntax error
Error: near line 65: near "SEM_Results": syntax error
Error: near line 66: cannot commit - no transaction is active
Error: near line 69: near "Par1": syntax error
Error: near line 70: near "Par2": syntax error
Error: near line 71: near "Par3": syntax error
Error: near line 72: near "IF": syntax error
Error: near line 76: near "SEM_Results": syntax error
Error: near line 77: cannot commit - no transaction is active
Error: near line 80: near "Par1": syntax error
Error: near line 81: near "Par2": syntax error
Error: near line 82: near "Par3": syntax error
Error: near line 83: near "IF": syntax error
Error: near line 87: near "SEM_Results": syntax error
Error: near line 88: cannot commit - no transaction is active
Error: near line 91: near "Par1": syntax error
Error: near line 92: near "Par2": syntax error
Error: near line 93: near "Par3": syntax error
Error: near line 94: near "IF": syntax error
Error: near line 98: near "SEM_Results": syntax error
Error: near line 99: cannot commit - no transaction is active
Error: near line 102: near "Par1": syntax error
Error: near line 103: near "Par2": syntax error
Error: near line 104: near "Par3": syntax error
Error: near line 105: near "IF": syntax error
Error: near line 109: near "SEM_Results": syntax error
Error: near line 110: cannot commit - no transaction is active
Error: near line 113: near "Par1": syntax error
Error: near line 114: near "Par2": syntax error
Error: near line 115: near "Par3": syntax error
Error: near line 116: near "IF": syntax error
Error: near line 120: near "SEM_Results": syntax error
Error: near line 121: cannot commit - no transaction is active
Error: near line 124: near "SE_Effects": syntax error
Error: near line 126: cannot commit - no transaction is active
Error: near line 130: near "*": syntax error
Error: near line 143: near "Sem1": syntax error
Error: near line 144: near "CurrentYield": syntax error
Error: near line 145: near "ShowString": syntax error
Error: near line 147: near "ShowString": syntax error
Error: near line 148: near "ShowString": syntax error
Error: near line 149: near "ShowString": syntax error
Error: near line 150: near "ShowString": syntax error
Error: near line 151: near "CommandString": syntax error
Error: near line 152: near "DoCommand": syntax error
Error: near line 153: near "SEM_NextRunNumber": syntax error
Error: near line 154: near "RETURN": syntax error
Error: near line 156: cannot commit - no transaction is active
Error: near line 158: near "*": syntax error
Error: near line 166: near "TEMPORARY": syntax error
Error: near line 168: near "CommandString": syntax error
Error: near line 170: near "DoCommand": syntax error
Error: near line 173: near "DoCommand": syntax error
Error: near line 174: near "DoCommand": syntax error
Error: near line 175: near "DoCommand": syntax error