设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7784|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
+ e2 ?0 u* w( s/ H8 X7 o5 m1 h( b" h5 p+ G' v  R9 O
底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去' x$ e. P& J" l0 Y. I

% h' B" b" p9 i% x: X不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!' `9 G( H9 `4 K" Y8 w- p9 R

% N2 _9 A, P3 H7 p8 s, ^6 r. p
--------------------------------------------
4 v- `( s; d9 {2 b6 `" @begin P_something arriving
8 Y' }" \9 D  E+ U' ~   move into Q_wait
  k# u, J5 U  j0 u   move into nextof(Q_mA,Q_mB,Q_mC)1 C2 m1 R5 N% J7 R7 @
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min5 w. V7 A8 y- Q: i% V
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
+ ~! X: v: W7 D8 Q4 }  _  i   send to die
9 l- o! c+ \) \" _: s2 `end

* Q, L. ?1 A3 q- l$ f. i
: B' A2 P1 ]( [2 ~8 t* lbegin P_mA_down arriving; T, W, c: z) r6 r* W0 j  H
   while 1=1 do 5 m/ N0 r8 j! }; a' t' k0 N8 v* T6 O
   begin
) w. t5 g& ~* z  t7 K# g   wait for e 110 min: O0 q! E* K2 M  y7 p
   take down R_mA
' S7 o+ f( j+ v/ g; K& O6 {   wait for e 5 min
  Z- h3 L( _- s8 B   bring up R_mA0 f3 h; ?) q/ s
   end
! G: p4 ?( j! a2 p- @$ w8 T8 Pend
- G1 C+ V5 g  f4 O# g& Y8 b8 a, b
5 A  @5 ~! ^) z0 U" \8 E
begin P_mB_down arriving) i6 @2 d8 a: G2 i! I" A
   while 1=1 do3 z/ r+ |" p, c
   begin, g, I. w# {9 g2 X/ ?5 H
   wait for e 170 min
) |4 O6 G  }: r# G. q( c$ s: s1 g   take down R_mB, w) H; f  |9 x3 A3 d) s6 [* h
   wait for e 10 min
