设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13008|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:. M- @( u$ t' a, t3 A( x* d' ]
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
1 P. p3 u4 `; ^. }+ F谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 6 n. T: Z, W9 b. v5 \( j
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
; \' C5 \8 j* q3 ?9 B4 l; }begin model initialization function# b' z& r! c/ Q% e* l& m* l  g$ C
  create 1 load of load type L_null  to P_Creation25 ~* n6 n. R& D) ~8 k3 U) Y% ]: m" M  N. M
  create 1 load of load type L_null   ...

3 k' L5 p: k" B: J1 u, ~1 m& I, W8 e0 D* {
也许是模型有问题,也许是软件或者系统的某种bug。! J3 X0 D5 N! R" r2 s' N

% S, V' r5 Z2 ]尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
2 a0 t9 Z8 {8 v, }: v# _# z下面的代码不知道能否满足你的要求。& c) |/ O2 J$ `$ M- y& u, h

, v2 [6 ^1 Q, ibegin model initialization function7 z, y/ b- [$ i* ^0 L  }
    create 1 load of L_null to P_creation+ s$ q; h, S0 v, i
/*L_null is a load type of which the load create loads for the model.*/
$ {6 i5 `3 E& s* i1 M6 ?# `) k* u% M7 y3 I
    return true
" v* l8 W$ K% m; dend+ X' [9 w3 f  C" q

6 m$ O" C$ A# \1 U( r* }+ v/ Fbegin P_creation arriving procedure
  ~0 y' e# A1 `, E    while 1 = 1 begin
1 A* O, k# A3 p% s! M& ~, z        wait for V_interval sec
2 _, W( c' p6 z6 d% P( C1 g+ j/*V_interval is the interval of creation of loads, fixed or random.*/; s5 p& f; J( u0 ^0 H, J' L* n
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
/ k/ J( S0 r/ A) J/ x/*V_p is the parameter of the distribution.*/: K7 q$ |. l7 E$ k0 p) z) ~( x# [
    end
8 q4 f$ r/ b" f$ b$ H% |' D7 r7 mend
. a; A/ y; }% }9 ]$ G$ X* g6 ^: e3 I5 p1 }. I
begin P_process arriving procedure
) G9 s4 n( t0 w3 s" W+ n/*Any process the load will be in.*/8 U4 v4 M6 L& l  ]/ l* e, h$ @
    print "1 load created" to message
0 m4 O  @9 s/ e& G  \end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答2 g3 y* c' I( J  Z0 Q5 A5 F
不过有些地方不太明白。8 p0 i+ _: m( A
(1)L_null 和L_load 是什么关系呢?
1 k) q; \9 s3 }6 y, z+ K(2)create语句出现了两次,会不会重复呢
. S6 A% {9 Z# }( m+ g5 T我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
% K6 c9 ]# J9 [$ J2 j: b- l谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。1 W0 \2 j% l+ w1 m" X9 d# j
因为我要产生3类load,所以代码是:
/ q1 G/ Q  k6 @5 a" }# z8 ^" k4 {9 r; cbegin model initialization function
3 V. C% q6 k( ~, k, K create 1 load of load type L_C2 to P_Creation21 A; G& ]- g$ q
create 1 load of load type L_C3 to P_Creation3& w( d3 t" k  l" e
create 1 load of load type L_C4 to P_Creation4
# v$ p: ~5 t" v4 M* R5 b return true+ Q) }9 f# F  L  @9 \% U
end
6 y" X* ^* z2 T9 F
0 F! Y0 r( k& hbegin P_Creation2 arriving procedure) X, n. b( Y; W9 v# F4 q
while 1=1 do; m; \4 z0 p/ f& r
   begin2 V7 v% O; W) v" q
     wait for 1 sec/ \/ h5 d! v5 @' m4 A) q% a  z
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
! L% }, j2 S, T$ C. |2 o3 i   end( t3 v& \: u( k$ ?6 k( d- r
end
  P& ]0 B7 d' ?, g) m! E( ]   \- R7 K. H2 {+ i
begin P_Creation3 arriving procedure
9 `0 A% I/ L0 i7 E6 l  @ while 1=1 do4 O5 i/ D( J( N$ q
   begin# J2 Z7 n  J3 ]& T$ d  X; }
     wait for 1 sec
* v, }! w3 I/ I$ r     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
# ?+ o0 N6 T' X8 \, x5 v   end" N5 H4 `( c# Q* O' V0 k  @+ J" Q
end   # D( x5 }$ @4 d+ e5 K4 F

) M# w( Q/ k, l% Mbegin P_Creation4 arriving procedure
% W$ u0 N) c5 ?  z- H while 1=1 do
1 x0 Q7 W9 c# f$ V2 ?8 ?   begin
0 k4 G. e4 H/ B" l0 c- k- ^  _     wait for 1 sec
) e# B5 B& p3 N8 {; d# f/ a* ?* b9 `     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
0 g: {; X8 l. r" V  p2 C9 S( i   end- \* i( O6 t7 B9 b9 k
end
# h9 q9 V  P4 c# R2 L& W1 p6 p; e
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
- R4 w, u4 B3 T  {9 W现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
  e2 p8 ~) F3 Y, T* W8 i  bbegin model initialization function
) t$ O4 _: @3 z  create 1 load of load type L_null  to P_Creation2
8 @, ?1 }7 x3 W  e  create 1 load of load type L_null  to P_Creation3$ O7 c( Q! Y( j' m: L! p' P! D3 `
  create 1 load of load type L_null  to P_Creation4
+ O9 y4 g7 z' r4 g6 I% q# |  return true * ]: h! q: r# q7 H1 g
end% W4 f- X/ P  V- I3 z
+ \5 {9 a/ ~1 N
begin P_Creation2 arriving procedure7 N4 v& g, a! L) {# Q
while 1=1 do
  n# t4 r  N1 U  I/ Y   begin
# [" p9 N; W; [  y/ n7 O* K     wait for 1 sec) o+ z4 O9 ~+ Z- a; Y8 p) U
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
# q! I4 V$ D/ U! w   end
5 n6 Q$ ^* f8 N7 oend
1 G" R  o7 J* f% p/ w3 a) c3 J) e, U6 A+ K$ Q+ d5 U9 K
begin P_Creation3 arriving procedure
( }2 J/ c( f3 O% Y- T; Nwhile 1=1 do. }6 Q; n- m, }
   begin
/ }- T& S& O7 z" a; n     wait for 1 sec0 h2 M8 C9 [' t5 r. G, j
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)! v( @7 T0 A" ~! A3 ]
   end
4 F( N) U; ]* |* H+ vend   
! O; ^- U# \6 q  S# A& s7 {
( R2 X4 {6 v1 y: g; e: H. nbegin P_Creation4 arriving procedure
4 q5 I; K: y8 L* G! uwhile 1=1 do- }7 w+ i3 h& Q0 `# x$ W9 o4 S+ E/ d
   begin
4 d; n- ]' s2 \0 R5 E6 M/ g     wait for 1 sec
2 B- ]& H" T0 @2 t' b! z     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)- r! d/ b5 D9 R' X
   end
0 O! }+ l4 p+ o0 p4 jend8 M( f- Y1 L0 b  ^5 v! f8 d
/ k" ~+ y4 k$ q8 n1 [
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。( C- `  e9 g5 O9 s3 {
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。( g* m- E$ h+ A) @
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
' S8 L; A, f, e& _) O尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。* G; o1 @, F% U. O1 {
====================
4 P9 ?6 a) w: B! }. u1 c我试过了,终于成功了!!!!!!!!!3 U/ k" g/ K7 ^5 A5 X
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
& `" E8 M/ N; J0 A3 }' {请版主给两位仿真币!!!!!!!!!!" D9 U8 L$ J9 g- c# I8 g( Z. F
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-25 12:38 , Processed in 0.019095 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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