设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 8396|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑 . m% K: v% n& Q- q) I( ~' L
& h! C( e$ A, D' h; o/ g
底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去  v( U& X( a3 v0 u0 O1 K/ d. b# e
  Y* w, s& W$ ~0 u/ R& n% b
不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!
0 A0 V9 p% @! ]; G$ p3 b/ Y  D/ t, D- _0 l) g
--------------------------------------------
, k) R0 n( j- L+ {begin P_something arriving* r9 c4 h$ p) ]8 E) Y7 ]
   move into Q_wait
. p, L$ k* z7 O9 F# r5 T& B   move into nextof(Q_mA,Q_mB,Q_mC)* P  |: v% h5 n8 O- i1 t
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min* z. M+ G! Q) U( P9 {: ~- q. P
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
& O# n" X( w/ P( l9 M  e   send to die" Q2 A# `. R6 L) Y) ?
end
" h+ }' J& h( A# @1 A; }

$ L( s/ {7 Z. I. b, J, Jbegin P_mA_down arriving
1 u- j' E# j5 T; x7 p5 r. e3 @   while 1=1 do ! B: `& @, W$ I  e" s$ b
   begin
# L, a  H5 P3 }3 M3 m$ M6 |3 K/ D# h& F   wait for e 110 min
8 g1 @5 Z- p9 J2 y. }* l7 a9 m4 ~   take down R_mA& a' F, f9 F4 t2 g/ v
   wait for e 5 min
# j& a4 i3 ^4 J) M) b1 W0 g- N   bring up R_mA: |; j# U8 ]8 h! o
   end
3 Q& u1 H* U3 i$ f) s, @. Uend
  W- P% Q0 J8 ~* O# b# o" q, O2 C
' S$ ]8 Q- p( A! O
begin P_mB_down arriving6 X5 U9 {$ y. R5 V
   while 1=1 do$ {& U& P; @$ z' }9 X& ^
   begin
+ K) R! Y/ _5 B# {6 }   wait for e 170 min
& Y, }& W$ ?1 T& M7 K   take down R_mB  ]# h( |! |4 q8 z  g
   wait for e 10 min- @! I7 m  k# }6 h% z) ?
   bring up R_mB" Q' j& G9 J" t3 j
   end5 X) |& L! }# m% \' Q1 D+ j
end
* n! q1 C! i' g) `

) r6 H0 m7 H4 Y4 E7 w2 B: ]) Z7 e. E7 hbegin P_mC_down arriving' M% f# r  B* X/ [' _3 w! O
   while 1=1 do
3 x: R4 ^& ~2 M" B4 l/ k   begin
% Y' |0 B6 r8 v   wait for e 230 min
3 z2 L" X: e$ |3 I* g( L! A' s; y   take down R_mC
1 |: [! l9 f, _! O1 t   wait for e 10 min
9 E2 x! V! l7 n   bring up R_mC' r$ V! A4 V& \# f" o
   end
: l3 v9 a# q7 [8 j2 \end

0 X) i9 k% y: s1 ?0 I7 \ + D" Z- \3 o6 j" H6 M* I3 i  Q
begin P_mA_clean arriving
1 n8 @' L* l/ A' s) N; d   while 1=1 do
0 B; z* {& r0 [# x. B7 ]2 W   begin3 B. j) _/ ~  t& _4 @
   wait for 90 min
% ^4 r- m8 u8 v; r. m  R6 `( A   take down R_mA. c) V6 s8 b7 K0 u5 @+ x! d% L; O
   wait for 5 min
/ g( \1 g  d9 |   bring up R_mA8 X# d0 H+ N/ H7 M9 M
   end
3 H$ _) Q) h$ @& L* _' eend
% U3 p( ^( ?# V& _2 H8 w" C/ k
+ [8 `3 A4 b0 F% u' G2 l: B
begin P_mB_clean arriving
; @8 K* h7 d) c8 O4 }" ^& a, G   while 1=1 do
3 g4 E( d- z" {8 r! R3 g* c$ ?9 g4 j& M   begin
5 Y  J7 {& x4 |! p5 n6 Z   wait for 90 min7 ?4 g  Q3 f8 J& L6 `$ p
   take down R_mB
' r/ Z4 @" j+ {- S/ a5 }   wait for 5 min
6 C& h! r* o& v% Q) n   bring up R_mB; }+ B( i* F% J
   end* R3 O8 i" t' ~! N
end

1 v, d8 T6 K1 t- X8 L / z8 ~8 Y# u! s% G* V8 F5 }) |
begin P_mC_clean arriving, ~: c* m9 L* k; k8 ?
   while 1=1 do
) b* {' r6 }$ s/ C   begin4 c9 f, F/ l8 p0 T' j+ Z
   wait for 90 min; H5 [8 D! A. Q
   take down R_mC
& y' S( m+ `8 U" W$ b+ c6 L   wait for 10 min
/ ]$ }0 K( r8 D) Q   bring up R_mC
# n4 z, N' S% @/ [* T8 F6 O0 g( ^   end# s' ?3 H* {; u. j
end

