设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6557|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
+ c/ Q) }* c, f: i) e, i
* q. b4 M2 X, B4 ~5 a& J底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去3 x- g: @% Z6 `) k3 q% s

' q: I1 b2 H' A" ^不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!
, e4 A9 s; V, g* c
# X# H4 ?% @8 ^; P4 t
--------------------------------------------" u* Y# p/ L6 U
begin P_something arriving
1 u$ Z7 ?1 [* h+ E+ r   move into Q_wait
9 @' v. M% Q, |8 k3 c   move into nextof(Q_mA,Q_mB,Q_mC)6 C0 `" d* \) I. [9 q/ f  G2 q
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min
2 L& w( f5 u, i   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
9 G9 c% U" L. K' D# u  U   send to die& o, K4 D; V& R* c9 ]
end

, C. C+ Q9 |: i+ ^& M7 @
  s! ?) t8 C+ }+ lbegin P_mA_down arriving8 |0 F3 L3 h" k* ?" O) m9 X- g
   while 1=1 do * y& I' [. c- |+ c9 S$ C" @. T
   begin% J6 e: b- W0 K. s6 x  Y  l
   wait for e 110 min
- T4 _5 _) `( A# I) g; |   take down R_mA% l) U2 @" C! L+ j: i+ y
   wait for e 5 min
3 M0 E+ x5 h) A1 D8 m, F   bring up R_mA1 ~+ B& i! S+ P6 x( B
   end4 M* b6 s/ Q( [+ x9 E; ~
end

7 x+ b( y& E' n- x & c- c. \3 d( W% c( N# \4 K
begin P_mB_down arriving7 r) ~. Q9 \& x7 ]" [9 _3 Q$ K, M
   while 1=1 do- b8 h' E! a; g7 J" a
   begin  g% J  \5 F$ \4 A5 \
   wait for e 170 min
- A6 S) [/ ]# N, X   take down R_mB  M$ Z- t; y, F: T9 r. T
   wait for e 10 min2 w/ {8 Y) q8 _8 l0 g4 g6 o% i
   bring up R_mB
) _& |+ ^. t6 i1 F   end6 ~; l7 }; x4 i' V
end

. K: D+ p5 x2 |1 _9 v3 \) [ - z3 e: y7 k" C$ @6 A0 Z% Q
begin P_mC_down arriving' ?, _  s' e- \4 y. r3 P
   while 1=1 do + A5 n: n8 Y2 ^/ d; J; {- s: C9 [
   begin
1 j! C" w' n$ z% g. h   wait for e 230 min
& l! `2 A6 W3 q% i4 D: R   take down R_mC
7 x% j' g- V' V( C/ E   wait for e 10 min0 d9 N. p7 ~! s+ R/ u" t
   bring up R_mC& j2 ]  N* \* `7 L
   end4 k8 r9 K6 R/ q2 D/ N
end
. C6 s# h7 {( H0 B+ `( c# A  L
/ q3 I/ y9 {* D& q9 ~  c$ ~
begin P_mA_clean arriving# o6 F! L2 [( p4 h: g6 D
   while 1=1 do
. i/ {) o: m4 r8 b" W   begin
+ U6 A# i# _4 X& l' T9 n   wait for 90 min
9 @3 T  ]5 H- |+ \$ @7 w) h3 j   take down R_mA. Q8 \6 q  Q7 S/ G
   wait for 5 min
  j5 J" W& w, F/ [  d! |   bring up R_mA1 |1 i* V# |/ E6 P
   end) k* \8 Z) W' |) g% Z  {' R* E
end

