设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13693|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:4 L0 c% D; ?/ [" b
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?! T, L. k' I8 a4 r2 \! y/ C
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
$ u8 T; v' a  ?! m# W+ D0 G) x谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);  c5 R  d$ E7 l( w' K. M" v
begin model initialization function$ m0 z8 u: j* P# z7 ^
  create 1 load of load type L_null  to P_Creation22 P/ B& m  N7 y$ S
  create 1 load of load type L_null   ...

1 J  i# z5 t' `/ C( R' [/ h% \4 M# _8 e. G. I5 Q4 e: J
也许是模型有问题,也许是软件或者系统的某种bug。
1 t% l) F: d- X% L, o8 z& i
' e) L% u5 m* S) m& k: O2 `8 ?尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?  }1 |" |! i/ M4 H* L" \
下面的代码不知道能否满足你的要求。
& u* k- t$ W9 |" {+ N# M( b
3 L% o; W% }8 `8 Wbegin model initialization function
1 d  H$ \) x4 j* f# o1 ], T    create 1 load of L_null to P_creation3 i# ~( H4 ?, ^: S/ P
/*L_null is a load type of which the load create loads for the model.*/  @& T- i/ A  G
1 v9 T0 T2 Z4 h% [7 I* f! q0 {0 a
    return true  r& y( |$ ^  G/ P- i
end
$ Q9 q* L. \( P6 ?6 M" ^" w2 q$ x5 H# Z9 m
begin P_creation arriving procedure6 |4 v! P$ N5 o# ]/ w* i/ [
    while 1 = 1 begin3 c& g) \5 C. G* s6 f9 k8 G$ i
        wait for V_interval sec
4 s, W( U" _& q8 z/*V_interval is the interval of creation of loads, fixed or random.*/5 f1 `  \7 }! ~4 K7 T
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
7 \7 A4 z% c8 y( e; F/*V_p is the parameter of the distribution.*/
+ I5 v3 a1 c% ?! j3 W7 y    end
) N3 @" z! z- I, _end
8 N* {+ u1 L' }6 l" W
5 j% ~  Y" D4 T3 y. bbegin P_process arriving procedure
. ]/ U' b; l, M- Q, k/*Any process the load will be in.*/* s! Y, I/ d9 d9 B) B1 _
    print "1 load created" to message" O5 c" k8 h( Y' Y" d' h- n( D
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答( ^# i) }0 C! z2 ~0 l& [( e& s4 M
不过有些地方不太明白。2 S/ q# r2 D- B% o% y
(1)L_null 和L_load 是什么关系呢?) _( J1 B% ~' D" V6 P/ R
(2)create语句出现了两次,会不会重复呢2 ~- R2 v7 i4 t4 t6 c& v
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。: L% F" y" n& v: u# P( F6 j
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。% q$ P1 Q. t8 m, ~% K
因为我要产生3类load,所以代码是:
3 M* }3 t5 g" u9 m& Y$ }. [& A% B5 bbegin model initialization function# b. ?- N) W6 n' }$ ^
create 1 load of load type L_C2 to P_Creation2
' K6 N$ i' E" e+ w! I create 1 load of load type L_C3 to P_Creation3
) D; A; n: m8 U( B! @! e create 1 load of load type L_C4 to P_Creation4+ {( o& i# c% ^! J! _
return true
' G' v" E' y9 J. U& f% k0 w2 }end3 L, a6 v6 g6 X# G4 ~) X

6 D" Y1 @/ L$ b  R. D- m: wbegin P_Creation2 arriving procedure
; E, @0 G& [: O while 1=1 do
7 G' K2 O" C- M/ ~) F   begin
: u  F; k, y. Y4 p! W3 [& o     wait for 1 sec
3 W+ \) X; E& v. a$ ]3 \4 z! [     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)) G* O1 ^2 r7 z- r# [
   end
4 {& W! D7 A" F6 V9 |6 \; @ end
* ~3 ^8 ^+ |; i( v& }7 F1 k
& F# T5 r$ ~, Q2 w: X begin P_Creation3 arriving procedure. `) m4 o$ r4 l% @( J
while 1=1 do7 p6 z. H- u8 V, {$ k% z; q7 S
   begin5 A. K# S4 ?* @8 M5 R( Q
     wait for 1 sec! r" B' h6 D$ O, U
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
8 B& P6 H  F( x/ K   end( @# ~) c* ~% z. o4 C
end   ) I/ H3 }/ }! V9 D) y* l

$ m6 F2 G5 g: Y& I1 R; w& B3 a& kbegin P_Creation4 arriving procedure2 ^$ J' U* b! ?2 [- {& v  O. z
while 1=1 do6 V5 O- {. `, C1 o7 A: I
   begin. O% j2 _; i# Q
     wait for 1 sec
0 R: G) f& o( H     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)" q- ~- b( l: ~, M
   end. D$ O1 }: A" l  D
end
. y+ Y- u% u, Q/ Y3 w5 e  q# Q: q. J* @/ N1 K
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?! Y/ \& \7 e4 @' F5 [
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
0 q: h$ F6 g5 m3 L( N* J6 ~begin model initialization function! a5 B- l$ J3 Z; ?
  create 1 load of load type L_null  to P_Creation2
: \- }' e' \; k1 H  create 1 load of load type L_null  to P_Creation3! C+ d7 L2 m8 {9 \
  create 1 load of load type L_null  to P_Creation4+ N5 p% R8 V8 }
  return true
2 ^% i6 W( s$ G/ \end' }# s) I8 c+ ~8 j# _. W

/ q7 s2 w+ Y( f8 [begin P_Creation2 arriving procedure
. q- w1 R) ?( u; @. vwhile 1=1 do: I+ M. \% v# _4 Y
   begin
1 `% k; o& O" V     wait for 1 sec, I& w) ?; u8 I1 [! D) C: d% Q
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
+ Y0 r) T' Y* ]. d; y. v( B   end
* w2 g) [5 R, W" Q, jend0 R+ P  N; N5 g* J+ ~
& f4 E6 h1 F* ~
begin P_Creation3 arriving procedure+ V: X" ^# I. b/ a
while 1=1 do6 w4 [  @) a' [& ?1 ^, j
   begin. Q6 i/ Q: r% [* f
     wait for 1 sec* b8 c! G9 U, U( c/ `8 Z
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
2 O! M2 y) J) X1 [- g   end
4 S2 m/ U1 ~1 |end   
6 F% b: ?" E$ Q$ E; A( H6 ]5 A2 M& @/ D& s' `$ l# E* y6 ~
begin P_Creation4 arriving procedure7 U6 {$ k9 {+ n7 G0 I
while 1=1 do4 A+ r2 z9 }2 Y1 T; X& @7 [# @
   begin
1 x) `2 O( N. {2 z4 `# ~     wait for 1 sec
) S' o! O5 N8 c8 R) l3 J  C     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
/ R8 k7 q# P' j- R8 p$ s$ B& O   end+ E: M  f! k, \$ r( e& h& W( F
end
' ^; w* D0 G( x1 U9 c; a. z2 Q1 @: Z
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
( e- }! T7 x8 ]9 t6 T如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。" d# G7 Q  x8 U' _4 n5 T
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。( f; r% [$ Z0 u$ w, U" H! m0 G
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
4 L4 ~8 d5 C* w2 f2 s, E9 e====================
' s) f7 _* U6 a7 P6 }8 h我试过了,终于成功了!!!!!!!!!: z" S' R) R- u( j
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
' W- z# ]( }# _2 a3 B请版主给两位仿真币!!!!!!!!!!5 z& X  w& J( }8 S  [
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-29 10:53 , Processed in 0.019171 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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