设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6863|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
6 @# w: o( E" B( L7 A5 C/ F6 c1 m; T/ G, ]* M+ t' s. G& _
底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去
& i( q% B9 ~! x, r: W2 I6 i
* D/ \  j2 K1 b  Y+ i不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!1 o4 \' Y% E& v# R3 g5 |
- y4 [' g2 L1 z0 v- u
--------------------------------------------
- x, B; }2 r+ Rbegin P_something arriving
) o1 P6 ]" ~. h) V   move into Q_wait
4 g# p* ]/ ?; Y' p! ^( R   move into nextof(Q_mA,Q_mB,Q_mC)
# n. }1 @% [+ E1 w   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min4 n2 v* G% K9 i9 H- x* O6 p
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
5 n4 B4 }8 R' v4 I; ]! s   send to die0 j5 J/ I( Q0 \! S- i0 a' n/ {# @
end
$ Z% w; @( n  n
  H+ I/ W* v& N1 Q4 U
begin P_mA_down arriving8 I- q; z' i; h# |% {6 S
   while 1=1 do
8 C, Y& p# R, B/ h2 O   begin
3 L3 W/ P5 e) J, q, W3 }' D   wait for e 110 min- o0 d. o9 t; X1 Q
   take down R_mA3 g- n1 {& Z. `! y4 R* l
   wait for e 5 min
7 h4 I$ _- n! S) P3 E" D, ^# D5 X7 F   bring up R_mA' o: `" O  E3 v7 c& ~
   end
: |: |; k$ k5 I8 q9 l) ^end

3 o/ `* e, H3 a  B  I + h8 @5 M% |3 Q! M3 b% {
begin P_mB_down arriving, ?! a9 J6 w1 l+ N( ^8 q0 T; q
   while 1=1 do: ?: X# ^, [6 }
   begin
' f% d# S; q! J$ _   wait for e 170 min( y; J1 n" i# R2 G! o1 r6 w
   take down R_mB$ ~& t7 M: [7 R0 G! ?
   wait for e 10 min8 m) V. V) q- v9 e" }2 G# t& B
   bring up R_mB
/ R# P3 [4 t+ x. p$ w7 V2 T# H   end
0 c- K9 c* B+ O3 ]& z* Zend

3 o6 I9 ]# ^# V/ y : g* Y# F: b4 W( e
begin P_mC_down arriving# T8 v2 b2 P* h. l
   while 1=1 do
6 P% ?8 d7 n) J( q1 W   begin
, C0 C7 E5 @3 X& Y( f; e( ?) N( G   wait for e 230 min: y% C5 x' C2 _& x. Y2 Z
   take down R_mC, ^! v  M3 d( n! h* e! e9 _, C9 M5 H
   wait for e 10 min4 n) M8 S' A) a( C3 d
   bring up R_mC
0 J+ E" R7 u' k4 D3 O  C5 H   end+ A" s5 A" k  z, c* b
end
# a; L  Z0 o! j  B

1 G: D( [8 c  X9 bbegin P_mA_clean arriving
; b9 }- E5 K5 i( N$ s6 Y   while 1=1 do: @9 ~0 z% ~1 a9 h: v
   begin! n/ @0 l3 U/ V; {
   wait for 90 min
5 q) u$ R  _8 a4 k   take down R_mA
/ U6 N/ I3 @7 q) W   wait for 5 min
7 d4 O& i$ V6 `, g0 ?4 B" Z' O   bring up R_mA
' B& E' D0 K- l$ F' h9 {   end+ U$ d% Y0 C# v2 u4 b  n
end
* U  a: r( v9 {/ {

1 X( c0 C0 @0 \7 p7 t3 y/ Ebegin P_mB_clean arriving
0 g, S- c: K" S: S   while 1=1 do+ x# |: L/ [- _
   begin
* ~1 ~$ i- ?+ I! @   wait for 90 min. M: i+ q7 @/ y. i
   take down R_mB9 o4 B$ [) s# t, }: t( X
   wait for 5 min
$ Y7 T0 S  J# e  o0 f3 i   bring up R_mB
0 N9 d  Y0 z7 m& }/ g  k   end! d( j0 R. @6 q2 Q
end

. C% ?& b' Q/ J' O6 \5 F7 s
: z1 D1 r+ x0 q4 i) Z. S, ]begin P_mC_clean arriving& ]+ g! z  u( q" I4 B5 A' U
   while 1=1 do& z, x# g! B! c1 s2 q
   begin
4 M* ~4 x4 j2 |9 h+ S9 X   wait for 90 min0 h  }  i  T8 @* ?" a
   take down R_mC
8 F3 s$ q5 j. l9 [* ]8 n7 ^: X   wait for 10 min& E) h, H* N' x- }/ `
   bring up R_mC8 V3 o4 j9 V. Q- Q7 s
   end6 A" I$ i3 g$ G2 S5 K! C
