设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7313|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
4 K: [5 O: F% J8 P5 o
1 H1 x$ d' W. m* `底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去
) U7 Z8 [* x) R9 T4 Q, W/ l) p
- v; v$ L7 ^. Q. W4 `不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!
$ S3 Y6 h" Q# g- ~1 T( J, q
$ g* ~, y2 H& `0 Y7 e7 @
--------------------------------------------
8 v: ~  A+ Y4 V% w6 k/ I4 Rbegin P_something arriving) }& F) w% h; l6 v8 F- X( q9 c6 J3 O
   move into Q_wait6 P7 o5 l1 x* ~- B( l/ M* ~
   move into nextof(Q_mA,Q_mB,Q_mC)0 u: S3 e9 s6 O! G
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min
0 R& g9 ~: k5 }   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)" w: a9 ?* Q* y: B- U( z# {4 V( H
   send to die4 z2 y" H# b8 S0 x" U) Z2 i9 }
end
3 ]( r7 N/ }% J, w6 J
) I! \0 ?7 v2 d8 B
begin P_mA_down arriving/ k  @. i+ X9 y  t0 c7 \* {4 E% v
   while 1=1 do
6 H0 H1 A5 e% y. h* X7 v   begin
5 R+ ^1 V" q7 |( y   wait for e 110 min9 H& _8 s9 n" N, p! @
   take down R_mA
0 E0 J. {9 o% q: g   wait for e 5 min
" B; q9 ^8 k$ A+ H   bring up R_mA
, f6 u0 P+ `( t! p, a8 z% W   end( ~' }! B3 K9 E; K
end

7 [, p+ d! U* o  {: U" L * S/ M0 t( S! Y  {6 u2 I& v+ D
begin P_mB_down arriving
9 f: c* K! U9 _3 q) {" p! {7 |   while 1=1 do% c4 R- {- y& B
   begin# _" A$ }" ]. P+ b# |' B! v6 P
   wait for e 170 min
6 Q1 [( a) I; @. V# m2 t   take down R_mB3 J* t" u8 E2 {5 \7 Q  o9 g/ n
   wait for e 10 min
2 e& p7 a) J7 u8 l: K7 P* A; P5 o) O   bring up R_mB* j8 n7 f2 A3 e- Y4 k, J% g" j( N( ?
   end
4 o. ]+ W, G1 m# Q7 w0 Yend
4 J0 K5 ]! C& M) U. j

- a: E% d5 }; b9 I% ^begin P_mC_down arriving" ?. S. d- P% _; ]3 l" @1 V! O
   while 1=1 do ; f. ?% x: q" O1 `  B
   begin! Y, a  ]1 I/ G0 s, [
   wait for e 230 min9 v% r- M/ ^: V2 E+ g- i, a$ G
   take down R_mC
5 r( j; j% Y* S' M7 F" ]: I   wait for e 10 min
3 E% A. {! ?7 U& l7 ?% s0 C  J   bring up R_mC
5 L# }7 E) c9 A2 C   end$ f' ^+ I) t/ |9 G
end

/ t$ Z4 Q( b! r4 x) Y3 I
5 l- I/ E* L1 v/ z. u& Xbegin P_mA_clean arriving
  z3 b0 w$ t8 {: t+ @   while 1=1 do
0 T+ T& l: V2 g9 R  ~   begin
0 r0 w+ W5 i) z: Y. V3 f# H- ?5 Q   wait for 90 min
- I: P/ [! m* e/ F- P' b8 C   take down R_mA
; T0 H6 {& n* @' R; g  u   wait for 5 min
: |+ b9 Q/ T, t( g% t3 i6 v   bring up R_mA! N- _$ r# l) ?( a" p/ o3 R
   end0 T! R8 B. |. y+ f! t2 X
end
, J$ t+ L# H) U5 d. b4 o+ q/ ^

- G  @1 b0 _8 Q& j& Qbegin P_mB_clean arriving
$ d3 P( P( S# O1 o- b% @' Y7 M. {) @6 J   while 1=1 do
8 @% S6 C0 W& n& q   begin
! W4 K+ i6 L  M! ~5 _  y8 K9 F8 p   wait for 90 min: p1 X2 \- G) b/ ~# Q2 M
   take down R_mB
$ n/ y4 {8 R/ H) w  j8 S   wait for 5 min
3 u& w8 m/ m; L2 h6 q) F$ k   bring up R_mB) Z! u5 v6 t' ]) z' f
   end
- E& C  a" W0 Nend
# q$ T( b- G7 @/ [

5 J6 W  `2 b. r, Lbegin P_mC_clean arriving
) Y7 \( z8 V+ V) ]4 ^, \/ g  }   while 1=1 do
, X& g9 v' V6 W8 b0 f5 o   begin
# R% }6 o# P3 ~, `& I" v   wait for 90 min
4 R: r' K2 }+ H: z( s   take down R_mC
0 P* n- ~/ |1 o7 Z0 r, q   wait for 10 min
$ t$ R) R! F0 g  e2 a1 h; Q5 N   bring up R_mC& F- C6 g7 k! ^$ B, z
   end
! m) p# G6 I9 w8 S. b1 gend
4 g5 O% h+ u( C: ~" v  g
----------------------------------------: J, y/ G' P& g! ~" d% w4 a& o
: m! m9 N- _+ r+ D  J
Exercise 5.9
  T+ s' R8 f# ~/ U4 H+ O8 Y1 Y, y" ?/ x( @, R; P

6 r/ G5 [% M2 z  I. R' }0 qCreate a new model to simulate the following system:5 R; G& j( d7 n6 K8 F( s/ q/ X
Loads are created with an interarrival time that is exponentially 7 O, Z4 F+ ~. E
distributed with a mean of 20 minutes. Loads wait in an infinite-
9 i* {. |: K/ e+ R# ]capacity queue to be processed by one of three single-capacity,
9 b+ e6 A, @0 c) Z5 `% \arrayed machines. Each machine has its own single-capacity queue
$ ^* Q) {8 Z0 g+ I% Nwhere loads are processed. Waiting loads move into one of the three ' D! E- s+ G$ a; h; s
queues in round-robin order. Each machine has a normally
) L. d$ Y5 K: c& e& _& O8 [, pdistributed processing time with a mean of 48 minutes and a standard
% s$ {( L( b" C: Vdeviation of 5 minutes.
3 r  l* N9 Q, H# U0 pThe three machines were purchased at different times and have " V- f$ U( F+ f% m
different failure rates. The failure and repair times are exponentially
- }4 g$ v+ Y5 ]distributed with means as shown in the following table: 2 \$ N# }: e! y7 ]
Note The solution for this assignment is required to complete + k4 l4 k. T, k6 p
exercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
; Q( B& H( P3 d4 @7 p1 a7 jyour model.
3 Z$ c) a/ n: [
2 u2 h3 |9 d4 h$ M! E8 LMachineMean time to failMean time to repair
/ P3 ^* k7 b7 p) `$ J( u. YA110 minutes      5 minutes
0 b+ g9 s4 N1 i* gB 170 minutes     10 minutes1 A$ W- ^6 R/ l7 n
C230 minutes      10 minutes+ B4 M5 u* A, x0 {. _) n

0 X$ ]4 W4 S" I9 S" KThe machines also must be cleaned according to the following
- \' R+ ]8 c+ z! Hschedule. All times are constant:
' k' X; R! o5 T' g) j& E4 Q
6 A/ c: u5 I2 M" `% G. xMachineTime between cleanings Time to clean; H' F9 l! Z) E1 M. F4 x2 U
A90 minutes        5 minutes) ^& S4 f2 I7 [4 }2 c, m4 x# H
B 90 minutes       5 minutes  r% x* _4 W8 B, N+ X0 l8 y1 I# J
C90 minutes        10 minutes
' k6 m3 \/ Y4 W) I" C
) `; `& T0 n5 hPlace the graphics for the queues and the resources. * N1 h* ~6 {2 n( |5 v
Run the simulation for 100 days.
4 f% J) r5 c9 S9 U4 ADefine all failure and cleaning times using logic (rather than resource   C- d, c4 u. c& p7 O
cycles). Answer the following questions:
( P3 M- G  Y9 z- _" A! z4 la.What was the average number of loads in the waiting queue?- F8 [8 P1 H9 c& P, Q1 u0 X
b.What were the current and average number of loads in Space? ) ]4 t7 [4 m) B( a! N4 W( K
How do you explain these values?
. y; q+ R5 o( ?; O( k6 T% A0 x

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
- u% N4 U' i1 |% g; Isend to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
  m: p3 j$ F6 V: f这行好像也不太对,各位先进觉得如何呢?
$ t8 S! h; l* R  o) ?2 y; b( i# ?3 g$ @9 B& {  p( z
begin P_something arriving3 W& ]6 d% t) h8 K
   move into Q_wait
8 h  s4 h0 z, @( ]0 F8 `   move into nextof(Q_mA,Q_mB,Q_mC) $ D9 h- h' q9 N0 b" \9 g6 ?! g
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min
4 y( }" o% e9 N# j   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
8 Q1 S2 ~9 {" X6 R9 a& N2 F, M0 jend; z7 {# n. L$ ?5 [& p- `4 D6 z# l
. z6 C  ]0 g5 r3 w8 d1 c' j5 g) d2 x
begin P_mA_down arriving6 F$ K7 X5 U  a% d6 H
   wait for e 110 min
+ k3 X! O% F# o$ |0 F   take down R_mA  k: z; P* n5 v/ J" U
   wait for e 5 min2 o6 U5 |8 x" ~7 p# z6 R
   bring up R_mA
0 _9 {0 |4 p+ `# I. p" X, E4 xend
) r: v& l1 N5 X- l, g5 D( ?8 _0 I7 P5 I. s
begin P_mB_down arriving
! q4 t2 c$ x$ a   wait for e 170 min$ x, M+ f& e( D; w6 P) \9 s3 w# m
   take down R_mB+ z5 m. c8 I# g0 B( j+ E& u% \
   wait for e 10 min
5 b% b3 p. m) ~" z   bring up R_mB; ?, N$ N7 W  c# k) P
end5 v0 @  `" j8 ~1 l" a
3 ^; W  Z9 B- l
begin P_mC_down arriving
$ r0 k  a& E* n9 h   wait for e 230 min
: m8 _; G6 O  F3 T) N   take down R_mC
7 G, J* X3 K3 M6 H1 g2 J! Z   wait for e 10 min: J5 T$ F6 B# D2 n, X) _8 u2 x/ E& t* ?5 M
   bring up R_mC6 c1 |+ B. E$ N9 D0 \) o* s
end! }3 v% b3 W& O* a( I' ]& r

$ W6 K" v/ e$ W- z2 Rbegin P_mA_clean arriving1 H: A/ q) M+ `6 B& E# W% S
   wait for 90 min
, @6 a# o0 S4 }5 m5 l' Z& q. a" H! T. V   take down R_mA
8 [9 R- ?% m/ b# v' a   wait for 5 min
: e. T" A3 |* K0 L" T  ^* I+ T   bring up R_mA
. X% p8 {  F$ R, Mend
, l+ B% }: }* K% v& \  L& t3 e6 z- f& ]& i
begin P_mB_clean arriving
* a0 {$ S: j/ j- |4 M" n   wait for 90 min) \2 M7 U: |' [% i3 ?
   take down R_mB& l4 B! Z$ w8 e& X
   wait for 5 min
' F! b6 u9 N8 o) i* @' g& W( P   bring up R_mB
+ \) d) D3 u  Tend
. g. g; n% O6 [  c' }/ c4 s6 Y" [) r' L% T! n
begin P_mC_clean arriving
) Z' s& ?0 F- M& X6 t   wait for 90 min
7 n8 U! k0 O  y   take down R_mC
4 k& S6 e. z$ a4 T   wait for 10 min2 y9 K& B1 `6 c; l$ [/ f
   bring up R_mC
% i3 H' u* _$ W7 |/ |. Rend
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving+ w1 M/ f5 Y9 o, t6 _
   move into Q_wait2 }  T( ]& q" K. @) t) g$ c
   set A_q to nextof(Q_m1,Q_m2,Q_m3)+ l4 n: k$ R6 m) j
   move into A_w
8 J3 }) U7 t3 K7 [0 W3 p. x   if A_w=Q_m1 then use R_m1 for u 48,5 min
- S) Q5 ?0 h; K2 Q/ d* T   else if .....then use ....for u 48,5 min9 I# V9 z9 {3 b2 w3 b$ V$ W
   else if .....then use ....for u 48,5 min    _& ]& v& S! M& W2 h/ K" J8 j
   send to die! [/ V+ D8 J) S: C) t
end
' J+ P( J6 K- K+ l& s& v( d8 X1 v' V* _/ S+ Q( H0 V+ U" U
供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-11-30 20:06 , Processed in 0.018989 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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