* P5 E4 O" j# v% T
: O- J+ t% s7 E% F6 b# hbegin P_mB_clean arriving
0 t( m* n0 m4 X. t   while 1=1 do
4 R  Q1 z% M% G   begin+ l8 @/ B9 l3 U2 t! L
   wait for 90 min% z# m6 P+ R3 e4 ]
   take down R_mB3 e3 Q# S4 a) c8 ^
   wait for 5 min& Y" u6 k; v# x9 `6 O* h! `3 {
   bring up R_mB
0 v4 L% ?$ s2 R& ~   end" E! W$ ?$ P& B
end
% x7 o6 _! @8 p& _% W, G1 m
0 R/ j3 x8 {  N$ J- w, F$ Q
begin P_mC_clean arriving
+ l# w7 {) I% b8 A& N5 ^0 ^   while 1=1 do
& V! `, u( h' }% O% O   begin
7 I1 n* i% F9 L9 T  \5 c1 @   wait for 90 min( i1 {: s( M& G9 z8 k
   take down R_mC
; C/ Z: N# e: O$ @   wait for 10 min
  j5 n# o6 s2 F+ i   bring up R_mC
9 O. v9 b! u" N$ D! g  ^2 K) T3 a% Z   end  Q1 V2 D/ V0 c- @/ i% Y  h& |
end

4 G, a: y4 B9 ~4 `----------------------------------------
6 v5 P: ?3 \  t+ Y. u5 U' h % v/ b/ C+ i4 [$ e5 |
Exercise 5.9
7 V) f) h1 o+ a/ Z1 v' a  y' {/ n) y4 f, ~3 l
* y3 u$ D9 z  s
Create a new model to simulate the following system:
) W  v. @+ r) GLoads are created with an interarrival time that is exponentially 9 m; j" T- c: V' ?7 y
distributed with a mean of 20 minutes. Loads wait in an infinite-. Q+ ^: s5 _# V5 [
capacity queue to be processed by one of three single-capacity, " l( `$ _) ?- X5 H2 c7 J
arrayed machines. Each machine has its own single-capacity queue
) m9 i" M. D% d$ C# P( K# Iwhere loads are processed. Waiting loads move into one of the three
' ?+ W0 p! u, P) \  J0 \queues in round-robin order. Each machine has a normally & Y/ P. v! A( |; n% n* x+ Q
distributed processing time with a mean of 48 minutes and a standard
! k. w; S7 g) U8 Q' |  o9 Qdeviation of 5 minutes.
- t# h. z' t* e- T& UThe three machines were purchased at different times and have % J) ^6 N0 ]0 e# [: C( I8 d
different failure rates. The failure and repair times are exponentially
) |3 T( y8 O3 y' w) jdistributed with means as shown in the following table:
8 b7 H- `9 {5 a# [2 @. f$ x" uNote The solution for this assignment is required to complete
0 f0 I6 Q- C& p0 R# N. l1 Z  a/ _exercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
# c  T* r, j  K, v) t& K. \; g6 [your model.
7 U4 _* S* H: j& |$ Z
$ Z) A! P% h5 vMachineMean time to failMean time to repair
" q& l; X1 ]5 S* M; qA110 minutes      5 minutes" j" e- z5 }, c. W
B 170 minutes     10 minutes
( G3 Q" `% z/ I" A: W# E: y+ _C230 minutes      10 minutes
8 `1 R9 D- y4 E
: |! X2 V3 g, J' NThe machines also must be cleaned according to the following
; a' {, c; |. i( G" o3 c3 [schedule. All times are constant:
) Z, h/ L8 v& e3 e% x' A( `) O: t- z5 h8 B6 W) K
MachineTime between cleanings Time to clean; f" f* C3 Q- b* _$ @/ L
A90 minutes        5 minutes6 U  a" @4 m& [, p8 A* a8 B
B 90 minutes       5 minutes
, u9 R: _$ L; B0 ]- g5 J& }C90 minutes        10 minutes
" x2 [$ L& G8 ~, Q
& ?; a% m* x/ Z% o$ `( V$ xPlace the graphics for the queues and the resources. $ C  I% @2 x6 T# X) x0 g$ [1 M
Run the simulation for 100 days.
" B; i. z  K' n! }5 @. TDefine all failure and cleaning times using logic (rather than resource , k  \+ \6 U9 b1 _6 _8 P; [
cycles). Answer the following questions:
: ], I" I. J2 p3 X+ ~a.What was the average number of loads in the waiting queue?- x  q) _2 {9 O5 H% y) z$ r% d# R
b.What were the current and average number of loads in Space?
3 Q8 F7 a2 G" k9 VHow do you explain these values?
$ d, P& s' z3 ]) j3 t. \

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉! z* k* \3 n$ b( w
send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
: N# D- M' L( B6 K这行好像也不太对,各位先进觉得如何呢?
5 K& h* I, f& q3 X% x7 K8 m- E& J: e) a7 |) o
begin P_something arriving, |/ J  _+ A# r8 i0 i% Q1 k6 a
   move into Q_wait
! U5 J: t! A" \& j, }   move into nextof(Q_mA,Q_mB,Q_mC) + {7 m0 s. u4 m
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min
, X3 u9 e4 Z. i! C3 ^6 b2 B' i   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
: l7 Z8 O- M* `# Q- L. iend
7 h) ~5 S9 L: p. _: O! j2 Y' H! O6 m/ E& y2 O! N7 A( l
begin P_mA_down arriving
0 Z! x6 q7 F& N$ ~   wait for e 110 min4 q9 K- S9 u4 ]5 a+ r! @+ _8 F
   take down R_mA9 X/ Q5 I) D9 y# ]
   wait for e 5 min
