设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7852|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
, Z" p: h8 ]; E/ k0 o- P0 W1 ]
/ c5 m, o6 ?0 z5 k底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去
' @, X: L2 J* T) f0 W. l5 X; D6 z  `' F; U
不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!9 E' R  ?/ {6 R* I% C' }8 o) ?

# q2 u. W! s2 m& b4 Z9 S
--------------------------------------------" D0 L! w/ b3 x: t  G: ^
begin P_something arriving
2 B9 K) ^( W" E' T  q   move into Q_wait4 k! x% M3 b- G. c/ m# X  w
   move into nextof(Q_mA,Q_mB,Q_mC)
$ K+ d0 E" `7 S$ Y   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min
/ k5 I1 p' @% N' ~# F/ ?   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)9 W* d' |4 C3 c5 w1 n- w- m+ r) [  w
   send to die
9 j+ `2 r+ `7 \+ C8 i: z7 C/ ?end
$ m5 d1 q/ m, ]1 p
2 y- F& W1 }: I
begin P_mA_down arriving
; C) w, [* W0 d) \+ k- v( I   while 1=1 do % ]- V7 x" F+ h2 P5 ]  m6 ?
   begin
; h- x" O4 s  K0 R   wait for e 110 min* X' h. c  ]. L7 r: ?- ~" ~7 X
   take down R_mA
' ?& K7 Y, u7 y/ p2 y) j! |   wait for e 5 min
$ L. s& R/ B4 R1 c0 T& t( g7 \, o   bring up R_mA" p; [7 |$ o, Q7 D& |, _3 Y0 V
   end! K2 G+ e' ^5 ~
end
9 u% \* ^" W6 v. E7 ]7 J

$ c) }* a  L; R# k0 `6 A) s+ `1 qbegin P_mB_down arriving0 c2 a  H" ]# {
   while 1=1 do
+ T7 |4 x% T* \+ Q$ x% H   begin
. Z  a8 {; N/ x3 l6 Q   wait for e 170 min
4 z0 `- @% T$ [8 |/ [7 h   take down R_mB& j! }$ w# J. |, o
   wait for e 10 min
0 Q/ B# p- K6 |4 {" ?   bring up R_mB6 U! d5 w- E7 H7 k$ |
   end
( t2 y! a  k% tend

& j8 n; c8 F5 ~2 s+ o
; {4 N$ n' i+ s7 a, N; Z  j6 hbegin P_mC_down arriving7 X# }: b- d% C  e" f
   while 1=1 do ) b9 B) J! J0 R# N1 |
   begin) y2 L" v% j2 n$ ?5 ?
   wait for e 230 min
& v# m7 ], z, {, b- ?4 w# V8 P# ^   take down R_mC
" s. C, H$ M( u, W   wait for e 10 min
5 k+ A3 h8 l! I, X  R$ a   bring up R_mC
9 X; I1 B8 o3 |, b9 B) ~& A; k   end7 @; N) f; U8 G1 c& g
end
: s6 O; y, X  v' t& k3 V% z+ f

3 M9 s0 x4 P; O  V) |" q' y3 kbegin P_mA_clean arriving
  Q" ]8 C) T7 L# t$ J   while 1=1 do- Y6 I# ?' i1 c$ D" U/ a& r( w
   begin
/ ^# ~8 x* _0 W  a  l( O1 D- [   wait for 90 min
+ `7 f" t3 O5 R3 l8 g  _3 C   take down R_mA! q7 _" h: G  \5 X/ Z0 K
   wait for 5 min& f. K7 @0 a0 \  i# l7 F' V- P, A
   bring up R_mA1 S7 E6 v* S( g. |1 t
   end
: M, \0 y1 |% w& k* B0 a) wend

% V! P" ]' R. N+ y+ n# X
3 A$ G) C1 Y. X' ]" i- `begin P_mB_clean arriving
$ W0 f, `% w, l& R0 ~% T   while 1=1 do2 Y( n9 l0 S8 A" u+ Z4 j5 O
   begin
; M/ \/ i$ a! v# @) g4 X* d   wait for 90 min) V3 k. h* b/ y/ C4 n7 |  c, T! M
   take down R_mB* H! u  E0 U3 r6 i) w
   wait for 5 min
3 f3 p0 i; v1 ~. ?$ ]   bring up R_mB
. O! x! Q0 w& X: M$ n4 D4 g   end+ v+ V) z( {. U
end
/ h7 _! R* a1 S; J6 k

' [6 g0 f! X( p$ s: Vbegin P_mC_clean arriving
; P, S2 b, ]3 n) X) p" l$ [   while 1=1 do
/ f/ i4 i: ~7 E   begin
( V( m. s& U  z# `& E   wait for 90 min8 D; B8 X! e/ L* \/ U7 l
   take down R_mC& U6 g3 X# H6 T9 ?
   wait for 10 min
