设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7072|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
  S+ @/ F% K* R6 t2 B. b/ K
7 n8 Y! y5 k$ ?: ^底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去
1 ^( ~9 u7 K5 M" R( U9 h1 g8 F( L2 a8 L& }
不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!/ I! _4 d. `! o( D! k3 ^3 q  \+ J

- h- o" t8 s6 O/ @
--------------------------------------------' y. C  b0 p% J, K! V& C) h* r
begin P_something arriving8 I  o) s/ F3 {/ D6 [+ H
   move into Q_wait
1 X' ?, Y: J' O% S   move into nextof(Q_mA,Q_mB,Q_mC): D; u2 ?+ m) l0 e7 z
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min1 G+ K# b$ M6 `
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
5 t$ R$ ^: g+ B& i( p   send to die/ W" ~8 \2 e! p/ [) t+ t+ \( S1 I
end

" l. J4 _! q. G! p0 i" V 3 v1 M5 }, ]; D9 R9 @
begin P_mA_down arriving
- F* d: e4 K8 d   while 1=1 do
" _. A% X* E1 ~6 M" D8 ^5 s   begin4 k7 z& ~1 R' t( A1 b! P
   wait for e 110 min3 I/ q( O5 S' g/ u9 z0 y
   take down R_mA
/ }3 J: |  I. I1 @   wait for e 5 min# M# f3 H2 L7 {& a
   bring up R_mA5 ?" E8 d0 x" f7 O9 q! _
   end
7 E+ p! G% X2 t3 s6 _end

; ^' l& u3 J- U  y! G1 }8 t) ? * w+ C# v1 K/ T3 F6 g- r: ?
begin P_mB_down arriving7 m( }; ]0 n. m( c3 c) L$ U  V
   while 1=1 do. ?2 q' R0 n1 s: p$ t7 k! h
   begin
) n& e- T! E3 d   wait for e 170 min
% q  ^# x9 v5 t, C+ W0 f   take down R_mB$ P: G" H( T: l' O
   wait for e 10 min! R2 E9 G6 V; |, P5 w
   bring up R_mB
