设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7785|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑 8 S; t. U; m  I% D: b/ F

9 K" h: ]& O1 E- n( f底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去. Z9 c! d+ q* S: G

" L  J0 c2 L8 ]7 g" T% F不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!: Y' z3 R5 L3 |( Y1 n. a
' d. z* z8 t0 a' T1 i
--------------------------------------------  e. X2 h4 ~7 B$ j3 M  [# {+ n7 ^
begin P_something arriving* l4 ~' f) w9 ^) ]8 f  V8 S9 P" n
   move into Q_wait6 N8 _2 I; |6 g! \7 V: m
   move into nextof(Q_mA,Q_mB,Q_mC)
3 h7 F/ X) g  }. A- l( n   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min
  X/ ]4 m2 P. B' K   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)2 x, m# X, V3 G& |6 g; K4 J/ r) q) k, l
   send to die: K2 M, ?8 Y) h8 c
end

, M5 d" x$ V& G1 K; c' I4 [9 b) k
  A4 }( P% f0 f9 Kbegin P_mA_down arriving) r$ h) ?' Y2 M0 v( T4 h
   while 1=1 do + |& S$ K: q6 T; i' e/ ?  f
   begin
5 E* R  i0 C) V; y4 w. O   wait for e 110 min' w( ?& m' S" H% E0 ?$ b
   take down R_mA* s& H9 |& y' L6 P8 E2 M, l
   wait for e 5 min
( f+ i' {* n! b! Z: Y% i. X   bring up R_mA+ L; X! t* j0 q( P" p) G! Q
   end
0 x7 I% X7 q) S$ F/ d2 G- l' |end

! y: h, p8 \% B) @5 i ' q) J3 f. S9 G- {4 W. A' X
begin P_mB_down arriving0 W- p9 E% ]& o! g
   while 1=1 do/ O$ X5 G: A* F- W6 |% X- T3 l# B$ @/ r
   begin
' }. f6 m/ D2 W- Q/ _! a   wait for e 170 min7 ~( F- w5 z2 L
   take down R_mB4 ?, q+ F8 H$ T# U- ^5 b
   wait for e 10 min
