设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7169|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
  [) G  h: g1 K4 }& V' g' M7 E) C  `- J3 O. n" ]+ K
底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去' ^6 E( o  b( y( P9 _
, t2 n% A, G0 l$ P' O
不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!
2 q5 ?% u' r" U  t* H  @) ~, C) u. b4 n  P2 S; z
--------------------------------------------
3 f1 G* `  C9 L( ?begin P_something arriving, @( B6 @- s) |$ v
   move into Q_wait2 Y0 s& b# @! `8 l
   move into nextof(Q_mA,Q_mB,Q_mC); c% _( y8 ~6 H0 E1 W
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min
+ s, o1 [1 w  S9 A$ E, ~1 W7 X: @   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)6 m* X2 ?. Q. b) t  a
   send to die# J+ l$ R& D% R- z! N. `
end
4 C/ m% p: y4 i) b& A$ G5 R

9 d) [( f) d- G: ]$ `5 ^" Cbegin P_mA_down arriving
* B& n; M- I( q# @. f6 ?+ o   while 1=1 do + |7 l4 h9 Z2 W! M% p. ?
   begin
' h" W6 L# V; l0 n7 Q   wait for e 110 min
% T! ^. S3 r6 k( M9 e   take down R_mA- Y. z/ X' g! D
   wait for e 5 min) k0 E& L) r( {1 t
   bring up R_mA
3 i4 P# D1 {% h* H8 D" g   end
  @) y( p2 ^% @# }! uend

, O( v7 w/ W2 ^% S1 D + v# v) L8 M. V
begin P_mB_down arriving7 m7 L. A/ A& J6 n9 G
   while 1=1 do9 X; x' |$ Q: S3 j& V. @5 P
   begin
9 _$ i$ r" y& d# i( }& I- O- w! j   wait for e 170 min
' @* y. }5 ?! o% m: j( V   take down R_mB
# Q) b7 k: F% b8 g   wait for e 10 min
: N# a5 P8 Y" c  X% M2 f% j' R! _9 M   bring up R_mB/ o, F" Q5 I# @. C7 q2 _6 t
   end
9 O" o* \( x. G; o) kend

$ P+ ~6 u8 k9 A9 ^& N  N
" p% a) J3 p, }$ r" a0 Vbegin P_mC_down arriving: J% ]4 b/ V. Z7 L4 Q
   while 1=1 do
2 K' Z: @0 B% d8 P6 p/ K" e+ P   begin
, ]/ f" Z2 u9 y: `; e7 }. K( `( m1 k   wait for e 230 min3 K4 B: l9 c- l2 n/ _
   take down R_mC% T1 @4 g% Z# p! E" c
   wait for e 10 min
4 ?5 I" O) T1 w# |   bring up R_mC; q3 r) m+ j- r! L2 Z0 E; P$ a3 v
   end
9 g& q6 o! O/ \1 [end

) r2 d7 J  Q8 I- c" q
! c* \% M# w0 U) Kbegin P_mA_clean arriving$ }7 g  q+ t! C' d2 V
   while 1=1 do5 ~  P7 J5 A3 w: d2 h
   begin
9 L! x( v) T% u9 W0 t* c   wait for 90 min$ K, ^* K7 q  Z$ J  }. B$ ^7 ^
   take down R_mA
5 [2 M# @- [- [( ], F: o% _   wait for 5 min
; Q2 F  a9 W4 m& D* X7 [8 e   bring up R_mA
; e( w4 T7 @2 n: K/ G: A   end" B5 }! F/ E  j7 a
end

3 ~- f! B( T- V* w, f
& F4 J$ [4 W5 ]6 {3 E, pbegin P_mB_clean arriving; J& H( ]$ Y( b4 v4 H) r& i) d% _; \& m
   while 1=1 do
% z+ G! |/ o4 [! y7 s   begin
; f+ Z$ H3 m& F! [# X7 \   wait for 90 min
5 K& e: h3 q9 m# P   take down R_mB
: O" i$ t8 t) Z- f9 {1 a   wait for 5 min$ M+ V  z4 V: _7 d
   bring up R_mB
/ ~# r5 E- P2 Y! h- C' C   end
$ u7 R1 ]' G6 n: I& Aend

; w8 A" r6 z9 n/ P% d( Q3 z 3 w9 ]0 _6 K5 B, Q4 N. }
begin P_mC_clean arriving
5 h+ ^8 M1 X- b8 k% X+ U$ \2 w  Y( l% C   while 1=1 do  p, S$ M8 {; S% a
   begin
4 a" Z4 u1 s0 M   wait for 90 min
8 k9 S  A: ^! S- f, Q   take down R_mC3 |$ ?6 O# ?  Q! E
   wait for 10 min
! w7 \# j+ @/ v; ~) P   bring up R_mC: J3 Y# U6 P) S7 d
   end
& R2 \6 r/ t  h0 U9 _end
) {- J: ~$ y& H6 j( |& M
----------------------------------------' ~! `: B, [% }- e

7 m9 u" o9 J- J& F' U0 {; _Exercise 5.9
0 G! I! K" D: l+ c: Q* \5 L* m
6 z4 b/ Z% C6 D" A" i& r/ Z: \1 E
5 O9 n  z- R3 U& ?- vCreate a new model to simulate the following system:
# k, Y8 Z* p( B1 ~- ~+ oLoads are created with an interarrival time that is exponentially
, B! f( ~9 t. I0 F- O0 odistributed with a mean of 20 minutes. Loads wait in an infinite-
$ E" v- O* J. P  t7 D/ F  @2 lcapacity queue to be processed by one of three single-capacity, ) r+ X, B: h% t, b. Q
arrayed machines. Each machine has its own single-capacity queue 2 h: {7 L, ]$ e( t! c
where loads are processed. Waiting loads move into one of the three
; H, Y! w% I! o) H/ z. Nqueues in round-robin order. Each machine has a normally
: E* p/ k0 D! q- |! y/ `. b0 ]distributed processing time with a mean of 48 minutes and a standard
: N. j6 Q- `! j! Xdeviation of 5 minutes.
( j4 |2 I7 W) t- a8 \! xThe three machines were purchased at different times and have 5 r' s( e* c: e5 [
different failure rates. The failure and repair times are exponentially 6 R7 Z) [, ]9 J0 F
distributed with means as shown in the following table:
  U0 n- l1 r$ y2 lNote The solution for this assignment is required to complete   K, b, ]3 o: y! B. p) ?
exercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of - l& j6 d7 A2 P# E0 @8 V1 @
your model.
8 q2 b! T$ C8 L3 g7 V1 m- u! ^/ E: {' D
MachineMean time to failMean time to repair3 T, ]1 T  ]- [0 f, ?1 f9 r/ k
A110 minutes      5 minutes
3 V  y9 m8 s2 MB 170 minutes     10 minutes
; r, W; j" C. t/ V+ v+ ?C230 minutes      10 minutes
$ h! H$ z) o2 f  ?. E; C
+ ?2 n! _- V( f. Z% HThe machines also must be cleaned according to the following
' X' j$ S5 Z8 Q3 R6 t5 q7 ]schedule. All times are constant:
8 m+ u9 Y5 p' g, z1 t- y% {3 W5 t- {' D; {* b5 n3 M
MachineTime between cleanings Time to clean
9 O/ }9 I; W; x# `A90 minutes        5 minutes9 O8 t( R3 P$ N( ]7 q, D8 ^2 }
B 90 minutes       5 minutes
6 i: K4 R! i. U/ RC90 minutes        10 minutes' O% C- a4 d5 G

, s* ~( |+ l$ E, ?Place the graphics for the queues and the resources. . c3 R' r: U* m1 X) E/ v
Run the simulation for 100 days.! L, ?7 m! V. x: m& ~$ J' j
Define all failure and cleaning times using logic (rather than resource / I* j; D5 t9 L" @+ S
cycles). Answer the following questions:
8 z2 z2 N( N# c* j, h1 k- R( ua.What was the average number of loads in the waiting queue?, }/ J$ ?# Y5 s
b.What were the current and average number of loads in Space? ) Z. f( Q  X' y8 T
How do you explain these values? 1 l5 }% a: b& u8 R8 N# y

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
1 ?9 ?4 p, q4 k& r( e" J- bsend to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)5 W- k6 ^) z1 L# {" j! m; P
这行好像也不太对,各位先进觉得如何呢?
+ R" y9 [- Y, h
( }6 L# p( N5 J( U. Mbegin P_something arriving/ t) U& J+ D" L  p9 p/ p
   move into Q_wait
4 O; a% G# C1 o   move into nextof(Q_mA,Q_mB,Q_mC) $ D& V% f' @0 ?. N8 x5 v1 n  z
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min1 R8 N# ~4 j0 {" `4 z! X
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean) 6 W  e4 C6 _( z! ~( D& r3 D1 N
end
' F; M0 J) F8 ], L0 O# a0 N' ]0 l* w, r+ ?* U
begin P_mA_down arriving
6 O; b" |( _% K6 L5 x) w# l+ d   wait for e 110 min
- P5 q* K1 G7 l. h: ]( \( R& t   take down R_mA+ L3 c( K; X- T$ q, L1 Y
   wait for e 5 min$ R( S" f  s5 D6 M; d( Y4 v1 v
   bring up R_mA6 f& v' _; h' M2 m4 g; q8 c
end9 L) b1 A% R8 p/ y
8 {! R5 [  L) U4 k7 {7 h' ^# z
begin P_mB_down arriving
5 E1 A) I# N. h2 L4 [) d% p; ^6 w. _   wait for e 170 min
+ a7 R3 g: k( k   take down R_mB
7 R' q/ d% A* H7 J( O. w3 k   wait for e 10 min
4 h& |) H' w$ n" E: l, K   bring up R_mB
4 ~. `& ?, N  R1 {. w% Wend' i, s" Q7 }: W! P' ]! }$ a: |3 |2 @
# \7 L+ m8 v; f- ]$ W) |
begin P_mC_down arriving, \8 `- H! J& \5 v5 ^
   wait for e 230 min0 P& R0 E. h0 B% m) }% z6 W) |
   take down R_mC3 F( g6 H' m5 `- I( r6 R0 }* y7 [1 @
   wait for e 10 min6 X9 z; a% w6 R) b: j% V7 N* K4 K$ x: m
   bring up R_mC
8 H1 y3 K$ t" Tend* y3 _- T% c( d8 T8 [" r
' H7 a- t4 e6 ^; J# Y
begin P_mA_clean arriving4 z) i- y. c  ?3 t
   wait for 90 min
7 x/ f' V1 N$ |7 N) l5 U5 t+ R   take down R_mA. n4 Y9 S; J$ ^7 d, I/ G9 O0 k
   wait for 5 min$ G3 z- a! L  v; W7 T3 Y+ K
   bring up R_mA7 G# K" j2 a. @$ O+ K
end
9 q; W' B, y3 S5 T3 j7 ?
! G$ z7 C. Z2 B! B* Qbegin P_mB_clean arriving
) Y& h2 j5 t. r& x. a( |/ W   wait for 90 min
( H& V  a& D0 S$ `' w   take down R_mB" t% U! p! l6 X$ e- h
   wait for 5 min7 g+ u$ m9 _1 D( q8 Z- |" Y9 h
   bring up R_mB
( X2 R9 q: L9 J: e. Y) {, vend
% W  c- W7 s; p. l
2 l# ]- ~5 O/ l) Kbegin P_mC_clean arriving
$ e( T  S* x" k" N, ?+ Z   wait for 90 min0 Q7 q& |% ]! H0 X/ L# a6 l9 |# B
   take down R_mC0 f  i% h, u# Z# `
   wait for 10 min
% y/ }& ]/ u1 K; B$ R   bring up R_mC+ U3 V2 i' S# O/ \' Z
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
  D* A+ H0 Z( |6 L' u# d8 E0 y: W$ q   move into Q_wait" m2 Y+ H5 M2 _: \' g# o) N
   set A_q to nextof(Q_m1,Q_m2,Q_m3)8 q$ b5 f# e3 `7 |( X% a
   move into A_w
2 _6 t- P7 H- |% h8 |* N, l   if A_w=Q_m1 then use R_m1 for u 48,5 min
- v/ [* a, d# Z6 O; V  |   else if .....then use ....for u 48,5 min6 y3 d) s; Y) b
   else if .....then use ....for u 48,5 min  
6 ]0 g9 w+ @: l0 y1 V( u   send to die+ l4 K9 h$ ]$ h0 r9 L
end3 i8 A: I, P1 }: O8 X

% C  X/ @& ?9 c, |6 r供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-11-11 14:48 , Processed in 0.013785 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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