设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7315|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑 8 u1 @* ?1 F7 ^" I- S2 @
) F0 d6 }" t8 i7 y; ?
底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去
: p# G/ ?* ~9 S5 }4 M- Z" G: |: J8 R+ i/ ?4 ^9 D
不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!
. e' q3 b% S" y- P5 V# ^) u7 r2 e/ U5 h( j- e4 I7 ~
--------------------------------------------6 x* U9 e5 U% j- b9 v0 P
begin P_something arriving0 n3 x. o( _) R
   move into Q_wait
! @9 f* j9 A! M   move into nextof(Q_mA,Q_mB,Q_mC)
2 I9 H- I8 {+ A/ o- L( X, Z# d   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min5 D! o" G- s. I4 W; [7 `; i
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)1 p) k) J( N% r5 |6 L
   send to die
) R+ b# P: I  m1 P  `  \7 H5 `9 O9 Rend
% f( _' h: ^* }/ Z  M4 r5 I

9 A  K8 _2 {. c1 ybegin P_mA_down arriving% g3 u0 }/ I* ]) \( O; ~! j# z
   while 1=1 do
' r6 Q( ?+ r+ R& @* q# P" r$ N   begin
/ u8 a/ Z$ N  G   wait for e 110 min9 ]5 J% }2 a+ \+ \: R
   take down R_mA; }3 X6 h5 c. k" M" ]
   wait for e 5 min; |  @: w  @* [
   bring up R_mA
) u& u% Z4 u: ^( p   end
4 _6 X5 Q9 {7 e; f; _0 z; d9 ~end
9 h3 o9 Y' U  [  @! ~$ G8 _8 K
2 v( T2 c. ?6 n  S. h
begin P_mB_down arriving
: k( U% W& I+ I6 u* g   while 1=1 do
) s4 h4 D2 Z8 B9 B5 V   begin7 f" [6 I' C! z# P8 L
   wait for e 170 min* G( I, r) B( H9 ~" u# e  ^9 R8 h% ^
   take down R_mB
5 Y, J# P6 Z1 I5 M( y' h   wait for e 10 min
$ N# U, Q# M( s. q   bring up R_mB9 c' |3 [& j+ O: d6 @$ H9 {
   end  L: \  ?; E/ p' F
end
7 V( W3 z& v; i& F" d3 `

+ _+ O+ |2 ^( @begin P_mC_down arriving: c% t5 W: p6 w* ^/ _
   while 1=1 do   y6 t0 m' S0 m9 z$ S+ n8 W; H
   begin
( D) q" W- _% N& }. K   wait for e 230 min
" M. _0 ?5 i6 T; g% t; h* X   take down R_mC
9 `4 w5 i, V$ ^8 y   wait for e 10 min% @* d1 p1 E9 N% ]9 a1 g
   bring up R_mC/ {/ F  b2 g; T4 S6 a
   end6 f$ ]5 A+ I& h9 T: x$ u
end

* v$ |# i1 z2 t0 R( [, h% p1 `
& x7 T, }- J4 t* a4 tbegin P_mA_clean arriving
( A1 `$ a. p# L3 B   while 1=1 do1 P7 \: W: t: l% p: I) S
   begin
* {& B! p( C8 {% S   wait for 90 min
+ |5 e5 L$ c3 ]( ^( V4 o   take down R_mA8 Y: C+ ?) _3 d6 J
   wait for 5 min; X: U0 n) r+ l* d
   bring up R_mA- [: [5 Q$ x3 `) A; ?
   end
0 J& v# R) p3 R; ]1 wend
& N: K( Q: t/ x
; V2 L7 _/ [' H! u7 T# O
begin P_mB_clean arriving) q4 Y  Y: x4 U$ X
   while 1=1 do; A2 Y# y6 Q4 a' l
   begin! J6 A: V. E, w; D
   wait for 90 min9 v' [  e; ^  B8 D& H
   take down R_mB
! D$ _+ B8 h' i  `0 n   wait for 5 min" k4 a: u5 z7 a. Z7 T3 _
   bring up R_mB. n5 w  g& [$ g; F1 W
   end
9 ?  _/ h$ v- eend

8 V: D  a$ p: y2 }6 t ' \- s- W2 c! ~/ ^  ^, ?
begin P_mC_clean arriving  D" X2 r3 ?# K' @1 B
   while 1=1 do5 M; v! Z" x  O
   begin- R6 M  f1 c" N( r& v" X
   wait for 90 min7 o; S2 P6 I+ P3 ~
   take down R_mC
: P. g3 h  a( K, `2 |   wait for 10 min
4 n' N/ {5 l! f+ Z9 B   bring up R_mC0 d" q/ K  c6 ~1 X
   end
6 |3 B  G2 H) r- C5 V' o2 X& [end
/ L' z: v# i0 h
----------------------------------------
9 A: L, j, X/ r ) C1 i6 N5 s4 m5 {" x: \' t# T, D1 \3 d
Exercise 5.9
/ t" V3 p8 y$ @" ?8 u9 r% N6 o
- j# J9 y/ P1 ]0 n! L/ |& W. q' p
3 B1 [% z) m+ K* ^: qCreate a new model to simulate the following system:
$ b7 N3 j8 @5 h# j+ ?' J5 s5 OLoads are created with an interarrival time that is exponentially " x% O" D1 e( d, `3 U
distributed with a mean of 20 minutes. Loads wait in an infinite-# Z2 c6 Q6 X, Q
capacity queue to be processed by one of three single-capacity, 9 U2 x7 e% A% F: t% U5 i
arrayed machines. Each machine has its own single-capacity queue
1 {# b# d- T% w1 z1 A9 vwhere loads are processed. Waiting loads move into one of the three
  j( D; e  E) \- {& Qqueues in round-robin order. Each machine has a normally + x3 Q( ]( x1 f8 e* z0 C
distributed processing time with a mean of 48 minutes and a standard " P) d# H0 M; o* F6 N1 R6 {& k) P5 F/ ?3 W
deviation of 5 minutes.' U# z" C" R7 R9 c; g0 H8 L, Y
The three machines were purchased at different times and have 8 Q/ N9 h. j1 O3 h! X6 \" u
different failure rates. The failure and repair times are exponentially ' @* ?7 S1 {* c. n$ L$ o1 p
distributed with means as shown in the following table: & p- l1 `' r- m6 }1 W  u
Note The solution for this assignment is required to complete
  C: }1 ]: X' }, k, gexercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
% ]6 y& N7 {4 }! Dyour model. ' a% u2 g* J1 P' _+ W. U

! O' w  |/ q$ |- r+ v1 H  z! C" ~MachineMean time to failMean time to repair  ?' Q( U; K" u8 J3 N: Y1 E
A110 minutes      5 minutes/ L- j4 k% j3 [" ?6 ], J5 |$ X7 U( k
B 170 minutes     10 minutes7 E$ ]1 s2 L; H- C* o: V) f
C230 minutes      10 minutes% @# S8 G3 Y* c8 e( M

# C6 a; o% \4 ?9 S  R& ?The machines also must be cleaned according to the following
, R- Z1 g" D4 g3 [1 J4 r% H. yschedule. All times are constant: * b) T( J6 Z3 j' }6 }! |

. v  k! {7 f" p( X7 gMachineTime between cleanings Time to clean
4 X* `# E# ?5 }: p' ^! ]A90 minutes        5 minutes6 f6 z3 d: A6 B, `8 u- w, O
B 90 minutes       5 minutes/ f/ Q( C, D: Y
C90 minutes        10 minutes
. n  f# i! K$ h. c5 R" X! l
, X! Q! I1 X! _- C  HPlace the graphics for the queues and the resources.
0 v- k4 F% H. g. c8 J3 G+ CRun the simulation for 100 days.
7 m; W' Z1 W# R$ [. E5 wDefine all failure and cleaning times using logic (rather than resource
( _/ w, ~2 y2 X2 o' V; K# [cycles). Answer the following questions:
8 ]# m+ L6 R: S: h% H8 J4 i) D3 G9 Pa.What was the average number of loads in the waiting queue?2 X! ]9 w) p& ^1 g5 C+ M
b.What were the current and average number of loads in Space?
$ q% h) ^# A7 S' `How do you explain these values?
# \0 H. s: c# X4 n4 L7 R

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
1 Z, c8 E% p. r: ]4 h" s5 a! ?8 _send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)# U, D/ j! d) i; h
这行好像也不太对,各位先进觉得如何呢?
+ d1 e' a* B4 B1 U" A
5 G5 ]. W8 m) N; c  |* x* P7 abegin P_something arriving
5 U  z8 ~  n" z! d   move into Q_wait+ V1 V1 A/ G. U8 a- B9 ~
   move into nextof(Q_mA,Q_mB,Q_mC) $ ~' H4 d2 ]4 O( ~
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min# x6 n8 W: h6 i# N+ L9 s2 R
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
4 K3 V8 W4 f6 a$ i* I2 K% oend) s6 f5 v* \, F% |+ k: B% D- |8 u# @

# s$ r) F, S9 C: ebegin P_mA_down arriving
, ~! E4 }5 Y# W# ~! z   wait for e 110 min) ^; s; q" M5 c+ n( z& K
   take down R_mA) H9 S) U" `3 {: }) c$ h
   wait for e 5 min
) i4 F+ Y! @# C. y3 X   bring up R_mA; A7 l, n0 {' _7 \6 {! y" ]% ]
end
9 e# }& V7 w+ k1 l  ?$ u% |
9 b3 R, b4 p& M# rbegin P_mB_down arriving; z7 `& \/ v1 h- B1 ~
   wait for e 170 min: R# X5 M- M6 E: D
   take down R_mB- p, T8 e( S; Y* l& n& J  f% m
   wait for e 10 min' t( X" ~, X4 j1 `3 y( O+ Z8 _
   bring up R_mB. e6 a0 h2 U' T- ]* k* m& s
end/ ^/ i- v" k% Q# H- o
3 N2 m, q' Z' V( ]6 O
begin P_mC_down arriving
4 b$ e' c* T/ X. X; l2 X( N   wait for e 230 min1 J, e. D4 j; e' M+ D
   take down R_mC
+ I1 F; C2 V2 h* v4 Y   wait for e 10 min4 Z2 M2 `" k' F# ^- }
   bring up R_mC
" [" g! j; ]  R$ u' l% {4 T4 Lend# F* s/ }- }; j* t7 S, v  _5 H

; K' Z$ {0 {/ Dbegin P_mA_clean arriving. p- W! J, g4 u$ B! C% ]1 r
   wait for 90 min
6 g1 _! E3 v. a  |8 L   take down R_mA, I4 W) n0 V$ h: g1 H" O* t
   wait for 5 min- a8 m1 I* E& q" ~/ h* T1 b
   bring up R_mA
8 R( E. z$ O1 u8 |/ kend
+ b. J/ v; R5 T9 Q6 I- |! k; @
5 M# M5 N4 S6 i: jbegin P_mB_clean arriving
, c! V' I8 \- g6 q# l! X   wait for 90 min6 b7 r' S6 |  ?
   take down R_mB$ I' n: M% _% u2 f6 W0 w  v/ f4 W
   wait for 5 min
. g$ w) U: F: b$ H/ i4 p   bring up R_mB, t$ d. P5 c9 l- B( m+ B& x  \
end; n2 d4 N; k' b  E, f

/ u8 B* D: P0 X5 ?/ \1 Z6 Gbegin P_mC_clean arriving
6 o; z) ^- G7 [! k5 R/ q& K   wait for 90 min3 e+ p1 E& `  ^7 y* @. m
   take down R_mC
$ w7 k2 O3 }& ?   wait for 10 min# a4 G5 A$ ]/ Q) W* w1 K& D
   bring up R_mC
7 Z5 e& M9 c7 K8 j8 U7 uend
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
9 A5 H2 C/ J/ Y/ v   move into Q_wait9 F  ^9 Z& c! u. s9 }) z2 o8 F
   set A_q to nextof(Q_m1,Q_m2,Q_m3)1 @/ ^6 V0 x7 b' E$ ]9 E
   move into A_w2 A0 t9 p! P' ?7 L
   if A_w=Q_m1 then use R_m1 for u 48,5 min
6 b+ o* r& h, t& s4 S6 y4 P1 \2 k+ x   else if .....then use ....for u 48,5 min- @* L7 f, B: ^' v2 R9 a
   else if .....then use ....for u 48,5 min  
/ a+ t* r( o- e9 n' \   send to die
. P5 v, \0 @9 r3 }end- i: Z3 N& F3 _( F, ~, `0 e
' K' ~* H+ s8 y6 ?" c
供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-12-1 16:13 , Processed in 0.017371 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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