设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12983|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
' g0 a$ L" ~" Q) _. E6 z$ v: m如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
3 M5 p- i* \: p- {9 C3 e& ?谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 3 x( L  b2 a) `) L; v
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);8 W2 \+ u: Q$ x1 h1 G+ S
begin model initialization function
. p/ B- V( j8 T3 n$ F: E! @  create 1 load of load type L_null  to P_Creation2
8 t0 G: x; k( n1 I% t3 o5 x  create 1 load of load type L_null   ...

) w, N' G2 p9 j8 c" C4 D2 K- y/ B3 G2 E6 X( q, v
也许是模型有问题,也许是软件或者系统的某种bug。' E( g! R6 t, u- o* n3 w
: C3 l) s4 _% F" o7 W
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?3 q% ~7 _  r: L) E) ]
下面的代码不知道能否满足你的要求。
$ W! L5 q. q4 [- C3 z
. A; X% m: n/ d: tbegin model initialization function" D8 Z8 r, S  x: m7 r" t& G! J1 D9 k
    create 1 load of L_null to P_creation
& m4 s. Z2 S1 h" N9 S/ ?4 e/*L_null is a load type of which the load create loads for the model.*/0 X: m9 n% R8 P4 Y% m0 p
9 O% o& q. P6 b" V$ D
    return true
& c, t) @3 G( W& Q3 A$ wend
! {. Z/ A1 r& S! w* u! e8 W; E
; D- X9 z  i$ tbegin P_creation arriving procedure
2 r# E6 Q& j2 @    while 1 = 1 begin
. [9 v* b6 A- u8 H" E8 F! A. e7 i2 [        wait for V_interval sec$ O+ D* c% g- g8 Q' m; D& z$ L; N% N
/*V_interval is the interval of creation of loads, fixed or random.*/! B  i* Q$ g, _0 o6 @, d
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die); o# A  q$ d6 N# q- n2 d
/*V_p is the parameter of the distribution.*/
( m+ w) I8 w; i8 D2 u; ]    end
, r2 e1 B5 [5 V% A1 f& v/ ]  m# zend
! y/ U# a+ o3 k" t4 e8 ]3 N
6 @3 T$ W/ G+ ]$ }+ Nbegin P_process arriving procedure8 l* {( q2 B) q
/*Any process the load will be in.*/$ c  x$ @2 N+ F# a: W  z" ~: f3 H
    print "1 load created" to message% I6 c8 D" ^0 V  G* W( r
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答5 F4 J0 e( I7 G$ P( ~0 P0 B
不过有些地方不太明白。. Y/ t2 O5 \' J( a! _. x$ n
(1)L_null 和L_load 是什么关系呢?, I- w' d1 u8 Y5 \
(2)create语句出现了两次,会不会重复呢2 X" r5 t9 S5 n( R+ S
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
" k9 h& R& x4 L0 F谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。  J6 S4 ?! b0 V8 D# z& m
因为我要产生3类load,所以代码是:
& \% y- n: I- F( ~) w0 kbegin model initialization function" d; E6 E& t- ?* `' Y
create 1 load of load type L_C2 to P_Creation2
2 F* ~8 M" a; w( V; V3 b1 n) v create 1 load of load type L_C3 to P_Creation3: X2 h% s! I( e8 z2 V/ Y
create 1 load of load type L_C4 to P_Creation4, ^& m$ a' h/ h& P
return true) O' y+ M! {* p8 e
end
/ X  M2 f9 g/ s/ l3 ?/ i; \9 C( B/ ~7 `2 q
begin P_Creation2 arriving procedure" v/ F$ J4 f; X9 {  j
while 1=1 do
( K; N9 V4 c/ G  D/ J0 f8 g& s! n0 \   begin
' Y5 p6 i- l5 |6 r6 X  L; S     wait for 1 sec
3 w8 U9 E) P; [) W/ q; t4 H2 x+ K     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
1 `+ @+ E+ }/ F   end
4 T, ?4 i4 B, ^  N8 b' p+ S# ? end! G$ z  B: }# d1 Z' z6 x