end
' E$ i# `5 g! ^; Q
----------------------------------------, ~. ~+ f0 s/ c6 t# e3 L" u7 Q

: O3 d0 E( }+ |Exercise 5.9
5 G/ V2 R, T4 C9 V8 ^/ Y
& E+ y, x7 ^; J3 M1 e' l6 Z$ l$ [3 u
Create a new model to simulate the following system:
' J4 I: R8 J7 x4 |* K5 q) t1 Q" |Loads are created with an interarrival time that is exponentially 2 L4 S; y0 u0 ]  I8 q2 z2 ?3 b
distributed with a mean of 20 minutes. Loads wait in an infinite-0 x. S# ?1 g+ S
capacity queue to be processed by one of three single-capacity,   v5 y& O6 e3 c' e+ z( C. N7 @; b+ X
arrayed machines. Each machine has its own single-capacity queue 0 _7 M' D1 H/ B5 w9 H. y9 o
where loads are processed. Waiting loads move into one of the three
/ L0 Y  w8 V3 L+ ]4 W  v& p$ Dqueues in round-robin order. Each machine has a normally
3 {0 q; g% F+ K, B! ydistributed processing time with a mean of 48 minutes and a standard
% B5 B) P, b6 B! q0 S, Ddeviation of 5 minutes.0 N) v5 g! v, Q& u8 V6 v
The three machines were purchased at different times and have & a/ T. B* M' _" I! U7 p* J( y  u
different failure rates. The failure and repair times are exponentially ! b3 x# q; q/ r1 q7 `6 A
distributed with means as shown in the following table:
- P2 b' }) X4 i! k1 p. [Note The solution for this assignment is required to complete
% s! g1 _  n" s$ U6 ]0 a7 vexercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
  b/ A. M7 j2 ]7 C  qyour model.
' p! F4 Q# V$ ^( P$ @
0 F0 n4 G( ]/ o' v+ Y) ]" z$ |MachineMean time to failMean time to repair
0 S* y7 e5 h4 S- [. u! tA110 minutes      5 minutes
4 P" a+ l0 P( u, k9 i; BB 170 minutes     10 minutes
; t  r( _6 n$ q0 kC230 minutes      10 minutes
& X) p0 W0 r/ G2 g" I  v" T( J9 T, i! [0 K( f
The machines also must be cleaned according to the following 3 ^2 ]: h4 d" V- P6 O# L4 s
schedule. All times are constant:
1 a) x. }7 D( i; m! |1 G0 g2 s/ e* h) A  C
MachineTime between cleanings Time to clean
: z) P% K3 Z2 \A90 minutes        5 minutes6 u. Y# a7 U7 s$ d
B 90 minutes       5 minutes8 z: k# w4 j) \) k! j
C90 minutes        10 minutes. o' d) f! @/ b/ r* g+ r  Y- ?

, \6 p# P8 s5 d0 t* z0 o9 m1 H1 ePlace the graphics for the queues and the resources.
; f* f1 l  d+ L% G1 _3 oRun the simulation for 100 days.6 M3 E; `1 Q* }6 P
Define all failure and cleaning times using logic (rather than resource 6 J( K! t9 b0 b. L3 d
cycles). Answer the following questions:
" B7 t4 U# E- J: W: z- [) [a.What was the average number of loads in the waiting queue?2 V/ Q8 G! H5 v% c/ I9 c
b.What were the current and average number of loads in Space?
) q" B6 E  }% w+ d9 ZHow do you explain these values? - c! P! u/ E7 S) d* U: I/ @3 K

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
: x" a( e7 A6 M9 g0 C  ^& a) Ssend to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
/ `$ ]1 p) D& G0 r这行好像也不太对,各位先进觉得如何呢?( U. ~5 w" J3 t. K1 n

0 g. r+ r8 m! F. h3 j. x; y& Dbegin P_something arriving) I3 e) x, m3 m/ T; K
   move into Q_wait0 K; K" \0 K7 C6 X
   move into nextof(Q_mA,Q_mB,Q_mC) 8 U  d8 [% D2 z& U+ V+ B
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min. q  ]4 E9 n" o) o
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean) 1 s! _0 i/ b8 ?$ y' _
end
% d. l" p. k& v/ J, ^6 k1 K' t, x9 C
begin P_mA_down arriving
6 F% F) O3 ~# i2 {   wait for e 110 min$ o; ^( [: s7 Z! H& ~
   take down R_mA