# m$ A8 W& O1 {* ^   bring up R_mB" C- \2 x* Y3 l' u7 b2 C
   end4 h( G+ T  _1 b: V' W
end

. ~5 `- ^& q( J( d6 [ 8 H2 T7 s  F! v( s9 b3 t& J
begin P_mC_down arriving
8 D& f7 T3 l) G; N9 `   while 1=1 do
5 Q' D$ k' d$ O   begin
8 C9 f& H* d. F1 \  t' t* F   wait for e 230 min% ^: }' b7 A' o, E  m1 f
   take down R_mC
9 T# J! l! l0 q# E   wait for e 10 min3 C1 m( U  q% N8 C, j
   bring up R_mC
( w) D: n* M2 J( ^: D   end9 f/ E3 ?# B8 n- t* g0 D" S
end
8 O  t" z$ O/ x& H+ V9 A

5 g3 O+ v- [5 K$ C4 T$ E' Zbegin P_mA_clean arriving* k3 D+ x* _1 R
   while 1=1 do
5 a% z2 m, |0 v' a; b   begin' ?0 O& C- {8 [! K( d' O4 [
   wait for 90 min
( q7 e% Y( J2 J' d! H" {; [   take down R_mA
6 O& h; R; J7 Q% j; v$ G   wait for 5 min
/ {1 Y2 w/ u/ |# e. e5 ~9 N   bring up R_mA
, L  F0 y! i; F, T5 P( o   end
+ Y! E2 \" n2 m! |. aend
7 S0 [5 j/ w( l# m# L2 j
, j, R2 X9 ^& K8 ~$ K
begin P_mB_clean arriving
( r; Y2 H& J4 g4 m   while 1=1 do
9 }8 P$ [4 U1 b8 O   begin5 c0 \4 d# z/ v( ~2 d: V
   wait for 90 min& D8 a; G' v, _+ s( A% q; \
   take down R_mB; m' m2 P' W# K/ d, `3 F+ T% c
   wait for 5 min9 U: W. p% U6 {8 t+ |
   bring up R_mB7 Y! u9 b# Y4 [3 z5 Q4 Z8 ^
   end7 ~8 ^: [. v% s- L
end

0 J& O5 z) Y9 I- N
. v+ g1 e7 l* Cbegin P_mC_clean arriving
! U8 ?" r. U5 N& C   while 1=1 do9 A$ v) [7 M4 c
   begin* d: C: @: K- k% \9 m
   wait for 90 min- J% M  Z9 n/ y4 ]# s+ A9 X
   take down R_mC
0 S$ Z% e- d% }+ z5 ?   wait for 10 min) O$ K5 x7 W2 P" k+ O! Y
   bring up R_mC
  e' \* ?. ]$ ]" G; w   end8 m$ j- C( x7 t- Z
end

8 }: C+ M8 ~. @* |5 y----------------------------------------
* d, ?5 F$ \' |, ^ 4 E9 R. N/ }& G
Exercise 5.9
; g! v& y- ?; H  {5 i% y5 v) m( l" U4 ~6 E# Q

. N, P; ?6 e9 wCreate a new model to simulate the following system:/ S, G: a, t. b$ ]
Loads are created with an interarrival time that is exponentially
, W/ X; ]" E) X4 x$ O) z% \+ H( ydistributed with a mean of 20 minutes. Loads wait in an infinite-7 R  R" E2 c6 A+ _2 {6 F
capacity queue to be processed by one of three single-capacity, # j8 w# \) F- l" q0 T
arrayed machines. Each machine has its own single-capacity queue 6 P4 q0 t( v1 U
where loads are processed. Waiting loads move into one of the three % F( j* F! m4 Y6 J
queues in round-robin order. Each machine has a normally ! o. b/ c' V+ L: H: f* ~1 w9 {
distributed processing time with a mean of 48 minutes and a standard
% ~" w* t% t! y! t  z1 q3 V8 Vdeviation of 5 minutes.) ]4 {) P) I% Q+ R8 y) h* i
The three machines were purchased at different times and have
3 L$ G4 ?2 J( d% {8 t7 Cdifferent failure rates. The failure and repair times are exponentially
3 Y$ j# _' c5 n$ B% y3 ?distributed with means as shown in the following table:
0 f2 C  n) b/ Q3 i- l8 mNote The solution for this assignment is required to complete
8 }; y( \/ V% u) S! Cexercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
& G( t9 P# F5 p# x1 g# Pyour model. : |: l: r1 C( R5 }

& j; ~! K  V/ K% zMachineMean time to failMean time to repair
. o3 y$ A6 w* hA110 minutes      5 minutes7 S6 I# r0 |9 ~+ V
B 170 minutes     10 minutes
. s+ [, L# u  G; ]C230 minutes      10 minutes
9 D7 e& ^) J2 J( A/ [# H: u0 p8 U
, }" g7 f* k* A, x2 H! DThe machines also must be cleaned according to the following
; G7 t) s: T. Tschedule. All times are constant:
5 y% y; ?& o/ b& G3 z. y1 G5 C7 O, \( @3 g
MachineTime between cleanings Time to clean
0 s" ?+ z4 {! y* w! _, K! }% U! wA90 minutes        5 minutes
+ `0 G9 u( O: DB 90 minutes       5 minutes
5 p8 \2 b5 l! @$ q- _C90 minutes        10 minutes. j  g1 s6 {9 z) X% x* f3 N9 m) m

; S. L2 C' Q/ X, u/ [Place the graphics for the queues and the resources.
8 d; `9 T' y7 M5 R5 F3 c6 TRun the simulation for 100 days.
  Y& X& f2 A- JDefine all failure and cleaning times using logic (rather than resource
/ Q' P3 \) {( ^( S% `& G& k. }cycles). Answer the following questions:2 s# h& X) E2 m- D. D2 K
a.What was the average number of loads in the waiting queue?7 V9 U/ }1 v7 o6 y8 r3 [
b.What were the current and average number of loads in Space?
# Z+ n8 h5 U8 h9 n. X) WHow do you explain these values?
+ f' u1 ]0 f+ M% R/ b  }) G

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉# D& W; v; h' m: b" b
send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
  R& C- l! |3 D! j8 @; E7 Q这行好像也不太对,各位先进觉得如何呢?& [( j. L) x. V- t
% o( r5 _9 u7 W5 B
begin P_something arriving
' X' _6 [5 G9 m& m  x   move into Q_wait  W$ {% {7 K- }# f. i
   move into nextof(Q_mA,Q_mB,Q_mC)
! g& W$ S8 U: E: w; A- D' E: _7 Z7 ]   use nextof(R_mA,R_mB,R_mC) for n 48,5 min
+ p' K5 N, M' y" t+ C7 L; A( P8 z   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean) 7 K9 Z* y7 L: y0 N
end$ N* [1 K0 H  X0 X
) A9 J% A- r, }' T  q- Y
begin P_mA_down arriving& m, K- }" p9 F4 t6 ~: j$ D
   wait for e 110 min% i1 R  N8 w0 z, t% K
   take down R_mA2 y( t" u9 @5 R
   wait for e 5 min3 r4 H( D4 Z' @* [: E. U& s
   bring up R_mA' i! Y6 @5 i  y- C/ U7 }
end9 j) j" ~( c1 ]+ ]% t- o* q

/ y- T) s1 `3 i& l9 m1 Abegin P_mB_down arriving: L+ k' Q4 \& y. m
   wait for e 170 min& S* G) E$ N7 z' Q# I/ j& _" q
   take down R_mB
# a, o$ x* P! _. N. N9 `- o+ V: X   wait for e 10 min
0 i. L; u1 x: i/ p5 p# ?6 e   bring up R_mB
1 F+ S7 e% o8 Eend
- B" z% h- \3 E* L8 c2 `! I3 \+ K& @8 P
begin P_mC_down arriving  Y2 f8 s( z# N( `* P
   wait for e 230 min
4 I3 e4 t( R* S2 s. V6 H/ M   take down R_mC, \$ t) ^1 m# A6 w0 L8 h( v: d, p
   wait for e 10 min
4 e( R& z6 o9 r" W0 d, U9 l6 A, r   bring up R_mC
" O$ l" [# j0 g6 Z6 ~end
& b; E1 O; P/ x6 J
0 f' j# [+ F" r. V9 a! tbegin P_mA_clean arriving
. x0 L0 F$ f6 m. P- b. k  o   wait for 90 min
, }- y8 _6 u" I  d   take down R_mA% T( W, J: b$ w: c5 E5 S3 b0 _
   wait for 5 min2 o8 z9 Q/ O- j: L  V
   bring up R_mA
& s& Z5 y9 e' Send
0 N2 B' K3 k  v& K% M1 |
- ^2 |$ k8 V: ]( j3 t; Fbegin P_mB_clean arriving
* M. M  T0 K+ [: T& c+ ~* X$ D" F   wait for 90 min
# Y& H# J) I! ?% r- Q) D* A! i   take down R_mB
1 R" t2 u; G: z; z8 N   wait for 5 min
! |6 ^) S8 b4 [1 Y  q) I5 l   bring up R_mB
2 u7 J+ z- ]' @# r+ Z0 Fend
& t4 A# j! K* ^, J* W( z) X; ?7 [, P& O: J7 p$ S0 i) C( A4 H7 C
begin P_mC_clean arriving, u7 }" w" S# V, S0 ^0 G
   wait for 90 min
4 P/ Y: A# Q; \   take down R_mC
1 R+ l! k/ V2 e  {4 q' x3 |   wait for 10 min
  b4 j' b: R. l, s6 I! i   bring up R_mC: y  b: D' ]- H% |0 Z$ T# I
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
6 g" S# E& [( ?6 I3 U3 J   move into Q_wait' l' t9 |6 A8 P' J1 S5 D. w
   set A_q to nextof(Q_m1,Q_m2,Q_m3)
( ~- B6 J8 {+ P3 R1 E   move into A_w7 `6 ]) |2 g5 M8 n; w9 r
   if A_w=Q_m1 then use R_m1 for u 48,5 min7 _3 H9 S" j0 Z/ G+ z) l
   else if .....then use ....for u 48,5 min8 b9 ~8 ?  X! w6 N
   else if .....then use ....for u 48,5 min  1 k6 W% N+ q$ m- n4 F
   send to die
& Z$ j* d3 g1 v& |1 e% p. eend
, S0 [1 \- X! \# n: X: C# }
; C! r4 }5 M* ~/ k供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-4-17 17:37 , Processed in 0.014121 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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