设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11519|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
1 U# Q0 \  {4 @/ o如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
  U- r0 n8 d) c$ Y# |% l谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 . C$ p& Y3 C) h) v9 N3 h4 B
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);( H$ Q9 ?* @. y- K9 K5 ^
begin model initialization function
  q0 V& \1 ?; \! d0 F% i3 x  create 1 load of load type L_null  to P_Creation2
4 D! A! v( y8 Q( {% E  create 1 load of load type L_null   ...

- t" R5 N" G, R; |) z- j
1 [: w  o- \0 a' i% U4 o也许是模型有问题,也许是软件或者系统的某种bug。8 s1 q1 o9 R1 O8 C7 V* O9 v

- a" f; W" Z9 ^尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?% z) R' x% h5 ~5 H6 K1 e8 p) a
下面的代码不知道能否满足你的要求。
  y) N4 o, k; x* J0 [( T% p. C9 a: I, ?+ ~  E! `
begin model initialization function, ?9 c. H% I' H
    create 1 load of L_null to P_creation
/ y. T, ^( C: I& Z) b' i! s/*L_null is a load type of which the load create loads for the model.*/
( c9 G0 G1 l  `& L. W; X* N" x. }( r- E* h3 \7 A9 e
    return true4 j4 o. N# s! |+ n* ~
end
. m$ a2 I7 y% z) ^8 o" k0 u2 z7 G
begin P_creation arriving procedure; H, _8 Y; t0 o& C( m1 j
    while 1 = 1 begin
; S, P4 y6 [; F, W        wait for V_interval sec7 J9 M7 ^5 l- Q
/*V_interval is the interval of creation of loads, fixed or random.*/
  k3 \! H8 T- o, t3 a: J        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)0 C: @: H2 A$ M; K. _/ n( A
/*V_p is the parameter of the distribution.*/
8 t7 |4 p& o. P+ I+ G4 q    end
+ ]  m1 i$ N% k% `! H# Dend5 B) ^( X) n6 T9 S

, G1 c- v' a) C* |( m3 D! w, {3 r3 ]( Mbegin P_process arriving procedure: k% _6 |( z' a6 `0 ]( N7 n# B6 E, x
/*Any process the load will be in.*/: m+ O$ p# e" v' ?0 b1 D
    print "1 load created" to message) E) ]0 C% s; M. F
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答* Q  m" X4 v5 V  `
不过有些地方不太明白。2 @4 a8 j, K8 f" i
(1)L_null 和L_load 是什么关系呢?4 Y9 ~( v% }( `  `, K( I, J
(2)create语句出现了两次,会不会重复呢
: L  |9 N$ `& N+ L( G: \& ^我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
% p) s. d# d4 N谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
: s; i3 U! T& @  o7 f1 k因为我要产生3类load,所以代码是:
. X6 w# O) N- I$ abegin model initialization function+ z1 I# P" U4 Q4 o& `6 f; b: |
create 1 load of load type L_C2 to P_Creation2
/ L8 k* V+ \, o0 t create 1 load of load type L_C3 to P_Creation3$ L5 q. X/ ]6 d4 P8 I
create 1 load of load type L_C4 to P_Creation4( ]6 f( l$ j2 [, S1 d6 e5 H1 H
return true/ |6 B# K# A) z9 _4 R/ N% u. |
end. ?4 y5 u8 f: u0 ]( M
& I# T/ s; |3 d/ ?# t
begin P_Creation2 arriving procedure5 B+ `4 h9 Z& I& e3 M7 h& d1 ~
while 1=1 do% \. ?6 v, W) F! b1 _" `
   begin
& v9 I( ?! U& Y) e2 O# a3 B9 u     wait for 1 sec
' C" _" Q6 ], c     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
' J( B$ ?- t( ~* [   end
3 D6 e6 z3 {! _& G% j$ G end
* |' e$ B, f! G5 g( p ; h: j$ R! f1 q) ]
begin P_Creation3 arriving procedure* g# Q- `4 \/ _) @; p3 @
while 1=1 do' Z6 l. `. N- ?; f  n
   begin
& {4 p! A+ O9 i2 ]     wait for 1 sec
) o& i# Q4 C* a# x4 M# A# O/ \+ d+ j     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)2 F$ L! e( a6 K( ^* w
   end% ]  Y2 @8 {# u! s  r
end   
2 R" u2 _% T2 J7 {. J1 F1 D
% x* s$ T) N8 x) }  F0 Mbegin P_Creation4 arriving procedure7 s# ~2 K. f$ B+ ~8 K
while 1=1 do9 k9 S+ J& o( {2 s' N
   begin& f* o" ~9 h  b0 w, Q8 W# V
     wait for 1 sec% V- i! ?. G' p) }
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)4 m: N# N) t+ {0 |# S$ A
   end
3 T$ a. u- f. Z$ v$ ]- T  T& a( } end
8 h1 j: w" s% q" q! x* F' l) V5 O4 s( m0 U! M, T$ X" \
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
; J, z/ N- R3 F7 e, ]+ V- I现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
+ l) w! P. _4 X5 Q% Mbegin model initialization function6 I- m: h1 b& F2 z- e
  create 1 load of load type L_null  to P_Creation2