' m; [* S8 Q, g- E4 p; s   bring up R_mA
# @, ?3 _/ j& _0 E, R2 Zend
  _6 _3 O6 Y2 ^) Z( P# @* N2 v. C2 A1 }. h4 r
begin P_mB_down arriving6 F6 H) d. ?1 U
   wait for e 170 min
) q" r) E6 g7 f0 f; s6 B! k   take down R_mB
( s( b% W2 V0 L3 z% d   wait for e 10 min
- n# Q; d- p, v8 A( b/ ?4 n" o   bring up R_mB
7 E7 l9 y$ ^* ~4 r8 e" q4 a! Qend* X( \, T' h' v# o, N/ c

" L* t! [1 Y5 k7 E$ y/ i& lbegin P_mC_down arriving7 b/ e6 ^  M# e3 D
   wait for e 230 min- O1 W, [+ u/ O; W- Q5 R$ g9 P
   take down R_mC
& N1 v3 G0 }. D- s- V   wait for e 10 min
. Q5 F. f5 L  _4 Z   bring up R_mC" O" u2 h" [2 R/ g$ y& q+ s" }
end
( }: X* v8 T# b/ k. f/ J1 ]  ^/ h* m! H' {3 M7 S2 W6 i( ]/ l+ u
begin P_mA_clean arriving
! K7 l$ V; R3 d+ P0 s! X   wait for 90 min0 C; S3 R+ M' y- h9 f5 d
   take down R_mA
0 g4 U' E, e& I( N/ z5 j/ B' F   wait for 5 min4 M$ y6 e  B( k! k0 I
   bring up R_mA" S+ w5 K+ _+ @
end
7 d/ i" ?5 g9 s6 I0 E& O* D4 Y2 t' U, s. e# j" r
begin P_mB_clean arriving. `7 k) l! C4 Z4 ?
   wait for 90 min
' b$ J, Z7 i4 d* Z& s4 n   take down R_mB. a( @1 n, R- U
   wait for 5 min
) Q; S! |/ z# @7 l+ F- s   bring up R_mB. |& l5 |& Y. m$ X# `% N2 `+ O
end! L7 q& a3 Y( ~
, s9 x8 S" H$ a. G) _
begin P_mC_clean arriving
) n1 i5 ^6 [0 i% _: |   wait for 90 min
4 X, \9 R2 l" F   take down R_mC
2 y1 b  O- \+ a+ L, n7 z# H. x   wait for 10 min
6 i- B% t% z% H   bring up R_mC& l  A, y1 [+ ?$ K0 H
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving8 J* H; {7 [3 e7 S: P# Z2 ?; [* u! @
   move into Q_wait6 A( H, V7 ^5 e; q& t
   set A_q to nextof(Q_m1,Q_m2,Q_m3)6 k! M* ]6 \5 [* ^
   move into A_w) w0 N3 s' ~/ P, x& a& {5 P
   if A_w=Q_m1 then use R_m1 for u 48,5 min
" K" N' i! f, S' I5 X5 W( M   else if .....then use ....for u 48,5 min* L9 l% A- m; Z9 r1 v, o, Y
   else if .....then use ....for u 48,5 min  
; e, y) ?2 C, ?* b! B, w9 S   send to die
5 m8 x% S6 a8 s% i2 nend
. Y$ i! ^- m3 e. p/ p  p+ |) m* [/ h, D0 U9 p, ]
供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-18 03:24 , Processed in 0.013805 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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