设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7271|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
0 x5 h5 }6 N# p1 r/ f. E" @, q' L) ~- c( z
底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去! z8 `6 Q) Z# K. C( u4 L
4 |: Q/ {1 K+ N
不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!
8 e+ O: F2 \9 z  L: [! {% \$ {4 Q$ C4 S  N0 C
--------------------------------------------
0 `+ p- H+ x- l% z5 `( L& Q- ubegin P_something arriving) {! ?  n0 p7 ^) V$ I' g" `
   move into Q_wait
8 E* y$ G9 B6 o* p   move into nextof(Q_mA,Q_mB,Q_mC)' |! l8 ?! O! K' z5 R$ ]
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min9 ^! |+ g/ q# O3 g( O2 z, t
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
7 {  x9 N0 r1 x$ X8 C   send to die- m- a% P) N+ O6 k5 u% w$ ?
end

9 P& N3 J6 f+ v # M; C9 \3 e5 k0 W1 k; j: b7 K
begin P_mA_down arriving# p( M) Q& u1 I* h* J# p
   while 1=1 do
6 P$ q/ }/ n9 ?   begin
6 f1 ]. `; k3 f, `- f   wait for e 110 min- t% q$ U, e" `, D: ?
   take down R_mA
& ~" J5 U% D. d* M' S   wait for e 5 min0 \; s  s( R% W' q# V$ c! c/ M
   bring up R_mA8 ^% w& h: K/ G+ ]
   end  X  D1 Y; h+ k5 {$ q$ p7 |
end
7 H+ q1 z+ F2 s6 G; n

: S9 o% [( V' [9 {' Xbegin P_mB_down arriving
+ e1 Y, A6 I) @+ f+ v% H/ R' p# Q/ y   while 1=1 do
3 k  i# `& l: G5 h   begin
0 c! U! O$ f% J2 h/ O   wait for e 170 min" `3 }; f7 Y1 r5 V2 S
   take down R_mB# H; B' k( f0 w- c: g) m# O
   wait for e 10 min
3 A# A8 R- G5 a/ `   bring up R_mB
# f# c& I8 `9 w9 X   end
2 |5 m0 D( I: D3 G/ N, cend

4 Y$ b. E0 o2 p! L
) f' B2 o2 T) x, a0 n' k: B) p$ H; Lbegin P_mC_down arriving& u0 u" X0 }, @- _8 @+ `: M. Q
   while 1=1 do + }/ H* w' |9 O; h
   begin
# f% }- A4 h8 W& Q( _   wait for e 230 min& S! }( }+ f0 \0 t6 E* O
   take down R_mC& Q3 O7 f: r4 y. ?% w% e" x; e
   wait for e 10 min
9 Z% Q9 @; U! K   bring up R_mC( O" a  e- q  c4 y8 U. L4 U
   end
* L5 ^* ^5 N: A' G0 P4 \% @: Iend

& W" n7 R3 W8 F: [ + N# x: d; @: x7 v
begin P_mA_clean arriving- f3 F5 ^- b" N# F) [
   while 1=1 do) [. [2 }6 ^1 B7 i
   begin
; H  J7 s4 J" ^6 _' R5 K3 Z( S; F   wait for 90 min
# N; P6 ]1 \8 i5 x: O2 R) L   take down R_mA
9 ~0 d1 M$ _9 P  ~   wait for 5 min  R# l* z: V7 @/ [* H
   bring up R_mA
& u; S- `) T, G/ I/ r6 k   end$ w! B8 p/ `5 g/ J4 o0 |
end

) F8 i9 H3 O( e- l4 j" _ ; h1 I# S9 C! Y! h7 C1 t" x1 x0 ~
begin P_mB_clean arriving9 Q' K/ j; D0 }+ v6 D
   while 1=1 do
8 X' N. f' [; h  N: }# O0 O   begin. B/ }4 o1 V0 G3 @7 ?4 u3 a9 o
   wait for 90 min
' e5 n  i$ W4 T0 {$ h. ~4 u   take down R_mB
) c9 m+ L; E0 H1 t8 c2 n   wait for 5 min/ ]; F# E5 w7 K! ~; U; N' U
   bring up R_mB  f8 X6 ~; T# _% ^" _' n1 ^6 ^
   end