2 `! {) o) Q% I  F   bring up R_mC
- ~3 D' _0 W. ?9 E2 J- L5 n   end# B4 G/ ^2 u! p. x4 r- G, j
end
9 q" i* A( P5 g) W
----------------------------------------
# K; V+ R, v# E ' a9 ~/ y% O) Q- |; V0 g3 j
Exercise 5.9
7 K( Q  I8 i( Y2 z( A# a  ^) ?
8 z/ k& R) W! ^. P
" n! t, P9 k) @+ X5 H5 kCreate a new model to simulate the following system:
# g1 E4 ?! j' d* E% VLoads are created with an interarrival time that is exponentially
7 F+ S/ M  w+ W) m( ydistributed with a mean of 20 minutes. Loads wait in an infinite-
% j! {; i: \" mcapacity queue to be processed by one of three single-capacity,
2 H, j. L* u: v2 Parrayed machines. Each machine has its own single-capacity queue
* s+ F" C6 }8 w& A% \+ b0 f, d' Kwhere loads are processed. Waiting loads move into one of the three * ]/ y( B4 T' h  Y1 R9 e) r
queues in round-robin order. Each machine has a normally - O5 b' }' I5 a. p$ w! f% C* n5 m
distributed processing time with a mean of 48 minutes and a standard
2 r% b& k7 w7 ?6 k; mdeviation of 5 minutes./ j8 A1 d" Q8 r& h2 d
The three machines were purchased at different times and have , g! l. ]6 [& r/ E
different failure rates. The failure and repair times are exponentially
0 q( o) ~* z  H+ u1 L# H9 Ydistributed with means as shown in the following table:
! n! m& l" z4 t' YNote The solution for this assignment is required to complete
! `; P% C. G% u1 R) n4 `exercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of + B8 |4 e/ z- V% c. Z
your model. $ m0 D$ p: P% a6 v6 f

* K0 y% ~. R; {  D' `: Y1 WMachineMean time to failMean time to repair
* W6 E9 N5 f1 _A110 minutes      5 minutes
+ V* L* V; Q! S+ y# kB 170 minutes     10 minutes5 u% G: H) w+ {7 ^0 p- q% W
C230 minutes      10 minutes
3 b, c( y. v# W- u) ?( P+ X# E) |
The machines also must be cleaned according to the following 8 n3 U" Z! m0 i/ d, x" k
schedule. All times are constant: 0 z+ s# h9 }9 z# W/ ^8 m

0 C3 Q2 R$ m( Q; B$ I# rMachineTime between cleanings Time to clean
3 w( X6 v$ y+ z/ ]. ZA90 minutes        5 minutes
1 H4 X9 R) ^' L' V# d  |' A: sB 90 minutes       5 minutes1 y5 y/ B/ J  R! m) \4 X
C90 minutes        10 minutes+ H" V: H% o2 [" [( i3 q: j$ J

8 I4 ^% l& \* O7 ?Place the graphics for the queues and the resources. 9 x4 Y3 e# Y4 r& @  m
Run the simulation for 100 days.
* Q7 [9 j9 S9 s% vDefine all failure and cleaning times using logic (rather than resource
; x' U' o; ?0 `) m$ }& acycles). Answer the following questions:& ]+ V1 a, t; @% ]
a.What was the average number of loads in the waiting queue?
. S2 c0 \# ~: s- l, qb.What were the current and average number of loads in Space?
; e8 o" J& d: U6 A  m9 j) nHow do you explain these values?
; z$ C/ f( [/ G8 Q+ Y* x

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉7 N6 Z7 T7 I: N6 v/ ^* K! s
send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)" k; T3 n* N! Q7 L: x; R
这行好像也不太对,各位先进觉得如何呢?# j5 E  q% P1 h/ C

6 Z" P9 _6 L. L) F1 `) j" D" h2 b0 Vbegin P_something arriving) F7 X0 F4 u: g) g1 D4 k
   move into Q_wait
3 t- k2 j2 J9 Y   move into nextof(Q_mA,Q_mB,Q_mC)
8 ?6 J- U* o2 Z$ |4 L- L4 P   use nextof(R_mA,R_mB,R_mC) for n 48,5 min
- \5 G' X* f. u6 o2 n   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean) : t! v! f8 v6 r, X
end5 Q3 p4 E9 c- Q& P% F5 Y
6 J; \/ H3 g" O7 E: g
begin P_mA_down arriving
# e: X0 w5 X% p+ E" d+ O3 T+ d   wait for e 110 min3 I5 i/ [7 z  M7 N8 {
   take down R_mA
( q1 p  _9 h  o   wait for e 5 min: F9 o2 s4 r! |8 j" w7 K( A2 {
   bring up R_mA
0 i. m' u6 `9 fend+ P% r: }" m- t2 ]$ B

! j5 |7 _2 q8 l$ ebegin P_mB_down arriving8 J8 {9 o& W& H
   wait for e 170 min
) N! c0 a8 g4 g1 S) w" I9 h3 S   take down R_mB4 s; O' a/ E$ d. r% r4 z
   wait for e 10 min# }1 W$ ~. O" [  t' J( q  ^* {
   bring up R_mB# ~7 X- a( K: V% z% j
end' x/ Y5 U, X/ f; X) G& J7 \( n
. G7 Z3 g$ |4 b9 q3 \7 h4 t. |
begin P_mC_down arriving
# A( [9 m! P0 w2 \$ B   wait for e 230 min! W2 H+ b/ G: Y/ ~+ ~
   take down R_mC- O, j: H9 L# p' a. i2 n
   wait for e 10 min1 ^4 q4 w+ _7 Q  h$ ^3 D
   bring up R_mC
- {2 f  }7 T' _2 B0 rend" Q5 C& a% a+ `. H

8 e( L; y; r  Gbegin P_mA_clean arriving( B1 ]' {6 [! W  X9 L
   wait for 90 min
1 ]; g& U3 W5 S  `1 C   take down R_mA
$ H7 B/ N$ M2 l. D( F' w1 M. a   wait for 5 min/ x3 W5 \4 U! Q$ U% ^& |
   bring up R_mA
) q( Z# C. o0 Z: _' R$ xend  B5 ]  O4 c$ k, D4 `0 a: O  t: s2 Z

! C, f) c1 A- p! ]begin P_mB_clean arriving7 g+ m+ C' ^- }% D7 D: B3 i
   wait for 90 min3 e6 Q5 C4 l' q0 u. U
   take down R_mB
