设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11459|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
; F2 H+ I9 `" K7 G. `; d如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
; x" J5 L* y! ^: H8 u6 ?谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
. g! E9 F) q! C  `" }$ V% I! e谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);- m" [: @8 i9 l0 ^
begin model initialization function& W2 n* i0 R* B1 X5 [. M9 H
  create 1 load of load type L_null  to P_Creation2
) d4 S$ y: Q6 O. O8 @# G, d  create 1 load of load type L_null   ...
* l$ ^) @, b( q3 x& W/ K
( \8 T, c- r! M2 a6 u8 }
也许是模型有问题,也许是软件或者系统的某种bug。
% t. I7 `; E- w5 N. l6 z) G8 A2 Z! i) y6 d: F/ v$ n/ G! J
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
, B% D/ e8 _8 g. g下面的代码不知道能否满足你的要求。$ T- Z+ r) m: z

$ I7 G2 T% Q( u: vbegin model initialization function5 E& ?! [6 T9 n/ y2 N
    create 1 load of L_null to P_creation
+ j. Z# _7 N4 E" F6 ^; R/*L_null is a load type of which the load create loads for the model.*/9 g; C  V! ~8 {7 }

& u# u/ r3 t" E7 d    return true
' Y' _4 I6 ^, lend# a! A, V& g) j- d2 {
# }! Y+ s5 t, O0 T! o9 o- U
begin P_creation arriving procedure
+ C. U- N5 ^+ N0 `- c    while 1 = 1 begin
# L0 X: F  B9 z6 F        wait for V_interval sec
9 w! K2 J0 K& r8 t) o" E/*V_interval is the interval of creation of loads, fixed or random.*/7 w1 A/ g& U2 C: T$ A; }
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
, X; t% }) i9 E. V" h& W* R/*V_p is the parameter of the distribution.*/+ w. V) x( F8 P  X" q3 K
    end
4 a' ]1 y3 }. @6 e4 `end2 D- y& D+ z8 e9 v
: `0 B  m* ]# b) u+ C2 Z
begin P_process arriving procedure; s7 r1 g5 C0 @- y5 G* f
/*Any process the load will be in.*/
) p( a6 N8 g0 t+ X    print "1 load created" to message/ |" `1 Q9 M" A% t
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答9 {5 W& S# x8 ^9 F# k7 Y$ u
不过有些地方不太明白。
& i$ n8 y1 b+ c6 X+ _(1)L_null 和L_load 是什么关系呢?
& s6 M. R+ T  R) e: T(2)create语句出现了两次,会不会重复呢- g4 M8 g1 m$ Z# e0 L2 c* S& Z9 @
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。8 h- B  p. c# Z* S% Q# p: q
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。- ?# h; O5 q1 F8 R% N
因为我要产生3类load,所以代码是:
5 g8 o$ ]7 w/ [* x3 Fbegin model initialization function
8 Y! t' f2 Z* `# _/ N. \$ } create 1 load of load type L_C2 to P_Creation29 B- C+ P8 P/ f8 ]+ w
create 1 load of load type L_C3 to P_Creation3& l1 e6 ~. r' o3 x7 F; a8 ]
create 1 load of load type L_C4 to P_Creation48 l, c6 [2 d) H8 ^8 X* M- t
return true( ?* n8 q: s& ?2 j- z3 B5 n
end9 T3 T3 n, K8 Z: q5 E

' v' b7 }9 C! wbegin P_Creation2 arriving procedure; j/ k! R6 ~: M
while 1=1 do  C& |9 G- ]% c0 n
   begin9 v: ^* _" ]" P' R( V1 d. `* q
     wait for 1 sec
' F7 C% g$ {+ w; v  |: [6 B3 N     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)  \4 u2 d2 s: h+ b
   end1 D+ t' y6 I/ t4 Y: x
end$ S# B! G5 \; s0 c  R: F1 k
! u7 \( T* u% P+ J
begin P_Creation3 arriving procedure7 ~4 s0 v$ j1 A( ^! W. N- K, V+ i
while 1=1 do
, \% q9 S: U! D4 n+ G: T% t# r   begin5 ^) n) m- P( j- {4 c( A
     wait for 1 sec
. H# c9 F3 w  d     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
1 \) a$ G+ s" r6 |   end
2 d  D, G8 b' [2 U& \9 x2 m% [; R0 y end   ( r& n- M5 p( e
1 U* ?1 g$ p: D
begin P_Creation4 arriving procedure. }: K! k6 G' j( u8 T$ c0 d. V* _
while 1=1 do
' C. n2 f: |3 L& W3 j   begin0 M* u7 @# R; T  W- ]% _# J' M6 M
     wait for 1 sec
* M3 y( |% r$ C0 R     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
3 B6 U4 D! p6 P   end
/ G9 U& l  n/ k: Y7 W; c/ {+ l end
9 ]+ S$ H4 O  P
/ f) p8 p: U, z/ n可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?- M- ]0 v+ N9 E0 U- N
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);5 N7 K9 E) f3 U. H! ~% I+ s
begin model initialization function$ U: p: g* z* }( L, V
  create 1 load of load type L_null  to P_Creation20 s( c; a3 W. s4 c: T, w0 V* K/ P( ^" e
  create 1 load of load type L_null  to P_Creation3
% L$ i+ t' g! Q" }: ~  create 1 load of load type L_null  to P_Creation4
4 _9 B2 ^( }0 G: H1 J1 ^  O9 I  s  return true 8 j7 q, _+ D+ m6 |* O4 T- V( A" v, J
end
# r* C, Z  p# j3 v' r  j: ^
+ V! }4 P6 \1 {: Gbegin P_Creation2 arriving procedure
0 ?0 H5 S6 P' `" N+ y) @while 1=1 do
# m* b6 d7 A; P3 G: m   begin
/ M- v9 B! @+ i4 U, H4 D     wait for 1 sec
# [6 W1 O  W1 ?$ E) f7 H     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)' `% U9 v6 h4 k$ Y! K" }
   end) n2 I( b( N$ l! i8 v3 w" T0 x
end
2 E& _) B0 a# [6 _7 Y( B. }; ^/ R& i' |# a3 f6 w% G
begin P_Creation3 arriving procedure
, a% K" Q8 m1 [/ _1 A9 U0 jwhile 1=1 do
% i) e- V, a% k* U% a5 ?5 F: E   begin
9 @& {$ ^( ^+ D- D- Q: d. [: z     wait for 1 sec
' }- Q0 s5 c5 f" a+ ]. j' ]     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
! X& ]% V/ y* l( R# W+ |   end; T- d/ j* K; R
end   
3 h2 U% ]" G! o% C
# j4 V. l5 @& c/ D- z: E! A4 |5 Rbegin P_Creation4 arriving procedure
5 T# |6 {! v9 M4 V8 Y! zwhile 1=1 do
8 d3 O* B% W1 b   begin2 D( w# P, N( R) ~' n
     wait for 1 sec
' |- y2 z/ [( X+ ~     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
9 p. T! m. K8 t: ]$ |2 P; F# P( I   end3 r/ r2 X) S* m
end% J# W2 k+ ?, \3 {; ~6 Y

# S0 B6 h, M; _但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。/ J* w- K3 A6 g- t, t  }& x* Z
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
/ n( I9 a& @0 C另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
' b. ~) u( J1 H& ?尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。7 W# D/ {- U! F" U9 s. A. s
====================
6 [! t! U+ k0 R: _3 \% k7 n6 W我试过了,终于成功了!!!!!!!!!0 `" I+ Q" w& [* r2 n6 f# M* F
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
) c7 J' ^+ c; B; e  h, N* N请版主给两位仿真币!!!!!!!!!!- O0 @, B; V2 d* r8 \: @
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-3-2 20:02 , Processed in 0.018334 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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