( O! o$ V0 s2 y+ aend

; Z* s/ f; y$ j; u. D" v# ?& {7 k4 F, F
4 o5 P) v5 a3 M+ e. h. `; nbegin P_mC_clean arriving
" c( R( j! I! T( q) {6 `% k   while 1=1 do- [. b. A9 |& L! V$ n
   begin" d0 c' `9 ~  l9 i
   wait for 90 min
2 ~9 t4 r7 a. w3 L% U9 ~   take down R_mC* E; b: p- {& X9 C
   wait for 10 min
5 x1 ^- a/ B( |  q9 Q   bring up R_mC
8 }1 o% B+ Y6 A- U, j9 ?6 ]  H   end1 R3 o+ g0 }4 R  V0 u. e
end

3 e7 O5 g  v6 H% m! }# _6 Z- o----------------------------------------
6 h  Z! y  W: @* X# I8 f ; m6 t5 l9 n4 Z
Exercise 5.9
0 ^8 Q* K7 J; e; p7 s& B" ^  _; w$ r) f

: E$ x! }  T0 I+ l" l2 lCreate a new model to simulate the following system:
; D0 C3 D4 _* s- C2 ELoads are created with an interarrival time that is exponentially : b8 g1 M2 L0 d, x
distributed with a mean of 20 minutes. Loads wait in an infinite-
1 Q1 e# E, I# x6 Z2 rcapacity queue to be processed by one of three single-capacity, # A5 o$ Z4 W! l" T
arrayed machines. Each machine has its own single-capacity queue
0 u4 W, V5 U5 |. l) |where loads are processed. Waiting loads move into one of the three # Z; O  y- e- L% o0 ]
queues in round-robin order. Each machine has a normally
1 n2 V4 W. e% ndistributed processing time with a mean of 48 minutes and a standard * [/ F. ]$ c4 T$ U
deviation of 5 minutes.) q2 @# w" x* w6 m% d
The three machines were purchased at different times and have 2 n6 ]6 @4 ~+ }) Q: q* X7 s! ]
different failure rates. The failure and repair times are exponentially ) b& D7 [7 A* U  e
distributed with means as shown in the following table:
0 T* }. K6 K8 n; E) ?Note The solution for this assignment is required to complete
7 W" J8 u7 T0 t/ \! [exercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
; D: [' t% d' L2 h4 ~your model. % x( k& q: L$ e
% G' I. o7 [9 x# p) {( h
MachineMean time to failMean time to repair
3 s" S3 t, c6 a. IA110 minutes      5 minutes' m) ?9 Z3 E5 B+ w# K! U
B 170 minutes     10 minutes
2 k/ b4 X" H$ A5 w+ V8 H( p1 J3 }C230 minutes      10 minutes
1 W! b7 ^8 F+ U0 u6 H) F
5 ~( m: j2 d7 E7 C: r1 sThe machines also must be cleaned according to the following 6 u( R+ Y/ b- i3 A1 m/ U
schedule. All times are constant: 6 K  d% O* }, g1 q9 B

6 }$ m# u' s' CMachineTime between cleanings Time to clean3 c  t6 A+ o4 Y5 U: k9 A
A90 minutes        5 minutes
0 B6 l! M. W$ k. WB 90 minutes       5 minutes, `* E5 Q8 r1 c5 W4 t" f
C90 minutes        10 minutes
, g5 i5 x+ s7 j/ ]! Z% L2 ~# A4 R; z5 N+ a4 O
Place the graphics for the queues and the resources.
! ]( g3 `$ \% d( N/ ?* fRun the simulation for 100 days./ r4 Q* W2 y+ x
Define all failure and cleaning times using logic (rather than resource 9 q* K5 c# o/ [* ?$ z  v  U
cycles). Answer the following questions:
$ |' _' D3 T) h  U) ]; P" Q0 w5 Qa.What was the average number of loads in the waiting queue?
6 b" y. [& y  ^; K0 R: cb.What were the current and average number of loads in Space? 1 u9 D) a* C- j8 n: t
How do you explain these values?
' C8 ?2 O. {3 O3 N' V1 D

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
- V0 b+ R% J: h$ D1 msend to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)  N, K& p; V3 o. k. z* Y
这行好像也不太对,各位先进觉得如何呢?& q8 b+ ^: W" s: W2 _: ]  x
" g& a* d' F- z6 y3 z, [
begin P_something arriving+ j) Q8 t. R; X& w
   move into Q_wait/ h0 g7 j6 I' X% w( I% ]
   move into nextof(Q_mA,Q_mB,Q_mC) 0 z2 j% ?4 m/ v* x
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min8 b( J2 A; T2 m) R3 f) i9 h
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean) * {% k' L7 w0 H
end
. V7 k$ x# n9 R+ d$ d) ], [1 \% U" S& ?
5 E, |1 s3 o" d7 w( c3 b& v/ Abegin P_mA_down arriving+ d8 E1 T, ?+ r, H
   wait for e 110 min# L6 j  I+ @. m6 {  N% R7 ]. K9 T+ t1 W; B
   take down R_mA
5 g1 {/ z# E7 e2 A. |   wait for e 5 min- [- K/ e% X& O4 c
   bring up R_mA4 x# ]  g9 t& W
end
+ U, p  g- t+ Z. n
6 u. K" K: i; s6 N3 i6 \begin P_mB_down arriving
3 @0 ~6 B7 s0 `9 I   wait for e 170 min& e" F/ h7 x7 b& P$ ^+ k. w
   take down R_mB
: {1 h9 k0 T" n9 K2 o4 r   wait for e 10 min  z6 f' ]3 G( U$ S4 I6 ~+ C6 R+ v( }
   bring up R_mB; E: S3 U; f" \# J( e0 U8 Z
end1 y4 W( ^  ~, P, x( E

1 J: I8 |2 p: T; T! Tbegin P_mC_down arriving
9 x- v# B2 ]0 J( Q6 c5 S. i: @   wait for e 230 min$ M+ d8 N6 o) p
   take down R_mC
, d, ]( }2 x- I* ]   wait for e 10 min
+ m. G% R2 `7 k9 \' C: f/ R   bring up R_mC
0 J8 w( v' C0 p4 ^end  K. m3 x" s! c7 Q+ C

7 `" {+ Y- ]: z: c2 R  Sbegin P_mA_clean arriving
9 V! ~. X" r2 P- ^1 W( G3 M2 I7 j   wait for 90 min9 A, t  `4 ]/ K- c6 {3 b; C( A9 u
   take down R_mA, J. l) h8 X' ~+ b3 D' {4 g
   wait for 5 min* p9 G0 }' v: j- k7 Y0 K
   bring up R_mA
: |: b- w2 N: B) C, |- d( k$ }8 Tend
3 c. k* L. W' p2 {% N
& p0 p8 W8 r  ibegin P_mB_clean arriving
$ I4 N6 Y- O( g6 W2 a& y   wait for 90 min
" H% l) S  ^- h1 `  o$ R8 e   take down R_mB
, `# |1 Z; P! w  ?4 C  S# P   wait for 5 min* R9 v9 i- k/ p% l, I
   bring up R_mB/ E- x7 f( e. y* O4 @3 J
end
* [5 p% p1 j7 \- p6 W2 u3 ~) Y, u* s* U
begin P_mC_clean arriving
" p  j7 T( c1 @6 b% b   wait for 90 min
4 p+ R) s) c- Z& V   take down R_mC9 W2 H* D* T" {( W: ~- k- y6 ^6 O" ?
   wait for 10 min
9 ~( U7 s" P/ O   bring up R_mC. s8 L" q; }& ?# ]  l7 G, }
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
; ]5 }( z, n% B   move into Q_wait  T' m! G: y8 R2 k
   set A_q to nextof(Q_m1,Q_m2,Q_m3)# i( S" c1 O# G( U+ ^
   move into A_w
' ?$ i, n1 ^) \0 t7 d' U! w. k   if A_w=Q_m1 then use R_m1 for u 48,5 min. l: H. H" Q' B, M2 d" t
   else if .....then use ....for u 48,5 min3 a2 c: }( Y+ n7 U) m# p
   else if .....then use ....for u 48,5 min  : J) g7 O2 D0 ]& v9 ^: W
   send to die
. ]4 ^/ Z* l6 E0 J* iend
, G$ m( n) c) X. L( E9 V
2 d0 _. w) X" ?# {5 G, W& t供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-11-22 17:44 , Processed in 0.017518 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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