设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12778|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
; I% v. Y; ~0 M' b7 R. c如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
3 Z! l. ^# h6 Q% F; E+ ^  {谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 1 Y- u0 m% s2 i. m/ W+ R+ w
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
( Q( _1 h4 o; s: t/ g7 x3 J  Tbegin model initialization function
$ a2 d4 i7 w6 \  {' N! Z  create 1 load of load type L_null  to P_Creation24 M' p4 {4 a# j( P0 u9 e
  create 1 load of load type L_null   ...
' }" Z7 Y& x& z- ^& @
! A6 T6 ?( b; z: I4 O6 U
也许是模型有问题,也许是软件或者系统的某种bug。" O  G: T$ T+ A6 G! y
  u9 z& M, y9 |3 g; P
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?8 W) w, v. [) |. N
下面的代码不知道能否满足你的要求。" k# m1 W" K  D8 `; I

6 S  i( A% l2 l( J& fbegin model initialization function5 I- T6 O5 ~8 [
    create 1 load of L_null to P_creation
8 b8 l2 Y7 u' n! I/*L_null is a load type of which the load create loads for the model.*/" h! s* E6 q7 ]0 w1 W' A1 Y

* q  \7 w) f9 _5 K% i    return true, X4 C2 n) A/ O# @# T
end
% ?( N  ^" I, f
7 h( Y3 G0 z2 p/ Bbegin P_creation arriving procedure6 J. |3 i$ Z4 }* ], V9 T; R! R+ `
    while 1 = 1 begin
+ q1 j5 Q* Z3 \* W        wait for V_interval sec' s0 a" M) b6 Z; a
/*V_interval is the interval of creation of loads, fixed or random.*/
( @3 Z$ t9 c% R8 |9 L0 O) d* i        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
! V1 _2 t1 g  u# g/*V_p is the parameter of the distribution.*/
; f9 z; E# y, h( b8 k" Z1 W    end
/ C& P- R! Q) I! hend* h1 \4 O8 S! Q/ P6 Y) F: l

6 A; M8 y0 @" |+ ~begin P_process arriving procedure
1 o& }/ I! b1 e4 `' Z0 n/*Any process the load will be in.*/
( S' ^  j9 O( y8 P& W) C    print "1 load created" to message8 u: V" @; M. \9 @) |6 z: _
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答: |! |' h- v: W7 |+ {+ H, Z5 ~2 _
不过有些地方不太明白。( E1 M% a: g+ x; w8 e- m) M2 F/ C/ x
(1)L_null 和L_load 是什么关系呢?
) t5 E* s' T2 C3 l/ H' ?! j8 _(2)create语句出现了两次,会不会重复呢
5 z7 p! H! m% g( N% k, g我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。% f4 j+ `. J; m, N# T5 y
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。. K! m1 `- L) I/ ]
因为我要产生3类load,所以代码是:' l" G3 y2 M5 G% N& K" I" z$ [
begin model initialization function% u0 \# d& L% r) l7 \' v9 `3 o
create 1 load of load type L_C2 to P_Creation21 S5 G  o5 e' C" G7 K) ?% P% v: F
create 1 load of load type L_C3 to P_Creation3
8 }5 d  a4 c$ _ create 1 load of load type L_C4 to P_Creation48 P8 D: g2 S3 d8 N" A
return true
8 `" i( K- k. c4 ~3 E1 O- Uend
0 K7 k( c8 F+ W+ }6 t  |( D# Y1 a" P) n5 D
begin P_Creation2 arriving procedure# b* t1 ]% N" U& f) T
while 1=1 do3 R. Z' n$ R9 ]
   begin4 J$ [( P* X5 n% n( B+ }% s& I3 v
     wait for 1 sec) Q% t  D: O6 U) C% y+ V# D
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
% v0 \& [0 y, g+ X- I   end. J0 Q; |; G- D8 U( j9 ~6 C# M. n$ r
end; t% x0 v$ D; s/ ~# M& G7 z  Z2 t
1 [1 S$ y$ O" i; I  F! F1 W
begin P_Creation3 arriving procedure
3 {! K) a" }2 e' M3 l, ^ while 1=1 do6 `' X/ t: |7 z( U$ Y/ [
   begin7 m' p" Y8 z8 \: G4 `
     wait for 1 sec* f6 q$ f  h4 w4 f/ T  [
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)8 }7 X6 Q8 |; v: u. b( a4 a' z
   end* p8 R2 h# ], }  M$ _
end   5 _6 @" Y: j; w" _* Q
  g- C9 W$ r1 r. }+ P9 U( [
begin P_Creation4 arriving procedure
6 ~  ?7 T2 a3 z. \! T while 1=1 do
6 z7 T1 ^' o3 W: X   begin
% h0 w- ^# K* N) d+ u, i     wait for 1 sec
8 D/ L2 y! y9 ]& o6 L' t+ O) }2 W     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)8 B; {' r+ Y+ @- }, K
   end