3 U( ^' g9 O" u5 Y. C4 r  B begin P_Creation3 arriving procedure
* Q8 Z- r1 l' l4 w while 1=1 do4 V5 v, B# G  V' b6 O$ J
   begin
) O2 W, t; [3 @; I. h" `- W# P9 j     wait for 1 sec" q$ F, K1 N6 Z3 @- I& \  W
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
9 E' {% a# `7 p6 J% `   end5 i+ d! f; h+ Y: E% ]9 J
end   
! T5 _/ A8 ]! ~' M) a
* b2 H( K9 j; j  w7 G9 ebegin P_Creation4 arriving procedure. k2 B2 G/ o1 v  G
while 1=1 do4 K! I3 b) n( n
   begin
& G) o7 h9 O- `5 }2 P: z     wait for 1 sec% V8 ~, S+ _( C( i* f; U
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
3 ^( K  R4 f2 j4 A) H1 T) T2 L   end5 `# ^5 }& d  y9 h# O
end
* K4 j) p9 R! P9 i
1 I7 b, r3 l$ T. e可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
# |1 F8 y+ [2 b" T现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
; @7 r2 M, e: _: [  b) _begin model initialization function
1 [' [$ v$ I" f1 l* m+ i  create 1 load of load type L_null  to P_Creation2
" t" k1 {* [% `' ~, w$ o( M# T  create 1 load of load type L_null  to P_Creation30 c- q1 s9 x0 S! \8 S- P, q
  create 1 load of load type L_null  to P_Creation49 H( ]" a% ?! Y3 f
  return true + k7 V5 D; }9 a4 ]9 I8 ^
end% H1 n4 F* w3 a' W
5 {3 K) M, w6 g( e; c, i
begin P_Creation2 arriving procedure
5 U! g0 q9 B( P$ x$ q7 D) ewhile 1=1 do& ^: j" |6 |% d2 n' n3 ]8 b1 L/ x
   begin
: s& B) ^8 Z. L# b, I     wait for 1 sec* V. `, r. F. g% _) J+ p, a6 n0 u
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)1 W4 l& w  u8 O" z% V8 P( {
   end; {, [% C9 x3 j/ a$ _5 ?' ]
end: |* c$ }# @9 \6 `4 F$ {

1 \  s8 e: p0 X( i. x& \: Ebegin P_Creation3 arriving procedure  W4 W8 ]. S  Q# \! K* n0 ]
while 1=1 do4 z, }$ n4 T2 e1 s
   begin# ?+ u% R! W, k
     wait for 1 sec
- `# m1 r3 T) h7 R     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
6 O7 \' o8 [6 B6 r   end: I  _8 d3 E& _" d* o9 `1 d
end   
  N' X- A3 i2 A, j7 r. [4 Q# r4 x' s
begin P_Creation4 arriving procedure
; C- X) U9 v6 ?9 K( E+ e# |' i& p8 mwhile 1=1 do
/ t0 q8 b5 r8 V" }8 K   begin& H4 U% s) ?; b# J2 Z. T
     wait for 1 sec
8 z4 W8 g2 v$ M8 J7 i* A. x- T, f     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
- E( s+ K# d; x   end+ z5 S7 w. ?4 W3 i5 U! g% B5 S
end0 L: {4 i. x! Q: U  D/ {
' A- W7 L3 b# _7 e$ X7 k
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
1 q" H) g: z; |& \( T, d. J如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
) u  Z  m, y! u. r另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
. ~- D* p" i. X! @尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
- I: X8 z* S8 `====================
+ R' t) `' q/ o我试过了,终于成功了!!!!!!!!!
& l9 P4 U* I0 g/ d* p这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!" F" G  e; l1 z5 A
请版主给两位仿真币!!!!!!!!!!
: V8 b: m9 O2 P& E4 M5 E/ N# P再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-23 12:16 , Processed in 0.018120 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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