设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5144|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
9 f( W  v/ G; M* [# x( B+ _: X2 l, w/ Q" S9 @8 }9 \
底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去
9 ~) }4 r, E' j' S: C! ]& [" }4 ]7 n8 A6 q/ }$ m% g3 T# X/ w
不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!  x7 W. J( j2 w" M( k
: I9 J$ T) r( d: ^  @0 Q
--------------------------------------------
- G+ ~# E3 d, s% l: q' ?begin P_something arriving+ I6 S' B( x* Q
   move into Q_wait/ T# J/ \5 N* n& r! a. L9 H
   move into nextof(Q_mA,Q_mB,Q_mC)) K  x! z( H; L) C$ f. _' M
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min" l) P1 a$ s, @6 f- P* z+ I
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)) y! k5 n# C9 u( c* b" g' U
   send to die
. ~2 a; _, d: F( H, s/ J0 e3 x! Z7 oend

2 h8 A) }% P, F$ f1 e% N 1 @7 \& A. |( `# D8 r1 a
begin P_mA_down arriving
/ k: q! t. d2 K8 w# O   while 1=1 do , t  |3 T/ P; b5 ?2 L
   begin: u0 J5 }; b7 j' r$ t3 ~1 G
   wait for e 110 min
# D4 {& G8 E! Q5 f   take down R_mA
/ n& \$ C* j8 }. n  J$ {   wait for e 5 min# K, y5 {- E" l6 J7 [: ^
   bring up R_mA8 X- d/ O8 o( ^9 d0 @
   end# J. z1 u, g/ d9 p# i
end
  |6 k5 i7 m$ e. I' ^$ w

. g' E$ ]0 ?, y  O2 V) y9 T1 e  W5 J) {begin P_mB_down arriving
* e+ n1 H0 J+ r- L; ?   while 1=1 do
/ V; \% V6 ?- X2 f  S   begin5 l, y* |5 ]! l5 U9 L- W6 ?
   wait for e 170 min$ M" q! a8 v4 C( R+ K, A
   take down R_mB% A; c( ]* V9 K: e. I
   wait for e 10 min
) ~% }' }1 t0 ]8 o6 t' I: j   bring up R_mB  \& l4 @8 Q) g% T) x, d' o2 O
   end! Y) T% M6 [8 y" z0 }! @/ v
end

, P; z/ w+ |1 s2 A. F; P
. o0 `8 u# |: L3 g* Y  Gbegin P_mC_down arriving+ |- W) M6 k; E- X- u4 ~8 ~
   while 1=1 do 1 V( b+ a& U" y/ S; Y
   begin
' K$ K& f: P3 f# E" b* @   wait for e 230 min
" k8 r+ M  o: C% i) L) `! f   take down R_mC
5 X5 L, K' q0 w+ _* I   wait for e 10 min. @4 k- J5 @. J) M
   bring up R_mC6 F+ Y. Y0 X  S8 d
   end
3 A9 n) Z; W2 ~' wend

6 U1 o: ~9 X# }6 z1 V* |8 r# p # x& l2 n1 L& u0 F' z' O
begin P_mA_clean arriving
  z/ ~1 L# @! j% e, R   while 1=1 do
4 F( K4 G1 o8 `/ }0 B   begin
2 q# j3 k( W' z7 q   wait for 90 min
  g& Q0 o9 W. x  i5 i   take down R_mA+ L4 D% ?8 N- F* T: ^1 n
   wait for 5 min
9 _1 a" F' O: S5 |/ I   bring up R_mA' B8 v# |& t  x* H8 {" F- f6 t, a* u
   end: A  l/ r4 u: R; x/ O
end

5 g# G8 ]% s  I1 Q8 q0 b  z. c: J 7 H& }' G' u2 C' K0 R- L
begin P_mB_clean arriving1 m* U9 P! f. ]0 e2 Q& j  ~  O
   while 1=1 do8 n; W+ b/ H# N7 ~1 E2 {! E% i
   begin7 V9 G- Q2 i; t/ |0 @4 q- L
   wait for 90 min
" s" Q% k/ \9 ^   take down R_mB$ a; b& z+ M( H+ R7 |- \/ g
   wait for 5 min; x* P5 L/ n; s7 L  z
   bring up R_mB4 l, P5 |5 H+ {4 v) a/ x6 W
   end. o- R) _& _% H9 i% G1 v$ ^
end

' @( W5 a% H2 M) v  M1 B
0 h. z8 b) c3 T3 K" Hbegin P_mC_clean arriving
) U3 i2 S' A- b6 ^, B+ y   while 1=1 do! k8 k. L7 e) Z) V( A
   begin& o- ]( d0 m% K# R+ t, [
   wait for 90 min
- q. M* v9 B3 `) s: t0 I8 {   take down R_mC
1 q7 r5 h1 D1 P8 c* x  J/ y   wait for 10 min
' K- H& `& l0 m, x3 X7 [2 F# c9 k* Y   bring up R_mC" P  T" R4 k5 |0 R
   end& Q, _& C. V: N. p) O( R. G: l( V( m
end

6 k# O- a! J7 I& D----------------------------------------
1 f3 X3 I2 ^+ T$ `. Q
8 L4 P+ t, \7 ]" \7 n" oExercise 5.9
. y3 J& l) V) E) M
  \5 }, v4 h* g) F! I
6 p# _. ?, q# y4 sCreate a new model to simulate the following system:- C( x0 e$ z: f/ @
Loads are created with an interarrival time that is exponentially
. a/ ~- ?9 C! _. g6 Adistributed with a mean of 20 minutes. Loads wait in an infinite-
0 U$ X7 g4 B) g; z- X. g* Tcapacity queue to be processed by one of three single-capacity,
$ Y  d* v# f1 C( u7 G* Y/ marrayed machines. Each machine has its own single-capacity queue
1 N! F0 {4 F: ~9 o9 l5 O4 ^7 D  awhere loads are processed. Waiting loads move into one of the three
1 c2 j( v9 r' F5 i; Aqueues in round-robin order. Each machine has a normally 8 M! @; D' u  a6 K8 @
distributed processing time with a mean of 48 minutes and a standard
; P8 j% z3 f4 A' S2 Sdeviation of 5 minutes.& ?& j. p. l2 [% U
The three machines were purchased at different times and have 5 ~- @* @! D  W: E! @$ `: T2 N
different failure rates. The failure and repair times are exponentially 6 [5 j0 E: z* J9 @6 w! j3 u
distributed with means as shown in the following table:
: @& Q, `0 q* S! S/ QNote The solution for this assignment is required to complete
6 ^( ]' b/ i8 ?: ]6 P6 `7 {exercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of * w# Z+ P; A. m- L: I* k+ P& A
your model.
1 Z5 ?4 }/ y! A' ~3 B. ^. j5 f' x! t4 w- r+ h
MachineMean time to failMean time to repair
5 y4 w! D, U4 D' FA110 minutes      5 minutes
! y' B3 t# n4 K# m  lB 170 minutes     10 minutes! h5 q- e2 b) j/ g3 u
C230 minutes      10 minutes+ l5 G( o1 X7 W# @1 U: `8 K
% ?/ y' p9 z6 ?% n
The machines also must be cleaned according to the following ( d, T  i% S3 g) s0 Q% x
schedule. All times are constant:
5 R: M) o8 o3 d' r9 ^* `7 u; T& ^1 ^1 j0 s& T
MachineTime between cleanings Time to clean
( \. b' k6 Q! U( ~A90 minutes        5 minutes
1 f" N( s/ q) zB 90 minutes       5 minutes6 B7 s4 n! I. `1 t, x/ r
C90 minutes        10 minutes) m& A/ x6 P2 ?4 w

+ e, `  ^) }* V4 zPlace the graphics for the queues and the resources.
4 a$ a/ ~* @# l* URun the simulation for 100 days.
4 @6 f7 @' [) ODefine all failure and cleaning times using logic (rather than resource % I/ r$ C5 V) d+ D; n
cycles). Answer the following questions:
; {8 z: K+ j: |4 Sa.What was the average number of loads in the waiting queue?
# {: U% [0 _+ M/ H& |: Jb.What were the current and average number of loads in Space? * P3 l; R% c# }% q+ o( m4 I
How do you explain these values? 7 b0 K: A8 c! A  E

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
) p% R, j6 S" ]- e8 ]3 [4 ~5 tsend to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)- a/ }/ l4 \6 K! ^
这行好像也不太对,各位先进觉得如何呢?8 A+ \- I; C" Q, S8 d2 U
! ~$ R% Y! c8 j/ A
begin P_something arriving
0 L7 w. F3 H1 e2 q0 q/ E" S   move into Q_wait: m% }  _1 n' n( I+ M1 N
   move into nextof(Q_mA,Q_mB,Q_mC) 7 a) Q7 Z, {0 [8 B3 B3 ~
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min- s- z( P, |& e4 y
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean) + n. V4 F8 C2 a3 w# p
end& L: B7 k/ w+ {' v' a
1 M6 F9 n: K) x
begin P_mA_down arriving
) f, K) w% b) C: J   wait for e 110 min
5 Y( ^9 E, P9 o* i/ a4 i   take down R_mA
# F3 D& I5 j  g, D; t) d   wait for e 5 min  M' w, A- Z5 ?  p- Q! |+ y
   bring up R_mA/ o, @8 Z! ~* }6 D; r
end& b$ s  g3 S- _! W& D' V
; E$ `, y; u# K
begin P_mB_down arriving# J9 E% s' z" Z
   wait for e 170 min4 x" i. V8 `  e1 {/ l. s
   take down R_mB
$ L4 `7 T) P: L7 j   wait for e 10 min
. D8 _: x& ~! z) [8 q/ \   bring up R_mB
" y8 K/ b, Z4 H+ ]$ E  Q1 N9 Eend
6 Z, R% W  f  r( f; [2 R: t$ I5 d3 f* K
" I9 ?* R/ P2 xbegin P_mC_down arriving
; t" ~- ?7 m4 Z# o0 x3 ~$ I' Z   wait for e 230 min1 W0 N! v6 o6 f) ^0 i, B6 Z
   take down R_mC
3 r. o4 `" J, j+ W& j$ g0 s   wait for e 10 min. G$ b! Y5 ]4 r6 w" y
   bring up R_mC" {+ T+ ]3 l" c5 w9 V, K8 M
end
2 z9 I6 @! \" x: G- i4 A, w% @$ M# A. t; F+ W7 k+ O  n* u$ m) Z
begin P_mA_clean arriving
, Y* E( c4 O  v* K# ]4 d7 S   wait for 90 min
! S6 E1 t) L1 w2 o   take down R_mA( [* f6 G1 W0 Q# m& L8 M
   wait for 5 min; S- J6 ]2 H" }% m) V' u& l0 h
   bring up R_mA
$ }/ M- G) L6 a) cend& K8 d2 |) D' D) ^: ]% l, \  s
/ C' B5 u$ r6 E/ i, G5 \
begin P_mB_clean arriving
' a9 S5 h' L. \: s$ v   wait for 90 min
( D& J! K& h; _* s: }" v1 {   take down R_mB
: A2 J! u9 G; a: n, ~   wait for 5 min2 d# ~) h0 w. O1 n: ~2 u! }7 ]/ \
   bring up R_mB
; Z$ O1 s9 _  k6 dend
, g, E+ ^1 H- i! @( q" e; ^5 X1 {4 |3 @# b# Z: ?# J, A1 C& _
begin P_mC_clean arriving4 }0 q- P2 l, r3 }' d8 v" F2 N
   wait for 90 min$ x% x- K; N. @% O$ b% ^/ Z- ?
   take down R_mC2 a) M% m  Y+ e* {! e
   wait for 10 min7 w  Y0 _1 R  b4 y0 r8 |7 o
   bring up R_mC, {8 _% j+ ]& {5 j. `8 W
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
5 G( q5 h2 I' K- m   move into Q_wait0 E' r- I; K7 M- G
   set A_q to nextof(Q_m1,Q_m2,Q_m3); N0 }, d1 S5 `0 {% c+ Q; i
   move into A_w- _  r, j. H' n% ^
   if A_w=Q_m1 then use R_m1 for u 48,5 min8 {! K+ H" p0 _6 F* u. A
   else if .....then use ....for u 48,5 min8 n, m" Q; d* [! R: q& a
   else if .....then use ....for u 48,5 min  
" \/ z4 ~1 F% X* M3 ]: [   send to die
6 Z6 u. |# o8 d6 u, Vend
/ x( @6 ^) g1 e
5 p  G/ O! N* Q6 I/ G供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-6-4 07:21 , Processed in 0.011746 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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