' [- a( n6 c0 q& N8 U end* O/ f, o) {! Y  ^( B5 U4 H, o

7 b+ K) d" U, |' n/ b- f/ B可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
$ @9 R0 @9 u+ v% P" q现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
0 @! s5 l! s! }: Vbegin model initialization function) |+ M2 s) D: p4 K4 a
  create 1 load of load type L_null  to P_Creation2/ o! W3 D& q  V* P
  create 1 load of load type L_null  to P_Creation3
6 }2 A% C, F, x2 A' u" i  create 1 load of load type L_null  to P_Creation44 i" M! n. ^0 K% A9 C
  return true
, \+ @8 z1 X* \) a$ Y! `8 Lend
( Z/ o1 U$ F- O* Y# q! ~8 q$ t( A8 N, Z
begin P_Creation2 arriving procedure9 |5 ?/ G: ~& ?9 z" B! `
while 1=1 do
! n# f* N% U9 u" q   begin
2 F5 F* u: g! r3 I2 [     wait for 1 sec9 H) L$ T/ X/ P( ~' r
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
) _. t# e- X; i8 T- y) G9 P+ \   end1 S. J. @/ E) G! O4 [$ e7 O
end
9 k4 W( i4 L5 c' v: x, W" b
: \+ p! _" U0 g" B) |& x) I! M. A" ^% jbegin P_Creation3 arriving procedure  {/ b* s/ x8 v0 E: Z4 n
while 1=1 do
  M3 o- w# A5 a: V$ O9 z   begin/ ]. ~% i+ l# A; @
     wait for 1 sec
6 W3 F5 a; Y9 S% `2 E& F9 }     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)8 S" s! L( o4 n, C
   end5 F  a5 [, c( _& f- u/ w
end   : ~/ m: Z, {, x  o2 W0 a

6 o& R1 {& E# D( ?* w4 b! M' Jbegin P_Creation4 arriving procedure& I' t  v+ ~+ O% B9 n
while 1=1 do
3 r& d2 x5 u3 N8 D" A2 l3 |   begin4 A/ {% S$ J: i8 k2 u" e
     wait for 1 sec5 K3 y" ^. |  {* r. L; N
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
% n, ~8 M# \) y0 P3 a( i+ R   end
7 E& W2 ]% H) L+ p. D7 m7 @end
% a& b' R2 e# }: h; L  E+ I  o. L0 d  a1 \7 x
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
0 ?" u' }- @; C: @) w1 R# j  X如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。! ^8 {% P; ]$ p) i# H5 {/ f
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
8 _6 J& c# c. ]; P9 j' T: b; G尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
. N. L. W6 J0 N% ~, f, n) l====================/ z9 C2 G4 b% j" I
我试过了,终于成功了!!!!!!!!!
5 X+ H: }- v( a% K) r, N$ t这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!! M, `6 Z6 x2 J  Z$ N" p8 o
请版主给两位仿真币!!!!!!!!!!
! R8 Q5 x( |) g3 O& K' A" e再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-7 02:46 , Processed in 0.019320 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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