" }6 g& {, h" c' k' J9 L8 H  create 1 load of load type L_null  to P_Creation3
6 s. ~" ^8 d7 z  create 1 load of load type L_null  to P_Creation4
& Q" ~+ r* I$ x$ D1 h* i  d5 ?  return true
7 ~6 f8 K0 }! P" tend4 m& ~$ u' ^/ W) K; R! L

* c" H% z4 l) @& M4 Kbegin P_Creation2 arriving procedure) ~" F0 q$ Z( {4 H$ e% O! [0 |2 P
while 1=1 do
& j1 S0 g6 w8 p9 E# {. H% x   begin# C) o& U5 `! Y8 e
     wait for 1 sec
* {( C& @/ c8 W$ r, d' f     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
" f. w& {2 E( M2 U; K! c   end
. O: w' s+ o* _end
$ i- j+ q5 w3 n( J
2 n. @& }6 `9 N0 ubegin P_Creation3 arriving procedure' a9 E5 R, U4 i6 Q$ U$ G2 @
while 1=1 do
2 H! Y/ \( h2 b  o! R6 ?) O$ M   begin$ P- ~/ o  B- E6 h
     wait for 1 sec) ~1 t8 ]# Y: g* ^
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
- u, d1 h$ Z+ y3 s! D/ c0 `   end9 _9 N0 a: `* J( d2 y
end   " {4 M" r& z# B1 Z; H$ i

! [# J2 H& @( D% o- `" Bbegin P_Creation4 arriving procedure
: n% c" y5 k7 }while 1=1 do
2 s  ~2 q! ^3 P* O5 Z4 k   begin
# F. }" ]1 }; F4 F     wait for 1 sec" q7 j: V8 u7 _9 Y
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
' ]! Q4 M; A$ ]  k   end# D1 J( \# O. j4 _, I
end
9 G- F* W; G3 i: H9 _; W% h9 K. S
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。. B$ ^, _- O% i1 W8 U
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。2 i: S; b0 X- t4 w( w- p% }+ l
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
9 w! V& q( T2 j( I& [6 o' }尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。3 x. J* k6 K9 s4 \! X
====================! K3 O7 ^" s( z' L# {7 e
我试过了,终于成功了!!!!!!!!!9 ^5 C- ]6 T5 r, S9 t- i
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
; d8 k) X. ]0 `" I8 P; {6 l# w请版主给两位仿真币!!!!!!!!!!' M( U$ `0 r: M5 M+ l
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-3-8 13:12 , Processed in 0.023068 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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