8 O2 m( Q- |& d; ]1 h1 d" y+ b----------------------------------------
, @3 }2 z8 a5 p0 A2 e
4 B5 F3 c" c. Y, z. G3 OExercise 5.9
- u$ j# M3 W" s4 }
5 U2 F( K6 d: A1 P
- k, K+ q0 B3 p  f+ `- w$ v9 SCreate a new model to simulate the following system:
) Z  i8 T2 T9 b7 \! Y9 m" _Loads are created with an interarrival time that is exponentially ! t: S; r: O/ C
distributed with a mean of 20 minutes. Loads wait in an infinite-" F% T) ~+ N$ }  O) g
capacity queue to be processed by one of three single-capacity,
3 |. T* p5 T  \) I- ?' J$ O7 }arrayed machines. Each machine has its own single-capacity queue
- J" @, z% ~% o6 y0 }6 r, Q. Q& ^' \where loads are processed. Waiting loads move into one of the three
6 {& ], m: [, x) D, Jqueues in round-robin order. Each machine has a normally   Q( R  j: n8 p4 R1 F9 O3 A
distributed processing time with a mean of 48 minutes and a standard 2 o7 X- O2 d5 n( K; O% k+ a# z
deviation of 5 minutes.
6 t( ^' L- |2 _: r8 n8 M* aThe three machines were purchased at different times and have
$ @% A. U+ m% p% [/ Q* k2 `4 Hdifferent failure rates. The failure and repair times are exponentially
, p, P% t: B" v1 d% o2 adistributed with means as shown in the following table:
% e7 Y4 g: `! `& cNote The solution for this assignment is required to complete
7 q4 H/ X# V. c- r" a1 [5 C9 cexercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
" ^/ Q4 J+ o8 v' Wyour model.
' M9 N' Z/ @! y/ I  ?/ C6 y6 H9 L' v; W7 X) E( Y3 i4 T$ m1 L
MachineMean time to failMean time to repair
' ~, v9 z$ C( x: i9 ]: HA110 minutes      5 minutes
+ {$ M$ ?2 `7 hB 170 minutes     10 minutes, W5 D. O8 U# s& u( i; B7 i
C230 minutes      10 minutes% Z! ~* _% q  b! f' |/ p# a2 F/ d: _

3 R- K- n0 K/ Y7 d* TThe machines also must be cleaned according to the following
( k. j$ `; ]' }, Y* hschedule. All times are constant:
+ u- R+ O3 A# `2 y$ b; a* A/ `8 W, V8 {' |
MachineTime between cleanings Time to clean
7 \/ r* v: J7 g! A7 ?2 ?' \A90 minutes        5 minutes
! P1 B0 M  d' PB 90 minutes       5 minutes
) J6 q7 x3 a6 S! X& ?! @- aC90 minutes        10 minutes
: E1 v) O" L2 p. \  b
$ O; k: S3 `( R, W+ pPlace the graphics for the queues and the resources.
4 x# D4 @# U& o. V! |1 {  W5 `Run the simulation for 100 days.
6 u1 s8 p& T3 L% S1 _Define all failure and cleaning times using logic (rather than resource
1 W) [0 g  y# J( d$ wcycles). Answer the following questions:* d; w0 D" @/ D
a.What was the average number of loads in the waiting queue?
9 `# b9 K) n9 \% pb.What were the current and average number of loads in Space? 3 G0 K; m# v3 [% ?
How do you explain these values? ( C( r2 x9 j& Q, b) n

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉, o) I2 J/ Q9 f; y: m% j5 a
send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
6 k0 Y+ `: p; h  n这行好像也不太对,各位先进觉得如何呢?
/ `2 f; B. t& A$ m1 ~, B* H
; c, I$ C9 z% X- hbegin P_something arriving4 c2 }+ v; m+ V* n6 T+ C! }
   move into Q_wait
3 M# j1 w9 f, Q( i, F   move into nextof(Q_mA,Q_mB,Q_mC) " a! `" b- i3 o5 I5 M6 [8 y9 r
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min
& w: Q5 x/ T- i6 {9 X, z( i/ [   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
. Z/ t" }* R+ W6 Kend
; ?% A  a2 Y' Q$ E% e, J0 o3 ?4 b% P
4 B- Q1 w# s- ]! c! t6 l( Hbegin P_mA_down arriving
  A- L3 z1 v: h- `' d, T7 `5 }   wait for e 110 min% [- K4 |  g: ~! q5 F' m
   take down R_mA
1 N9 h+ `' k! p( I/ Q   wait for e 5 min
9 Z4 Z; }9 H3 g% [   bring up R_mA
( J* M% y) ^, _  H7 ^" d) ^end
- A1 ^) O6 X) s) m! |9 @5 z& L3 G1 Q. ~0 j9 q5 s7 q2 r% X; N$ z. _
begin P_mB_down arriving6 s& N6 n0 F/ d4 i6 j
   wait for e 170 min1 b! g, h8 I% P& v' a0 H0 M
   take down R_mB
# h) ~4 o* V1 t   wait for e 10 min
  U* f9 m# Q8 m. Y) Z# O   bring up R_mB
$ h. _1 H( ^6 }, \" l. @& Qend/ [. K, y7 v* q: v7 V' w% O

7 p2 F9 ^' R( \: D2 {1 ybegin P_mC_down arriving
2 V/ w/ A$ |* H+ _/ D0 L; ^: G6 L: d   wait for e 230 min* ~+ t6 W  {0 e7 l5 D0 [
   take down R_mC. I5 u0 y: w4 l* O
   wait for e 10 min
# |* I  }) r! w   bring up R_mC  W( D0 S) H. n$ V+ g4 l: \
end
& @. |/ j& C" S# @* |% F
( l. X+ o2 P6 Jbegin P_mA_clean arriving
% m* U8 x( ^$ H  i0 U' a, M6 X* o   wait for 90 min( u/ h- T3 |: B' r# r* \
   take down R_mA/ S( g% u1 c6 w. ], \
   wait for 5 min. j- f7 o- M$ l8 Z; r4 X* s
   bring up R_mA
- S! D) a+ a3 W; u* A' g% gend
, `( b, F4 w2 @, }
% R2 D& j% S( |% h) lbegin P_mB_clean arriving
9 b: o/ U# @! C7 r& w( \$ t2 R; T1 T   wait for 90 min
- Y% a1 I2 G* ^* E6 _, H   take down R_mB
" v2 z9 z, z9 Q! z$ E" z   wait for 5 min
) a0 v1 t. x6 R$ J   bring up R_mB
$ e" ]9 W9 n/ `1 }2 e1 xend
4 i1 a& V6 @$ ~% k0 `7 J& ?, I# d+ y, s1 i- V% J8 ^/ D+ o
begin P_mC_clean arriving
  m* {9 r- D5 W! Y( K   wait for 90 min0 w' U- j/ w( Y2 z9 S( ^
   take down R_mC
2 i; N/ e+ M4 |   wait for 10 min
6 ^1 p: V2 y) A0 \   bring up R_mC
/ j0 c3 F7 Q7 I* x0 a7 h, rend
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
% |8 A; V/ D+ x( F/ s   move into Q_wait0 j3 @3 Q2 H9 Y6 _9 Q# `1 `: k! O
   set A_q to nextof(Q_m1,Q_m2,Q_m3)
7 X4 j! D, \- H1 X6 r- s   move into A_w7 G* U/ `" X3 |4 U
   if A_w=Q_m1 then use R_m1 for u 48,5 min
) N( F* w" F0 i7 r7 I   else if .....then use ....for u 48,5 min
1 w4 f" ]9 x# W, \" D, u   else if .....then use ....for u 48,5 min  
0 P+ {! A- }0 d. u+ {; o1 ]! }" d" X/ y   send to die6 T2 Z- ]. K9 V  I
end
0 O% D4 V7 _! a0 S: q: Q; L( e8 x
) P0 r5 q2 L7 G8 u供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-9-4 04:49 , Processed in 0.014845 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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