设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7234|回复: 2

AutoMOD内附练习问题

[复制链接]
发表于 2009-12-5 15:47:37 | 显示全部楼层 |阅读模式
50仿真币
本帖最后由 GJM 于 2009-12-5 21:43 编辑
. f, m2 k9 o0 L/ z: d1 _$ _* K
; V- G/ Q3 C/ ^, ~底下是小弟做AutoMOD里面PDF练习的(Exercise 5.9)逻辑文件但问题是,程序只RunMachine AMachine B就没继续下去5 ]* p8 ?7 Y; D- Q7 S1 F: C% H9 t
( \$ i2 k! [4 R3 X+ w/ y( B
不知道是哪里出错,另外这题和Exercise7.1的题型类似,请问若要符合Exercise7.1的题意又该如何修改呢?请各位先进指导,谢谢!. K8 q5 _; a& C' R- Y% S

# S$ \. x: I/ J9 h+ m* ^* T
--------------------------------------------. j8 e8 N# U. i
begin P_something arriving5 G+ ]& P4 w4 P) \$ B
   move into Q_wait3 D( o* I" F! I$ u* H
   move into nextof(Q_mA,Q_mB,Q_mC)  {" v- g. A4 |3 H* C" o! G
   use nextof(R_mA,R_mB,R_mC) for normal 48, 5 min
, N9 h1 c0 \, G# j. M/ M) o   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)6 h7 s' \" y# k+ i
   send to die& h7 I, d  U4 ^, V& W
end
! {( |# ~2 u/ f1 h6 r5 u

/ d% h; _5 y3 y% m" b: Q  abegin P_mA_down arriving: g* a- ~) M# v0 ?
   while 1=1 do
3 `- D, m" i! A& o   begin. b* P" Z  F+ ~" ]' W6 |2 `
   wait for e 110 min6 ]" i; |: _& q) I; ~
   take down R_mA
3 A' H, ?* y# U% S+ X   wait for e 5 min0 ?; A' I; j( }
   bring up R_mA1 ~9 w5 Y3 ?; d- G8 e/ o
   end
# r1 v. T2 S" ~1 V# Fend
  v/ U* {* O" K
/ U2 _. R: y" d
begin P_mB_down arriving+ f1 X) z' R% I& W
   while 1=1 do
) t* D6 L( N; k  J   begin6 B' C5 {6 j$ o! i: e
   wait for e 170 min6 D( U* F; C9 j  Q# u
   take down R_mB
( R& x. N- g. `7 Z: i; w% O   wait for e 10 min% ]$ k3 V: O+ E) _- L% V+ Y# y
   bring up R_mB
' B6 G* i( I5 Y: k   end2 ?( l! I% f+ ?+ J8 k5 g  M) X
end

6 H6 B( ?( p/ I9 f; c- o - {6 \6 L% x& v. t8 x# m8 D' \
begin P_mC_down arriving
# u, Z, h4 T9 O  R/ j: ?8 _   while 1=1 do ) j* y: ?, F  B* n+ y; B
   begin
3 x8 m9 C/ o+ D   wait for e 230 min7 \' Y; @: h8 {8 K- e
   take down R_mC
2 Q& p! r3 p3 d1 q4 b. U' Z   wait for e 10 min
* L, J# f# e4 h  d   bring up R_mC8 _2 n, ?3 h/ f2 i
   end
; n1 Q1 k9 L  jend
6 o2 o# h8 A, D  d3 O

9 {6 p: }2 V$ h, v8 M" jbegin P_mA_clean arriving
# V8 [0 {2 ?8 o6 b& m( ~   while 1=1 do1 q$ z& E6 f* T( @6 d) }
   begin
6 b2 d) m. J/ k+ x1 _2 X: y! n   wait for 90 min
( ]- w  P  I* }0 l( Y   take down R_mA
  I* [% @. n0 g9 L' D. G8 Q   wait for 5 min
/ Q3 L% V" Z' z5 c2 n2 N$ [   bring up R_mA4 c& @/ z* |; Q0 C. }5 ^& O
   end0 J& n4 B, ?# A# R( c; i
end

9 C4 ]3 o  q1 [$ u* C8 U & J0 f" [) q# c! z$ ~
begin P_mB_clean arriving3 B, E. Y* C1 E: a4 g" d
   while 1=1 do1 p7 O' b* C* O- L
   begin
, i: M3 i$ o' u# e4 G5 X( k# [0 n   wait for 90 min! d( \. a6 P5 d& G7 m
   take down R_mB$ _  F; \- {3 O3 U
   wait for 5 min1 G- d( u% V- Q
   bring up R_mB" I. D' e, H1 {
   end
$ E+ ]1 x2 N" P8 ~/ cend

+ v; c, f: E, r " f& d: g- |& ^6 }  D, T3 n
begin P_mC_clean arriving
- S  W' t: J( P   while 1=1 do  I* l/ i( m/ J/ E
   begin
- m8 o; O. g; F9 ?   wait for 90 min
8 Z6 f' i/ S& A1 \/ G5 c1 x- T   take down R_mC
4 T; B5 h2 n! p; W% [4 `   wait for 10 min& e% T4 Q" A; }/ i  W
   bring up R_mC
) u+ p* r& R. Q; Y8 C   end
% Y8 z' ?: X/ `! x: |; l6 tend

4 A6 e5 e/ ^/ R1 x& n0 T5 p----------------------------------------* ]: U4 ~% O8 u. U8 Y, e

3 @3 a) m6 ^9 l3 J( ^# BExercise 5.9
3 _) o3 j# ^% `2 }
( Q& k! `* N( [, T4 o
: b  ?. o3 A! F5 DCreate a new model to simulate the following system:
7 U0 F1 c1 l& o3 O( ~. q5 B0 N. ^Loads are created with an interarrival time that is exponentially 4 [& p: @; H, Y3 s
distributed with a mean of 20 minutes. Loads wait in an infinite-
6 c$ g$ y8 L. J9 U; K2 ?( zcapacity queue to be processed by one of three single-capacity, 8 V! I2 T/ @. H. X1 i
arrayed machines. Each machine has its own single-capacity queue
& o: F+ O' s& s/ O8 s# `/ E# G0 Awhere loads are processed. Waiting loads move into one of the three $ r) ?3 S/ o$ j* A8 @3 a" Z2 e& f
queues in round-robin order. Each machine has a normally
* x$ G' I$ ]; P% w3 mdistributed processing time with a mean of 48 minutes and a standard
9 V  R9 T1 U$ N' C# Y+ c+ Fdeviation of 5 minutes.  b4 g/ q# |4 C
The three machines were purchased at different times and have % b1 C5 C2 d( ^0 ~4 C
different failure rates. The failure and repair times are exponentially
& R  r% [7 y4 q- f, T9 Udistributed with means as shown in the following table: 9 s4 M! b& g' m$ `
Note The solution for this assignment is required to complete
5 Q! S( R9 R! ^! Pexercise 7.1 (see “Exercise 7.1” on page263); be sure to save a copy of . ?3 g, V9 M" q
your model.
7 i( B* n/ a) @* y3 y3 l6 w6 f. ]# {% P: T+ N2 K) ]
MachineMean time to failMean time to repair3 k4 N6 y' j4 Q7 P
A110 minutes      5 minutes" b* W+ c: {! A4 C
B 170 minutes     10 minutes
% Z& p+ _9 C' M  dC230 minutes      10 minutes
# }) d  R; {2 @7 f, f+ @0 n7 g! ~2 V! v9 n  y$ W; ]4 b
The machines also must be cleaned according to the following
) K3 T& C4 Z6 |* J' c/ qschedule. All times are constant: + O/ [. M7 l( D1 S( n. h

3 h9 r$ }( _) D6 _+ XMachineTime between cleanings Time to clean, d* y$ @5 x* Q0 d9 W$ `# q. ^
A90 minutes        5 minutes
# J; R, T  c+ b0 j, lB 90 minutes       5 minutes/ ~3 K7 J$ o9 f; `9 f
C90 minutes        10 minutes
2 ]. ~$ S! L3 o6 B6 i2 S- v- {& W" B* S
Place the graphics for the queues and the resources.
, {! g6 g/ u! O* ~! ^5 FRun the simulation for 100 days.1 c; \" L1 S/ f- C! x
Define all failure and cleaning times using logic (rather than resource
, r4 y* k% l- M- i9 mcycles). Answer the following questions:1 ?$ a. p" z' _( [
a.What was the average number of loads in the waiting queue?
& ~! O9 A" |2 Y! L6 E( nb.What were the current and average number of loads in Space?
7 Q9 D# E1 e2 N' A: YHow do you explain these values?
# V+ h6 k* [% b8 [% q

 楼主| 发表于 2009-12-6 00:53:23 | 显示全部楼层
如果把逻辑改成底下这样,直觉
  S$ U* o" O- V$ |send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)9 o! {/ S$ ^; L2 D
这行好像也不太对,各位先进觉得如何呢?
0 ^) W, y: _8 F4 {
0 j# A$ r& _/ \( ^# y' g$ |: Obegin P_something arriving- C2 r3 K$ O. s: E
   move into Q_wait
6 l4 H6 t* b: V  U   move into nextof(Q_mA,Q_mB,Q_mC) ) v% |6 J9 L+ V
   use nextof(R_mA,R_mB,R_mC) for n 48,5 min+ z7 y3 O/ C4 J+ E
   send to nextof(P_mA_down,P_mB_down,P_mC_down,P_mA_clean,P_mB_clean,P_mC_clean)
" w7 S& _  o4 l+ q8 o: v; E9 eend
( U) r2 u, _( z5 J" X7 ~/ ?
! s% [5 F# j+ {# D2 f$ kbegin P_mA_down arriving# Z( j" I9 C  f: o, ?$ {
   wait for e 110 min
, a; ^( B& H: y0 W2 D1 R$ J, W0 R   take down R_mA
$ X: H8 K0 Q$ v6 E   wait for e 5 min8 D  w" S/ q8 m2 j
   bring up R_mA
0 [1 ^9 D) P/ gend
, g1 h4 a+ L9 Y, N. g
: j: w, s8 l  Q/ Y8 j4 v% t$ v, V: \begin P_mB_down arriving
6 k! }* ]( D9 H# }8 v. [3 r( @   wait for e 170 min- T" Z' {: a7 j8 M) ?# V
   take down R_mB3 N) z2 V- J# H# J
   wait for e 10 min
, P5 P! `6 A$ S% C8 L% F   bring up R_mB
5 V0 o5 z; c$ J, l) E( Jend+ l) W6 h) l  q

( F, s$ z- i0 Y" l7 V1 j9 {begin P_mC_down arriving
. L- ]& q+ ~8 E0 Y- K   wait for e 230 min
' B4 p: Q0 ^7 D   take down R_mC" t' j! z2 z. r& Q+ V
   wait for e 10 min
, a$ H6 o3 h+ R  Z, ^( A' q   bring up R_mC5 |# M4 S* N8 v) ^' J% \
end
9 B' l) B) r- V# Y, Y- l9 A$ q# z! t/ |: O) H
begin P_mA_clean arriving8 j* Q& K2 z5 h* R6 O
   wait for 90 min; Q  U& j8 g# v( P# J  I
   take down R_mA5 E0 K  I, c% T
   wait for 5 min
, N# \7 j. ~$ u" s& R6 L6 k   bring up R_mA/ K& Q. y( L8 j! ~  m* G; Z7 r( y
end
( E5 f6 L. F1 ~, n
5 {! j# V; x3 E9 l, U+ Dbegin P_mB_clean arriving/ |- ~( }. i% g& v  \- o8 h- p
   wait for 90 min: R. B4 L8 z( O( Q* {; z+ [: B; t
   take down R_mB
8 [( y6 }3 Y9 ?/ r9 V   wait for 5 min
) r7 a' J0 L( m6 K% ]   bring up R_mB
( ~8 @/ `- f6 M# O( G; y5 [) send. i% W8 l( j* [) a' w# ^1 e3 C! R8 z

% P* B' D- D7 p' |% c. j. fbegin P_mC_clean arriving" A0 s, p: ]* P2 u/ b" `
   wait for 90 min6 ~3 L/ c% ~7 a2 q
   take down R_mC
% a& u: o# a0 s   wait for 10 min3 ^+ ^) z$ E  L: S' a2 \  W1 |
   bring up R_mC# x, q6 X/ n( H% b2 u
end
发表于 2009-12-9 15:46:38 | 显示全部楼层
begin P_something arriving
" w0 x  P; m3 ~: Z5 K$ X$ y% K   move into Q_wait
+ w" x  r9 X6 ]! w7 o/ O# F   set A_q to nextof(Q_m1,Q_m2,Q_m3)
& G1 _$ T) {! u7 y% o8 \# I   move into A_w
' ?+ F+ B. R: H( [' T- D   if A_w=Q_m1 then use R_m1 for u 48,5 min1 X) ?" s9 ]; [9 |
   else if .....then use ....for u 48,5 min) Y' _' `: _& ~+ i# o0 A9 }& j
   else if .....then use ....for u 48,5 min  
4 Y4 @, v7 R# a% S: N3 f) B   send to die
6 |$ B0 _, {3 ]) Kend
# G& C  ]9 Z. s* S4 Q1 H
8 _4 u4 C+ G) b; C) j供您參考看看~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-11-17 19:43 , Processed in 0.016631 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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