/ Y/ M$ W2 Y, I8 N   bring up R_mB
2 K/ L6 \! G) P$ c( n" D4 O% f   end) Y5 k3 |& `% ?5 g, |- Q+ c
end
' C/ X: W; G; B  e7 s4 ^0 I

0 a  ]) `  L/ k' c- p$ i, Bbegin P_mC_down arriving/ X. [8 T9 K( W
   while 1=1 do
5 Y  j# F! j: q% _4 Q- D- t   begin8 D6 f, g+ _0 |, v, D
   wait for e 230 min
+ s$ v" ?9 k/ V* ^+ w4 C; R" G8 Q; q4 U   take down R_mC( [2 E, l; G1 C3 E3 u+ ?1 Z  D
   wait for e 10 min
, b: t' k3 |2 p6 m   bring up R_mC3 E$ x8 t# r  b9 r' {
   end
( G5 q9 N: G+ n$ D, l3 w1 c8 kend

# d% v% n1 S) x8 C
, w8 J* S3 J0 j' k- u# Zbegin P_mA_clean arriving
! {1 E" p5 O1 `# r1 i' p! r   while 1=1 do
- N! f  y* N1 V# ^- t   begin
: J7 a9 n9 r" _9 {# O   wait for 90 min& I$ y* ]/ @2 C0 ~7 F' G
   take down R_mA2 _& X. m# S) K1 y+ G0 w5 G) l
   wait for 5 min; M. r0 `8 A6 z  u  Y1 \$ U  o5 N
   bring up R_mA
0 x  ?/ e. ?. e. O( m" C1 h9 e   end1 X7 C" _. ^2 {3 B. Q9 m- @8 ]
end
; p% O0 R  d1 z+ y. N7 S
& o- Z, V' J6 F* _/ p' P. Z+ i2 _9 u
begin P_mB_clean arriving% M6 o# V) f8 f: x( w' e% ]
   while 1=1 do
3 m7 l2 U& m) t( m   begin
+ G4 g; w( M$ V' I( p1 ]   wait for 90 min
% ^) ~! r$ N  @4 V   take down R_mB
4 z) g2 i( _2 k) |8 l( |6 `& Y5 ~$ F   wait for 5 min
5 c5 ^! E' ~; t* z# e9 V   bring up R_mB$ T& @5 F* ^6 R1 R6 k
   end( [* b7 X( |( N: C# J0 `
end

! i1 _. V/ v& k( y9 N1 V # P7 f; M  W, b* u  A% p1 X; k
begin P_mC_clean arriving
9 k# t% X; K# I+ ]* w9 k   while 1=1 do
7 A( o* r) `$ n( k- A$ M, q   begin
! m  e$ D* g; a+ W3 s& C. {   wait for 90 min* U8 {' h/ \" P4 Z  B
   take down R_mC
8 m& x5 ^- M5 e+ R8 l% p8 L) l& g   wait for 10 min
) `2 S4 M) W% u" k& P1 D   bring up R_mC& `4 c6 G- b9 Z; t7 T4 F
   end1 b  u8 N! `8 U9 o1 W1 b
end
& o' f, S0 m4 M# B/ Q" z% M/ s
----------------------------------------6 R. D1 u! }6 F0 s, @- Y

7 L( j8 H" k0 l8 m5 I6 |Exercise 5.9
% M5 `6 I$ r  H! {, J
2 a5 y0 p/ Z. K- \: D# A
  G7 a3 h4 Z- F& ^, uCreate a new model to simulate the following system:! C. F" w5 S- Q! k1 n- P! J
Loads are created with an interarrival time that is exponentially
' [1 I0 j- q4 F- t8 ?0 i* B! d1 Edistributed with a mean of 20 minutes. Loads wait in an infinite-
) c5 _5 r/ s% K- `9 Acapacity queue to be processed by one of three single-capacity,
9 p) s2 t9 }2 a/ s* Qarrayed machines. Each machine has its own single-capacity queue 7 \. }/ b7 a1 f( k( N7 {8 ]
where loads are processed. Waiting loads move into one of the three 0 O% T* n; q# W- {0 O1 O! @
queues in round-robin order. Each machine has a normally , r3 L) p$ U4 `
distributed processing time with a mean of 48 minutes and a standard 1 C4 I6 O: G- |/ n& B5 w
deviation of 5 minutes.
! P5 R1 B* D/ n# I* d3 T4 bThe three machines were purchased at different times and have & c  @* x( G5 J
different failure rates. The failure and repair times are exponentially
. d; Q2 }. e, Ndistributed with means as shown in the following table:
9 c/ z# g7 X" m' {4 JNote The solution for this assignment is required to complete - d  G0 R8 ]0 O2 Z7 L
exercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
& J# }" O5 ]* n1 r9 xyour model.
/ |$ H0 C. n8 W. x4 j+ }
. ^6 \5 V$ k8 c! s" [3 f7 ?& fMachineMean time to failMean time to repair
8 t2 W8 D' y& l0 f5 \A110 minutes      5 minutes$ D% H# y( o/ D5 s- N) q
B 170 minutes     10 minutes
4 p* d- z. R% J% a( K' kC230 minutes      10 minutes. h- a  o( t6 z0 v- K8 Y9 p) a
9 o7 d( }, k& c$ ?
The machines also must be cleaned according to the following ( _0 J2 ?+ T0 i* ^( q( Y
schedule. All times are constant: 7 T5 I$ {& V0 u2 i0 F
! |$ I' H- G. s) U4 J* I
MachineTime between cleanings Time to clean) @4 {2 R& ^7 ]8 }
A90 minutes        5 minutes
! J! D0 }! D2 E3 c& ]! x+ x1 RB 90 minutes       5 minutes
- A. l2 Z' n) C  V+ x; Z- t/ m/ SC90 minutes        10 minutes
" s: i& H# d* O  W
  i/ |1 i7 ~- z& |Place the graphics for the queues and the resources.
, b( g9 ?  i" c. _Run the simulation for 100 days.* r# H# {1 I- q' O) t( g
Define all failure and cleaning times using logic (rather than resource $ N/ G4 j$ f# N* b$ k9 s1 E$ I) ?  x* \
cycles). Answer the following questions:; c+ C2 d  w( Z+ u: g/ |* Y+ ]
a.What was the average number of loads in the waiting queue?
1 E$ Q+ h- m  J9 W+ o2 y# tb.What were the current and average number of loads in Space?
8 {- C. D/ s, z8 K3 I4 B0 a  y& fHow do you explain these values? 3 c, z2 z3 C+ O' c6 H5 F( r6 U

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
  S) z1 b- T. {6 }" osend to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
4 P% D; l, I% S这行好像也不太对,各位先进觉得如何呢?* ~: B- A0 F+ n+ V
* h7 U: Q2 t; ~& v: Q2 q  P
begin P_something arriving
. V# r( r% j0 m6 _" a! }0 O   move into Q_wait
& S3 Q% v5 X8 E( \' m   move into nextof(Q_mA,Q_mB,Q_mC)
; C# C" C8 t: o' w- L4 A! B6 @" K   use nextof(R_mA,R_mB,R_mC) for n 48,5 min7 q+ }: B  ]$ c0 L3 ]' n5 ^
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
; V6 @9 d; D& Pend
! j4 t' I$ T, P' U& {
  O. t0 X% ?% q/ s$ T! ?, _begin P_mA_down arriving
8 L' T3 N4 G" ~# @+ k: ]   wait for e 110 min
+ _5 t; E; D2 T$ b5 Q& k   take down R_mA' r% w: A8 N; B$ C+ b4 D
   wait for e 5 min1 C* }* D% Q- b/ g  r& ~
   bring up R_mA8 M3 r* S: q5 A" T
end
7 U3 W( [$ |# [4 n0 i" j, J7 C) o
1 r  C2 R9 J4 O% j" [! _- ?% y2 |1 Ibegin P_mB_down arriving
6 c) f! S( s# m5 D/ ]: I" O   wait for e 170 min
* c9 W; ~  B: q4 y( Q2 E% W3 s   take down R_mB$ x; W( k4 m7 q7 m* E- Y
   wait for e 10 min  k: C! B% \0 w5 {7 K
   bring up R_mB
1 e! B8 ]& x( j7 n, j8 t  aend
; J3 ~  c: G" T( e  {" R+ G1 @5 t
0 {3 |- [3 I0 Q6 ]begin P_mC_down arriving  o! N" d) Y2 E' Y, i: p
   wait for e 230 min+ \1 d+ W& p) D& l4 ]. c
   take down R_mC
" p! Q# I% q9 e8 I, K& V   wait for e 10 min
- o1 f0 Q# k5 |! H( C5 G% K% B   bring up R_mC
- b# @- [2 L9 q0 @7 mend9 y' H6 I2 d. _" t' D5 ^( W

" h0 C6 d6 s% N: Tbegin P_mA_clean arriving
, C1 `5 Z  s: ^. \0 X   wait for 90 min
( d3 P6 T3 q" Y# i   take down R_mA
/ V0 {9 u8 L& W1 L/ C: w" ^- s   wait for 5 min
% d1 k# [% n0 R9 e1 L% X   bring up R_mA; f" \" u- `* s3 N; U# s% g
end) L( e, n# {& V# h8 k
  z7 M" i1 Z. B& ]( w5 o
begin P_mB_clean arriving
3 u5 Z/ T& \% D! ?- F   wait for 90 min2 h: s2 |; M: V: Q$ K
   take down R_mB: E  X4 G2 m1 R; H% C0 z1 }8 Q- h
   wait for 5 min0 T" X5 s; s) H; a
   bring up R_mB
/ k# b" h/ p* [end
+ i2 p) f; r& v
+ l$ r7 a) Z3 Fbegin P_mC_clean arriving
( [4 K7 e8 o( M, D, _5 G. i   wait for 90 min
$ ~3 w- }0 f7 U- ^# j( b7 j- H   take down R_mC
6 \3 C' z0 j" ]* N   wait for 10 min
/ l  u9 [8 l, d& F   bring up R_mC. g2 c$ G) J" O: I
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
3 s2 A* G! ~$ \! ?0 \' B- d   move into Q_wait
) i+ m. q- [5 L( ^# @9 R   set A_q to nextof(Q_m1,Q_m2,Q_m3)0 I- v' }) @  f
   move into A_w
0 v2 e" v) h& G0 v   if A_w=Q_m1 then use R_m1 for u 48,5 min; ]8 ]; M6 i2 ~( Q9 v
   else if .....then use ....for u 48,5 min
* z: Z3 @4 {1 h% G) d  d' ~5 h6 t   else if .....then use ....for u 48,5 min  
5 ]3 j3 W+ E: M. U+ \6 u( t   send to die1 V7 C( I3 `0 b) o8 ?- X% g
end: {0 m# Z1 p* Q! G8 D( i8 _4 I

1 {( N6 R& `, f; k4 a, E供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-4-17 18:58 , Processed in 0.017716 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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