; D5 S& ^: C  N" ?   end
1 N2 U: h! t" C- X/ v7 Q6 q" O) G  b. C( uend
" ?1 {1 k: V9 O( v* \- W3 u0 I5 z
* [5 l5 F$ y( l' L$ I; O
begin P_mC_down arriving
0 {# Y7 ~7 O8 e) i2 |5 k   while 1=1 do
/ e+ B) g' o  Y   begin
2 _: z) E- G* U8 O& U   wait for e 230 min
: T+ r3 \% S: j! a, k# Q! L   take down R_mC
0 J! O9 H( Q4 R5 J   wait for e 10 min2 E: r0 n& E8 `
   bring up R_mC% Z$ c& T3 S9 C. I  D" j
   end2 J1 R( I: e/ R5 u! i' o! ^  @
end

! `. j$ q' ?1 q. V3 R0 s , i+ I; p& M* |: t! L
begin P_mA_clean arriving4 d. f5 o! F% ^5 T  u# q
   while 1=1 do( X1 C# F: u% C0 U* U7 H' r9 V' j
   begin: e6 M/ v! \% I
   wait for 90 min8 |4 G. z9 B& ?5 \9 I' _  y
   take down R_mA3 n# I: R' Q3 ~' Y7 C
   wait for 5 min
8 x- y- [, i. }& T* H. O) a4 f; `   bring up R_mA7 U2 Y' E4 O0 X" ]# t
   end
* O6 E7 ?9 s2 i, y% \0 Q$ lend
/ U8 G" Z0 w( f" J" l. ~2 B
5 n3 w- [7 m9 g, ~- k/ h
begin P_mB_clean arriving. t7 L8 j$ ~2 A5 T4 b7 Z0 [
   while 1=1 do
" T8 j% o5 ]+ Y8 ~' ?) o   begin6 I, w4 `4 K; \" O
   wait for 90 min& p* @. q" X6 ?7 S
   take down R_mB; P4 K0 Y, t9 s' h7 R2 c! ~3 w2 Q4 O3 x
   wait for 5 min
4 @# P' I2 k/ H/ k% e   bring up R_mB- u/ w4 l. f) Z) T/ Y0 Z7 K7 B- @
   end
7 }7 e! ~4 A5 Dend
$ h. D3 _  d& y$ `/ ]

2 l. N6 n, i6 Bbegin P_mC_clean arriving
4 p4 H2 i1 I1 P9 h2 J2 }" [   while 1=1 do
# u( ?3 G: P# g1 c7 o- U8 p   begin
5 E3 v& w0 C$ S- |, i   wait for 90 min
4 n( @  g1 Q9 D7 _7 D   take down R_mC
* e, n' y# b/ J   wait for 10 min
; ?- n; l% i8 ?   bring up R_mC  B8 q; T9 e( B  t4 ]- ^+ f
   end8 W/ ?9 P- g! Y  `3 j0 ]3 X
end
( r' e8 P7 h/ b$ V% K
----------------------------------------6 c9 K& b3 g+ `
5 M6 _8 j/ s$ M. U) R
Exercise 5.9: {# M0 z  R5 E" b

) ^1 U/ u/ N/ A
$ R" k$ o, B0 e: X* H' h# nCreate a new model to simulate the following system:
. f1 ?& ~) k: A0 y) cLoads are created with an interarrival time that is exponentially 5 k9 j2 G+ P; p/ B) S; A  d. f
distributed with a mean of 20 minutes. Loads wait in an infinite-9 O! U( ~( m3 {! u- ]
capacity queue to be processed by one of three single-capacity,
5 `" |. x; R; F: a# `. varrayed machines. Each machine has its own single-capacity queue
+ P, b1 M5 I# W2 ~4 M2 Ewhere loads are processed. Waiting loads move into one of the three
7 B  c; r9 w% S: L: O/ l5 E" Gqueues in round-robin order. Each machine has a normally
' J! Y8 p, J: l9 j9 p2 A6 idistributed processing time with a mean of 48 minutes and a standard
2 v5 V+ R# k3 ^7 Ddeviation of 5 minutes., S. V: h, t8 G# N/ `0 K1 ~
The three machines were purchased at different times and have ! Y" j( w. E0 b7 K+ P% T# g
different failure rates. The failure and repair times are exponentially
& z, V3 L! Q: P6 x9 Cdistributed with means as shown in the following table:
9 i; x( ?. J5 ~6 U* _/ _Note The solution for this assignment is required to complete
0 e  G; ~" T6 ], I7 X; }exercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
: W2 _1 z4 q  Y+ a% V6 G. m2 Fyour model.
/ w+ l; _* n) J1 x: c$ B3 K
( ~9 L3 w7 ^  ]# l3 h# i1 _4 cMachineMean time to failMean time to repair; E% q& p' J+ H8 u
A110 minutes      5 minutes
& r1 w( ?  h. S% Z7 J, M2 jB 170 minutes     10 minutes
* q6 g& X4 x& z% ~% a% U( LC230 minutes      10 minutes
" B$ ]2 {/ _# p+ h" }. v- Y$ b+ o( P& H4 O: C- G* `. B
The machines also must be cleaned according to the following
! D- w' `0 b+ e8 R. v0 I, F5 `schedule. All times are constant: ' e1 @- I& n' ~
6 p+ |* S0 f& L( o2 c: O! @% w) f
MachineTime between cleanings Time to clean
9 S+ w- J& I: o! m4 R7 `A90 minutes        5 minutes
. s5 o( R% @% O, DB 90 minutes       5 minutes
6 w. M. Q" f7 q5 ]- r/ rC90 minutes        10 minutes- G, {% v5 l$ I6 A

5 G0 u% a1 o! Z- `% c; Q( }2 RPlace the graphics for the queues and the resources. ) O* |% T- G; ?, x( Y0 l
Run the simulation for 100 days.
9 u- }) J. ~6 S8 \* {Define all failure and cleaning times using logic (rather than resource 5 b3 [3 s3 X# i1 {* n6 @! z4 T
cycles). Answer the following questions:% m" ~) b3 k! v) }2 N0 X
a.What was the average number of loads in the waiting queue?
. u* Y  i% m) k/ z, xb.What were the current and average number of loads in Space?
$ C& R9 r9 h: F1 SHow do you explain these values?
1 \2 A, I8 v/ Q

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉* ]3 g0 T* N# L# ?% C* I9 e
send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean); K. q. Q: \. h- [4 V7 p
这行好像也不太对,各位先进觉得如何呢?
8 H" l* M& n$ i% J. w
! O) C/ O* b8 g0 o) \0 l, B# Pbegin P_something arriving, H. [/ C# C2 h, T5 c" _
   move into Q_wait( q/ v% n* X+ W2 v- p) t. u
   move into nextof(Q_mA,Q_mB,Q_mC) ( R3 n( s  ^- B' {2 J2 P
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min+ |+ {) x2 a9 D/ X) @
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean) ! p# z  P% ]# p( T& e3 [1 F( j* w
end
/ Q2 t3 d- k1 n5 ~' q& \6 O
9 ~! s" T, d; ?0 V% ubegin P_mA_down arriving6 k1 Y- H0 @' K3 s  d. J" b
   wait for e 110 min
# {' t: c. W& z! f! N& Q$ u6 q   take down R_mA6 L4 Z% u3 i8 S
   wait for e 5 min. K: b3 B" v! [* z* _& k1 F$ K1 O
   bring up R_mA
) n  j2 ^- ^) D% A& T" Vend9 y  U6 X) U+ H( j

$ Z9 D) K. b+ \begin P_mB_down arriving6 {  S+ a1 |. O( M
   wait for e 170 min
$ `  [! Q  {) T   take down R_mB7 z  r8 ~% G9 L) k& G; m0 e& a
   wait for e 10 min
* L9 E9 E" f2 L* k: `- I2 ~" r3 {   bring up R_mB
* j7 U" h, T) A4 N( rend2 t' u. i! U# F9 J" P
! Q6 G& e% K* s4 d, D+ i
begin P_mC_down arriving
( k/ t, g# t: n; I- v   wait for e 230 min% W, C' A. J+ C. s
   take down R_mC0 d: N$ O, r$ N, Q- C, A: O& }
   wait for e 10 min
1 E7 h' G7 L. s2 L* B" o   bring up R_mC2 a8 P8 p* d# I: C9 c
end, K3 E5 l4 N' X6 u, Q5 ]7 O% S- O
- w- F6 E* g( p6 m+ B$ }6 E- x
begin P_mA_clean arriving
. n. q+ S1 v7 C8 p6 t! z   wait for 90 min
: I8 b( L: B5 O   take down R_mA
1 A- A7 @" Z9 r  u% S- q4 r0 F  R& o   wait for 5 min
6 G$ t+ T4 f; {6 ^, }/ l3 I3 X   bring up R_mA
! b5 ~3 n0 g; s4 q5 vend8 Z  d, E7 d3 R6 s- M9 M

9 Y0 k( s, B8 z( @% I" Obegin P_mB_clean arriving
" x. p9 _$ E0 N/ x, o9 h* {; O   wait for 90 min+ `# C4 d3 K6 `  G9 I5 b% E
   take down R_mB
$ {* K  p* f1 z# m   wait for 5 min
3 `# Y% o- F) p) w; H4 i   bring up R_mB( M( R- N3 j. H' o( W4 N6 @* \
end. k; c- m2 m4 B* U

/ j% F4 ]6 n8 \, c3 Wbegin P_mC_clean arriving
" {6 y% n4 s0 {" ~# l. c3 M   wait for 90 min1 `, k* H, R- d$ o% K$ T8 z
   take down R_mC0 V. F9 }4 T9 G, }% E! l4 H6 X* N/ w
   wait for 10 min: y* U) F2 k( t& Z3 h- P! L0 N
   bring up R_mC6 O! K. l7 Z$ @6 E$ [  v) ?' b
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving, a$ Y: r/ o6 r% j- }. @8 x  V
   move into Q_wait9 ]- C' U- _6 u" ~4 M& `
   set A_q to nextof(Q_m1,Q_m2,Q_m3)
6 a2 n7 W- ^5 L( v9 C! K   move into A_w. K6 y( ~, s* H& O2 U& T
   if A_w=Q_m1 then use R_m1 for u 48,5 min
5 r( A7 K3 X, {3 _6 H+ H   else if .....then use ....for u 48,5 min
$ Q0 E& W. U" u! R4 Q" o   else if .....then use ....for u 48,5 min  
* W; D( \, y6 B8 e6 M2 L   send to die5 ]/ C9 ]* R5 ]
end
* Y, A) g4 q" U. y: A! i! g" a& f' W+ i: ]2 ?( r7 V6 Q
供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-10-24 11:05 , Processed in 0.011553 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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