6 z: w5 H# M7 P0 n( d+ O0 B8 I   wait for e 5 min1 b% M; M/ Z  y( \  b
   bring up R_mA
; g) H7 L4 n) i5 z& _/ [end/ J+ {, R; Q  e& J  ]7 F6 h

* G9 J2 [3 b  N) A/ B" r9 }begin P_mB_down arriving
+ e. P  g" \+ ^/ e& \. a# d   wait for e 170 min
+ b7 W2 w6 g/ i: L( v* ]- Y' h' c   take down R_mB  W( B! s8 a# Z' \/ C' u9 _9 l
   wait for e 10 min' e# ?- N, k/ M/ ]7 Z4 I/ `' x) \
   bring up R_mB) ^9 \  f5 N# B$ F5 j: ], f
end
9 o. o/ {$ z" ?1 g- l: T% G. K  G  h5 g
begin P_mC_down arriving3 b/ I: y2 Q2 M$ Z
   wait for e 230 min% m6 a5 r' e" y, p0 X
   take down R_mC/ }+ ~4 x7 T" h) x$ Q
   wait for e 10 min
; h/ G5 @' U$ P1 U. H0 E   bring up R_mC
% \& u% d* _+ N& oend* }" F8 }: E% @& R2 d& u, ^

% @. Q4 o' E) R5 n5 Tbegin P_mA_clean arriving, o! i' @/ W# S6 N$ |3 l3 A
   wait for 90 min
% {6 K0 c! Z( J( Q" ?6 l/ L   take down R_mA
3 ]- F7 W: O5 g  B3 L   wait for 5 min
3 i/ c$ ~' I: B/ ?   bring up R_mA, B+ \0 @9 `! s/ }% f6 Q* |$ K' F7 [
end
( X- ?- y4 r0 G( H7 C; x( W5 s* V$ m  k4 C* t3 K( {
begin P_mB_clean arriving/ Y) ?$ T, o) `/ E& ~$ Q( A
   wait for 90 min8 ^) ?0 W/ K- m% [! e
   take down R_mB2 s# n# Y+ g  x: E" `$ M; Y
   wait for 5 min; B# S" X$ C, Z/ I/ d5 w; @% z4 Q
   bring up R_mB
8 k4 D% Q7 t( U8 k6 }" Zend
8 w+ W2 K% I% N0 t3 h1 V: I& N) ?9 c& ]5 Y
begin P_mC_clean arriving& l3 W7 B0 r+ j0 o/ v4 p3 K
   wait for 90 min
3 P' k7 T1 x- Y   take down R_mC
! t$ d: F9 H4 l   wait for 10 min1 F% G4 d8 n: {; i- C( O9 _
   bring up R_mC
# n: ?: o+ w% Y, Gend
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
) D: L& K  [  o* c) W- U4 X" }# e6 v   move into Q_wait: a, @5 n+ @9 C4 n
   set A_q to nextof(Q_m1,Q_m2,Q_m3)9 h3 y' I/ k. ]( B) C' V8 J* l
   move into A_w, w  }1 V+ x4 y# W8 p+ h+ Q" \9 ?, g: d
   if A_w=Q_m1 then use R_m1 for u 48,5 min
# F# }0 d0 h% D9 w* ]4 H   else if .....then use ....for u 48,5 min
  {* P5 P  I3 U: }0 o) X6 W   else if .....then use ....for u 48,5 min  
, O, j; l2 [$ u9 H3 a/ u0 L( U4 s   send to die
6 O% M) D$ G' h- Yend
- L! J# j# z2 I2 y( v9 B8 z! y. \: u
供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-9-13 23:14 , Processed in 0.012962 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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