8 P/ N& m- ^* c% O1 V   wait for 5 min
4 D. R  W( ~/ s1 `# O1 N/ X; g   bring up R_mB
1 r* C7 p, Z: K# C+ X7 D2 kend: T: J+ B  J2 k
( I  [. E! e5 ]* U( M
begin P_mC_clean arriving5 y, Q+ s! d2 ?3 V& Z/ F  ]* R
   wait for 90 min
& i9 x, l0 T. T0 L7 O# r0 Y   take down R_mC6 b! [* U. g7 X; }' @- t, w% C' K
   wait for 10 min
7 ~4 R* h* v. r+ P0 e. Z2 L; V   bring up R_mC9 W0 y# i) d& }( S9 `. J
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving' \5 ~0 A) Y6 T. W) f' o6 F+ R
   move into Q_wait
9 H+ J+ J. U- Q; O   set A_q to nextof(Q_m1,Q_m2,Q_m3)1 q% x& N; I$ n6 |2 \' _& B
   move into A_w
5 |; j# a7 m2 q6 z* f9 U/ }: j" F   if A_w=Q_m1 then use R_m1 for u 48,5 min! x  g" x3 t1 x6 [4 g7 s
   else if .....then use ....for u 48,5 min2 `: N7 U+ q" g1 q( y  j/ t! a7 {
   else if .....then use ....for u 48,5 min  
" k5 d# O" r- T9 m+ j/ {' T  m   send to die
; j4 ]: r  k: z  f  Qend( O1 N- w5 S3 N& A. q

$ u8 J. i  z- m) j( Q6 w供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-4-27 21:52 , Processed in 0.017775 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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