设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6559|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
) X3 e/ v$ E* U3 H1 e, U
! T- _7 \+ t, ^0 @; H  M% E' l, D. d底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去
- b1 x, E8 I  R
; n: e( _& k5 s  V不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!& ~3 S, ^8 R; {5 a8 V, ~

" \8 r( s& h* b- c
--------------------------------------------; G4 M+ `" \, B+ z% S
begin P_something arriving9 \7 R# S  S, i8 |: p" }( j
   move into Q_wait
( T4 c' {* C0 G! e: x9 }   move into nextof(Q_mA,Q_mB,Q_mC); A( W3 c7 W# [: c* ^1 b  l; F
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min2 e/ F: [' z0 Z
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)/ q) p1 C' t  p
   send to die
' d  U4 L1 E7 F8 w& k" ?end

( u) G1 T" w) ?; i% N # F% ~9 u2 n/ G9 c6 n# n# t  e
begin P_mA_down arriving6 H6 m4 z& O7 R: X  \' U0 q
   while 1=1 do
; j; i* d5 b+ f8 u   begin
; ~/ t4 G' k& L" c& X" I' T   wait for e 110 min2 k2 k  B7 m4 ^1 M& b5 Q) X
   take down R_mA8 A7 O8 R/ `# e; [/ R; h
   wait for e 5 min: ?% T) J* w( n9 S9 U  ^
   bring up R_mA
' d+ b& q2 S, _* I5 K( p$ H( [- W   end
, g2 C8 w7 @7 lend
* _5 d/ {$ B3 u# e" \. m* q
0 p, ?7 b' t( Z# e- I, S
begin P_mB_down arriving/ d2 m4 W& N1 e8 a1 U2 c; R& V$ p
   while 1=1 do2 ?& i2 Q0 [5 V: L, K- t+ I* C
   begin
( M+ e3 ]/ v1 l- }   wait for e 170 min
+ o* H  M# n; z3 c" u) N   take down R_mB: ~! G* n6 w5 j1 U
   wait for e 10 min  E# m; J, J" g9 c
   bring up R_mB
" v3 a2 J3 _1 D/ x3 b   end
! S* a2 w7 ?0 I6 Z  Y3 {7 H+ Xend
" \. {8 o7 ]  I5 X$ T$ n/ H4 N
8 \+ X* {5 f7 F) v
begin P_mC_down arriving
3 x* H* q; @$ |+ J$ g; m   while 1=1 do * k# S7 ?; y6 E: R
   begin  `& C: H, I" r% T5 Y
   wait for e 230 min  Y, U8 J! g! e) d- x$ e% W3 l
   take down R_mC6 }8 U3 G- D0 _- l1 J
   wait for e 10 min
1 q" `6 S6 k7 f/ z8 M  b   bring up R_mC
( t; o  t3 [( |: L   end. k& v) q8 V" D1 R; R
end

, x/ `! R/ I* F! r$ |; d
+ P9 C! e4 z6 p+ i! O1 lbegin P_mA_clean arriving
. Q* f) P1 V9 e4 K   while 1=1 do
9 e+ i; v$ X) R  K4 @9 y  e# G   begin
  s1 [+ |$ H7 i0 M6 q. [   wait for 90 min& r7 J- F5 H* t: k$ w1 B
   take down R_mA  M) p. T. \' b1 O* K" A4 e
   wait for 5 min
) u$ j/ O7 t. s6 {  `   bring up R_mA
% r7 c& L- J4 f; v$ |   end
* W$ t8 [& z( V( X2 e* Qend
2 A# G/ k) l2 V! z; G; F. ]
4 v3 n& V8 ~2 j1 A# J  P$ G3 G2 l% n
begin P_mB_clean arriving. I9 m. z9 E  Y5 r& x; h4 R0 J
   while 1=1 do
. x& Z- `3 [+ Z0 J4 q   begin, U" @9 M. o5 m3 @2 G: C
   wait for 90 min
1 r$ b" U4 i$ l6 A! I7 o1 U   take down R_mB
8 S# N3 [3 S; O& h/ b- c   wait for 5 min
& Z& x; W" I- i9 c   bring up R_mB- v6 K! a& N$ g: ~& y! u
   end
9 t- x: Q" L9 ~end

9 D) \0 x, {( w, P0 C6 b/ S+ \ / l+ m6 k1 Z. E9 g1 t
begin P_mC_clean arriving
/ e* [1 h& B9 w# U   while 1=1 do
3 G" a5 T7 R1 h6 G) P* v5 X4 [% R   begin
- @9 _. Z3 n/ `+ U) @   wait for 90 min" Y; S0 M  Q$ c1 b- O! j% z' e
   take down R_mC/ G/ `. ^5 H7 x
   wait for 10 min
* E+ R. |1 s- P- x  B" F4 w' _" L   bring up R_mC
6 A5 q/ t! y7 T! i; Q   end( j4 N. O3 d2 Z1 H0 ]
end

+ M4 d8 @1 C5 _. Z  f5 Q----------------------------------------1 J6 }0 g. ^: O" L* F

1 v4 x3 N0 u* K( m! z1 ^Exercise 5.9
8 y9 m" D: Y, v
7 K2 y. ^9 S5 ?% |7 u7 N/ J; i8 n2 b  l2 A& v
Create a new model to simulate the following system:4 \8 L0 ~/ z$ v( @* a. R
Loads are created with an interarrival time that is exponentially 7 t, f* C( R# n4 }
distributed with a mean of 20 minutes. Loads wait in an infinite-
( \% S+ a3 G. B* J$ M! C- c# G: Tcapacity queue to be processed by one of three single-capacity,
8 D. c9 h7 o' _3 a( G' ^arrayed machines. Each machine has its own single-capacity queue 5 u# z/ C7 `5 b+ r  S. `
where loads are processed. Waiting loads move into one of the three
8 \8 w9 c* P) ]3 |queues in round-robin order. Each machine has a normally
* Y% Z  U$ G% n3 `# b- pdistributed processing time with a mean of 48 minutes and a standard
$ {" g7 A: |: |$ V4 {( z! b& ideviation of 5 minutes.4 O* H; q# c9 L- J
The three machines were purchased at different times and have 2 g6 j/ |- J' m- }
different failure rates. The failure and repair times are exponentially 9 Z+ K4 t0 y1 G* z, T/ T
distributed with means as shown in the following table: " m% g8 Z) s! W  v/ p
Note The solution for this assignment is required to complete
- t( P# a, R4 y1 E, K% @; oexercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of
! s' }5 @# f7 I! t8 s5 ~your model.
! j$ j( r. u" z, h+ u5 l9 y" O! X- p5 l; @: J
MachineMean time to failMean time to repair% k$ [" j" i: f
A110 minutes      5 minutes
# F( _, m) X  m* Y& `6 CB 170 minutes     10 minutes
7 U2 A2 k  _4 c  g4 p8 L, rC230 minutes      10 minutes
) r9 B, U% \, O9 E8 R" _1 a0 N4 W- h+ c* {
The machines also must be cleaned according to the following
  X0 n+ |0 ?- a( U5 Fschedule. All times are constant:
5 [, P- [3 M4 y7 n$ ^5 ]
- S2 g% ~- N1 f) r2 m$ `MachineTime between cleanings Time to clean
5 q7 ]" m- I, s/ `8 v% lA90 minutes        5 minutes" A/ ^1 O) m6 l) X9 W0 E
B 90 minutes       5 minutes% n2 _/ ~. S* ^' R+ n3 H2 I
C90 minutes        10 minutes6 j- o: ~) m% l7 y4 C
- ^& C3 |9 J* @0 @/ F
Place the graphics for the queues and the resources.
0 L" [: c) b% _! {0 K9 gRun the simulation for 100 days.( k7 n. x/ V5 v$ e4 I+ i
Define all failure and cleaning times using logic (rather than resource
# |& O- o% Z! Y& dcycles). Answer the following questions:+ |! m7 v0 t- _6 R1 L" B+ {( P0 a
a.What was the average number of loads in the waiting queue?
" H% d3 `& S2 _( L* |b.What were the current and average number of loads in Space? & r: M9 Q3 v' E0 R9 w& @
How do you explain these values?
( C; x% [% N, v

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
# X( Q' K# O- t2 A6 ]" N! hsend to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
% ]# X  {2 a1 w: U8 F2 u& K这行好像也不太对,各位先进觉得如何呢?
: \/ V6 [9 _+ _' _, C2 d* y- X' P( Y, _# n! d( i; ]% T( J8 U* C
begin P_something arriving. g/ U" r' w8 J+ y+ B
   move into Q_wait
+ G+ h: _2 d8 J   move into nextof(Q_mA,Q_mB,Q_mC)
! s: R! u; O* G8 H   use nextof(R_mA,R_mB,R_mC) for n 48,5 min2 Q/ ^- f2 w2 O0 W  u" J4 h* {' t- k
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
4 a6 S. r# }5 @5 S7 L- Jend
! x+ e) @7 s6 [
2 V0 Q& i) }$ O1 e/ N" V3 c: [begin P_mA_down arriving/ ^  K& {" H# n& [4 [( _& |
   wait for e 110 min
2 {& i3 B, M$ A4 o5 H$ ^   take down R_mA' r; E# A* q6 Z/ n) E# B
   wait for e 5 min4 Z( z- ]5 ~( M% C& I
   bring up R_mA) |5 g+ z" U& z) w
end1 w+ g0 @+ h, o0 s1 `9 s& D

4 b, M+ F" C/ D! c4 Abegin P_mB_down arriving
- O$ e# z! U( ~   wait for e 170 min3 T+ Z7 R& s$ |
   take down R_mB
& T, A% v3 E+ Z6 t/ }   wait for e 10 min/ L9 w- W. u6 S! w& k' q
   bring up R_mB
/ w- @6 q& K7 n! Wend( |9 b( [' W! t/ t$ f' d/ t
1 l0 z* |/ i$ O& N$ E1 X6 l
begin P_mC_down arriving
& C! U2 }2 j  U; o9 H8 v# u   wait for e 230 min
" h4 I  a" `9 A$ |, U* w9 f; M  U   take down R_mC# ~, S) W' `" \1 G
   wait for e 10 min! c% ]8 @  V& s7 x2 h
   bring up R_mC' F* ?% X% `: J2 V2 P8 V. j: b
end$ e8 f* L- c* U# v& ?' S2 \  Q( O

* ?# c3 S, ]/ e1 jbegin P_mA_clean arriving( C9 _, l( b# o& j3 n# w5 k- T
   wait for 90 min
1 ~4 _. G2 P% E   take down R_mA1 D' i! o0 L6 X! k! U
   wait for 5 min
# L+ n7 {; R% }7 M9 c; I; ?; @   bring up R_mA
4 q! p7 b- V" c/ B2 r- hend$ h1 c; X; m$ i' y1 \

9 P( Z  u. @+ W7 `" ]begin P_mB_clean arriving
; ?$ _4 Q" P7 G/ f5 _   wait for 90 min
$ r$ ]5 O" Q  _" N# F0 }   take down R_mB7 S' B: u/ O& C& ^) F
   wait for 5 min
/ }( s+ t  S5 [3 ]3 ^1 J3 I   bring up R_mB
7 J3 V/ L7 j' B9 W  R# Mend0 N9 ~7 n5 l9 P' C+ m
9 W+ b+ t# d$ z
begin P_mC_clean arriving+ i; m' v8 I  E, ]2 Y
   wait for 90 min
- B) J" l# D2 M4 n6 a$ p7 D% R   take down R_mC# C+ h* W4 H+ g  _9 }) L: P
   wait for 10 min
  [9 w/ m2 \6 B* ]4 I   bring up R_mC
/ G0 G" V3 |+ ^" p' Y+ rend
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving/ @* c4 X! [/ A3 y0 ?
   move into Q_wait
% n9 c- K$ E3 b   set A_q to nextof(Q_m1,Q_m2,Q_m3)
! D- G8 [: a5 W   move into A_w
7 j8 t. b# a: k# h$ H/ d   if A_w=Q_m1 then use R_m1 for u 48,5 min9 q0 t+ p, D2 P" E5 C8 q# I2 p
   else if .....then use ....for u 48,5 min! n* r: U: W+ N4 ]' o
   else if .....then use ....for u 48,5 min  
: ?6 r9 a2 J# m  S3 Z: x% }   send to die
6 P% h$ Z7 Z" K9 C  u' g$ dend" G5 X8 g3 {* [1 k
2 @/ Q6 }( O; W
供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-18 14:09 , Processed in 0.017832 second(s), 12 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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