设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5111|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
: v; d% t& Y& B* e3 Q/ w0 F7 d- ^
) v2 u. }' z- r* Q" y底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去* ^. b: e, m" h# t9 E- @' M# @/ g
% p6 V( O% c8 F* O4 {
不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!
5 Y, u$ _0 N* y% M; M' d  j4 e* H' A5 {* z& C
--------------------------------------------
. [# q1 A1 D- `( M6 X, cbegin P_something arriving
/ z, k9 u" ^( K   move into Q_wait
2 v1 V, J2 D  H" d* `' }& o/ z8 a/ _   move into nextof(Q_mA,Q_mB,Q_mC)4 n( W7 o5 V: H5 I# A5 S0 U
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min2 J" u; @; r2 Z3 u. V
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
5 V; }8 D5 v: U# Y) Y) ~9 @3 Y   send to die
' v' X! M8 M6 hend

( J7 z6 L" d$ t. ?( \3 R  h ; E* v2 n' R% O; t
begin P_mA_down arriving+ }3 r3 u, L0 e/ j- s! ]# f2 m
   while 1=1 do
- Z3 Z1 f1 c& l% y. ?# z   begin
' N# r  M9 ]' Z. K7 \   wait for e 110 min4 B- C& ~: U9 Z
   take down R_mA
3 `2 a5 ^6 F. s   wait for e 5 min6 q' j+ a' h4 s# Z6 m( {6 O+ i! z( Q
   bring up R_mA
9 E4 {- A- I0 p& M& L, j3 L7 x   end
+ E' F1 z' w6 z3 qend

$ t2 i2 X4 Q' c* e6 G7 ~
. ^2 Y) c1 Q/ C/ E4 Ubegin P_mB_down arriving
) R4 i, ]! M9 U   while 1=1 do% ?3 `) `0 J- {$ ~7 `/ S8 ^4 _5 q
   begin" V9 t: V, w' R, }0 @; h+ G, t  J
   wait for e 170 min' C1 E5 U3 I, ~1 l. q4 G* e. H
   take down R_mB
  |- x7 t8 z% l1 W   wait for e 10 min
  J: f% Z0 y8 M3 F4 b. x   bring up R_mB
3 _' b% K4 z( [   end) W1 p4 r: T! h5 o! l! V5 a
end

; A1 h4 S: T) T* k- ]* Z5 r
- K% N* _1 r  ?" Ibegin P_mC_down arriving
9 C& l; e) {) }, l; j9 h9 p   while 1=1 do
% ~4 Y+ S4 \5 ]# J2 _! B3 R, A   begin
% X( F6 U4 W$ K0 ~7 R   wait for e 230 min
" K. A& [0 r" F" q. D( u   take down R_mC
; h7 c. x* u0 _2 D   wait for e 10 min. A$ z) b0 x5 \, {' [" ^
   bring up R_mC
8 X5 o- j1 t! j: N, F$ X   end: u9 m5 J: S2 J& Q; z- _( @
end
1 w7 P, q3 H- @) e

! B, j9 Y- v, J: Nbegin P_mA_clean arriving6 a* n3 o+ A; p0 r& {7 j4 ^
   while 1=1 do3 L4 W' L0 f/ K" G% h
   begin
. g8 a. u# H/ c- @/ [/ V   wait for 90 min
' B3 u9 h" N; N1 @# j& m4 t* H1 @* B   take down R_mA
0 \* N! {4 y+ M8 ?1 g& c- ?( I   wait for 5 min
$ i" S; _2 C  C0 G   bring up R_mA! S$ ?" R$ g, a& T0 l, g5 n4 V( s
   end
6 W* w8 |9 r* `# vend
& @: a6 z9 Y! _" e( {  O
  e8 e5 V7 Y5 Y. B" \
begin P_mB_clean arriving
% z* H" H+ a; |* d8 v# A; ^: A! f6 R   while 1=1 do/ Q' L2 {) [- j6 D  N/ \: z
   begin8 x, A9 O! Z+ Z
   wait for 90 min  v5 P; t2 Z/ p
   take down R_mB
7 q8 O  {7 F2 O   wait for 5 min9 y) U" W& y4 e. p
   bring up R_mB" s6 y$ C' O5 }& q
   end* e7 U" ~1 ~7 v/ x
end

) ?* X) R* b' Y4 _4 b: s 7 M, u; W( H5 z: ]2 S
begin P_mC_clean arriving
3 n  R$ o( [. a   while 1=1 do8 p! I; |' k4 {% f6 u
   begin7 I5 B% v+ b, O1 l) u4 l8 [$ u1 s
   wait for 90 min
' P( U5 C( |3 K  |* q, p# ]   take down R_mC
" e% g! n: I% e* s# N/ Z8 f+ w   wait for 10 min
  E1 @, W, |! w. j' U, i9 T& \4 H   bring up R_mC5 W& B* Y: Y( {8 q/ L# z# e
   end
  [& ^# `  ^$ J3 g/ E7 `9 [7 |end
# _' x/ G7 D5 P  o: h
----------------------------------------
! V! _4 i# T+ O# H& B  M" c ' {, U. k+ E# o' u7 t5 x
Exercise 5.9
) A% Q, g3 L1 l$ B- W# M* t7 T5 K
& V9 n6 f: U( a3 y4 i* i6 K/ ], q% S* n. {  [
Create a new model to simulate the following system:
8 q/ ~0 e7 t4 `5 Z. J0 p* ^Loads are created with an interarrival time that is exponentially
( F, S2 v2 H- h$ }distributed with a mean of 20 minutes. Loads wait in an infinite-" s" J" `2 i! M9 q
capacity queue to be processed by one of three single-capacity, 6 W% t/ A2 Z3 U) O1 S# z5 s
arrayed machines. Each machine has its own single-capacity queue ; [9 J, M; S: ?2 ^' ~6 }# R8 T
where loads are processed. Waiting loads move into one of the three 2 E4 Q7 U% C! G
queues in round-robin order. Each machine has a normally
2 Z0 t, i" [* [- t$ W8 adistributed processing time with a mean of 48 minutes and a standard
/ o; Q" ?  D; g6 `deviation of 5 minutes.: a! O. t3 k. T4 _1 l* _' o
The three machines were purchased at different times and have - B* f+ r2 G1 Y# w1 K8 v
different failure rates. The failure and repair times are exponentially
; t* k; W& A9 I  L! Jdistributed with means as shown in the following table: $ S% b' u4 d8 H
Note The solution for this assignment is required to complete
( i2 z& ^0 g+ ^  Mexercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
& c' V. d, |+ f3 K  [. M3 ?your model. 5 a9 t1 z+ x  }" }; }, c
5 C3 T' |# N6 }" c% s/ Y
MachineMean time to failMean time to repair! p* ?! U4 {+ X' Y; h
A110 minutes      5 minutes
9 s  c& a& i+ J7 EB 170 minutes     10 minutes
8 _* V) A; {/ J3 dC230 minutes      10 minutes9 [$ |! `; e0 b$ r: h
* u4 ?1 g5 z1 l
The machines also must be cleaned according to the following
( f! \" M& L( |* bschedule. All times are constant: ; O9 X6 c7 v" l* L/ {3 E# d7 Q! x) I

/ g/ [# t( g$ [MachineTime between cleanings Time to clean
; }) b; a( u1 W4 V* ?1 P$ CA90 minutes        5 minutes
+ T. J$ L& e) G; L  x% u. m/ `B 90 minutes       5 minutes
* w2 I# b5 X0 A% J" cC90 minutes        10 minutes
& s. r0 y7 J7 h2 L
6 @# R# D' y, R( J( l9 lPlace the graphics for the queues and the resources. 9 ^# A, g8 z( Z/ E1 z
Run the simulation for 100 days.3 M! u1 ^! K1 D, n2 G+ s
Define all failure and cleaning times using logic (rather than resource 8 H2 ~& D- U  N
cycles). Answer the following questions:
/ |' W2 ]* n" W) V1 _a.What was the average number of loads in the waiting queue?% ~, @/ W& }* ?& y" `$ z
b.What were the current and average number of loads in Space?
* V- Q+ @! Z8 T2 Z) WHow do you explain these values?
- y6 _1 d& M# N- H

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
9 S' F- Z& k0 Csend to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
/ S! ^' m7 V: Q3 V, F- u" U$ u这行好像也不太对,各位先进觉得如何呢?
* _0 o. t. z! I  d- o) G6 R
; h  y+ d0 R; [* a, m: \begin P_something arriving
5 v1 h/ x! X/ C5 i   move into Q_wait
( H6 V; S9 M/ u' W- m7 [   move into nextof(Q_mA,Q_mB,Q_mC)
3 W) q& v( x( a   use nextof(R_mA,R_mB,R_mC) for n 48,5 min
/ Z+ X" `/ c6 _" C6 R* a8 h   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean) - n1 O6 d& F* L* F* u
end6 z5 o6 {' M% j  Z3 o# W; D
4 N( S. I: r# i. I7 ~5 g: l
begin P_mA_down arriving
* s" e) s) E, I  d   wait for e 110 min! W7 r2 M( I! M) f$ z
   take down R_mA  `9 }; c. S( n; X# k4 F
   wait for e 5 min* Y7 L# d! d* r5 z- B  v
   bring up R_mA
" u- b3 n2 ]0 |' p" j" pend! Q2 ^$ Y% w' K  h
4 s9 t& {- u- E9 [" ?
begin P_mB_down arriving
, p6 j6 q  ~# m) R" \, m: u0 v   wait for e 170 min9 }" P2 k! F; D% s
   take down R_mB: O0 a. X6 ^9 I5 R. j; B
   wait for e 10 min" I5 j: e  d5 a: o/ s
   bring up R_mB+ g% R" E, @5 g8 O$ P/ _0 T' [
end5 U  V7 H& j3 ~9 m5 C# X5 O
: [: p4 _( W4 S9 S# S2 D  ^' A
begin P_mC_down arriving
# o9 r# r" l3 n* \- {5 q   wait for e 230 min
) ^; k; y! L+ ?/ ]- C8 M- J   take down R_mC
4 C0 c; P/ ]5 j+ ]   wait for e 10 min
% `4 ]% N+ E) s   bring up R_mC
, S* U1 \( [! l, E* P+ F1 [  D  dend
) J# D/ N  p. }: W1 E: _" y2 u; d% w2 b" r5 K
begin P_mA_clean arriving3 _: H6 p0 T' u  U" ?- c
   wait for 90 min4 a, V( b. Q/ }2 m& B; u
   take down R_mA/ f2 I" U' @4 r3 \+ H! D
   wait for 5 min5 C, c5 c& q# j
   bring up R_mA2 E' ]7 j. m% l9 r6 q3 V
end
: H$ \3 B& S- n% ~3 [) z+ ?: B6 \( b; J, |: y: ~( e  h
begin P_mB_clean arriving
2 z% u: P! [( }   wait for 90 min
& Q& l1 V2 E# _! d5 x, Z   take down R_mB
) K8 X: N9 u; S& T7 L# T3 n% h   wait for 5 min
7 t, ~/ f4 W- L: i   bring up R_mB
$ w. R+ _0 z  G/ R, x0 |end3 s2 l' ?: j! d8 N, z
# ?. Q3 A6 w) z7 r
begin P_mC_clean arriving( U1 i& k& d5 R
   wait for 90 min4 O4 L/ M6 r2 P7 ?; U
   take down R_mC! f% K* C5 P% N( F- n7 v
   wait for 10 min/ y# K: t" g0 n0 M0 [
   bring up R_mC9 w  f- U# g4 a( k- _
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
5 n7 |1 V/ _9 J4 ~1 ]2 i   move into Q_wait
8 ]% o( Y/ W  Z4 p  D- J   set A_q to nextof(Q_m1,Q_m2,Q_m3)
( s7 j9 _' z2 Y   move into A_w
. u1 w* E; ]3 G! U  V4 J   if A_w=Q_m1 then use R_m1 for u 48,5 min  t% B1 v4 y& F7 Z( T
   else if .....then use ....for u 48,5 min
( J4 A, M. N/ V- D8 N! n   else if .....then use ....for u 48,5 min  
2 H. M1 R8 A% s% h$ \$ H% ?   send to die# f8 w% i1 b5 y! D4 f1 H. `; l
end
( c+ _: c+ j) K' {5 y$ J$ e; T) O6 `+ h
供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2024-5-18 12:42 , Processed in 0.010900 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表