设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10927|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
! ?7 @' ~( S! Y% `% G' Q/ f如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?/ H/ e: g: \9 e8 u( b( ]
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 : m" a: ?9 I4 b- o- l  z
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);' f+ F/ w5 p; G% X
begin model initialization function1 p3 Q0 I$ L6 B, g1 m( i
  create 1 load of load type L_null  to P_Creation22 O* ~% ]  S* C8 p/ i5 a. G
  create 1 load of load type L_null   ...

6 |' W0 U% M9 }4 @2 e1 }+ P: E# G4 |& w& s& ]! N0 J3 J3 t
也许是模型有问题,也许是软件或者系统的某种bug。/ `% ?) U: ^; p) o! p

3 J9 m) L' B! f: V尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
4 v* s. s% a& E0 R2 t下面的代码不知道能否满足你的要求。6 h- G4 j6 I6 @  m: ]
  X' g7 [2 [3 f1 Y% f' t
begin model initialization function; t0 @2 _# i) m7 n
    create 1 load of L_null to P_creation3 y/ [" w1 b/ ~6 _: W3 {4 z
/*L_null is a load type of which the load create loads for the model.*/
: F  w7 V' P* S5 }$ r8 e" G# r3 Q, w& m8 l6 h4 W6 t6 d
    return true
$ J5 r4 H! X( C. ?2 t+ Qend
: D. Q* r% X' f- r' m/ u- H
4 v7 H6 \: s( T) r) zbegin P_creation arriving procedure& L9 u0 _$ N: M7 ?, U# h; ]
    while 1 = 1 begin4 |0 C# Q1 g& |4 {. D
        wait for V_interval sec: K. j! b# y) }; P
/*V_interval is the interval of creation of loads, fixed or random.*/
/ f; C0 \: l7 l3 B% C' y0 P. X        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
  s# y: n' i" q& _0 g* g/*V_p is the parameter of the distribution.*/  W" L! d' T9 T
    end
: c# z; ^9 |2 r0 h: u: c) n1 [4 s5 iend- j9 R* V4 ?: J  Z, M
! \* S/ W# ~4 ~6 s% s) x
begin P_process arriving procedure4 K7 I6 ]2 y/ W. F; b2 R4 D' D( {0 ?0 a* v
/*Any process the load will be in.*/
) f0 I# Q* @5 w; ^    print "1 load created" to message) i6 K" R- M% f9 x! U2 g
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答8 b3 E: ?/ z1 D
不过有些地方不太明白。: e+ y9 W: B7 `- s5 i  U$ N) B3 ]
(1)L_null 和L_load 是什么关系呢?( k+ m0 R9 Y; m, V( [. c
(2)create语句出现了两次,会不会重复呢1 z% P2 E9 y- Z( V
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。5 ^! k4 C+ @$ m2 U! O
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。' y. h& C1 T5 Q* ^% g
因为我要产生3类load,所以代码是:2 W0 f( F( x. b/ U5 B' }6 g
begin model initialization function
0 W: ?6 K, W3 p/ E create 1 load of load type L_C2 to P_Creation2/ V" E! o. g/ e% V9 A8 A6 k$ C
create 1 load of load type L_C3 to P_Creation3
+ D$ T0 k3 j7 ?& @! X create 1 load of load type L_C4 to P_Creation4) z5 }, x* z7 }/ t0 P
return true: O/ w5 p3 G7 X" M
end
) K/ l( Y; ]4 l. N$ i, k6 ]1 f$ T- U5 R- ?8 I+ v
begin P_Creation2 arriving procedure
2 d3 G( {  f3 u, V3 ~  k while 1=1 do
. O% L1 v1 s/ {" i- u& d0 t5 y( I& _   begin
$ R* f/ U1 I. N/ }! m: I( s, w     wait for 1 sec' z: h; b4 b4 b& m/ f2 @
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)0 s+ D; G: \9 T/ `0 S
   end
$ X; a9 q1 t% [1 w  s end
# _- ~2 u/ [( n2 c) X
3 N! ]* G7 D8 }* O; \, o6 t+ F begin P_Creation3 arriving procedure; s2 n  x/ l8 x- A6 X* H) H5 P
while 1=1 do; w2 |2 ?8 K* Z3 R9 U% H
   begin
7 p) }2 }- v& D     wait for 1 sec
) t0 I8 Q2 [1 K+ k     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
8 Q1 j& Q' L* P( y. c( C   end( |* s, K3 g5 I
end   6 O- V8 l8 s/ g; s. p+ L; ]

$ P8 _3 p2 [- a' B6 j( D3 f9 abegin P_Creation4 arriving procedure
  s1 A) G: |: g2 p* g# U while 1=1 do
2 `; F, B4 ?$ \, O& V   begin
* R1 v/ S  n# D& q5 f2 }  [     wait for 1 sec+ o: V0 }, j6 [8 p
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die); \: x' F6 ~8 [3 {# L
   end
1 O8 \/ g% r0 c( H$ H/ ]  z/ x end% ~' ]% ^! k+ ]9 _! F
' ~# ?& Z% M7 X! @$ Q  _
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
6 B/ n3 L+ I) z- w( _1 f现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
7 l9 p* I8 \8 b+ lbegin model initialization function
: `- [$ h  G% a& K  create 1 load of load type L_null  to P_Creation2' a6 ~6 `1 Q& @7 ?+ E
  create 1 load of load type L_null  to P_Creation3/ h- C' z: N7 ^& L% S
  create 1 load of load type L_null  to P_Creation4
0 B# I, }+ Y$ Z8 I! z) @- T# t  return true
0 t$ u( l# l, d( G( w' xend
. ^* [- [. X3 U3 j, K
1 g- q3 L! M/ g2 ]0 \& U/ Ebegin P_Creation2 arriving procedure' ^, [' I) X: `& W
while 1=1 do
0 T9 b% D' J* |$ F9 {   begin
" n  e- f! I* h- U/ b, H6 Q     wait for 1 sec5 ?2 w% A9 s' m2 B& g: U
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
4 [5 ?' Q2 G: U2 `   end. p, y3 w5 ?" L5 Y# n9 a
end  {% n. i! M% z
" V% ^1 i' L! E9 c" r( \! ?2 z
begin P_Creation3 arriving procedure
# R. b& _0 D# N4 fwhile 1=1 do
0 n2 f+ m" Q7 \- o   begin
% E$ n9 n4 w) F" c1 h4 F     wait for 1 sec
) {) H. N; ]+ A  j$ z0 z     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
% D' @+ c) N- N/ a/ w! n+ G   end  f& o: y9 a2 Y& I6 Z
end   % A; Q  M; b5 v0 i
6 T- A. b5 _  [  g6 n) y
begin P_Creation4 arriving procedure0 d. x/ f# O* C" R- [' J+ \6 w
while 1=1 do
2 H- v; i8 V6 j. P1 W& k3 n7 M   begin; l' s6 ^6 K# N( m4 g6 m5 P
     wait for 1 sec
& \: P5 y6 W- F5 i) G) ^     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)0 V, ~! X+ {1 [; R6 W) J) w9 W
   end3 ^2 `; F9 A) c# S2 A6 O2 ^
end- b# _0 [4 U, ]5 t9 `
. E8 h) l, d) F1 s! C$ _1 ]& K
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。1 f9 v, l' `5 w5 y+ X
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
  d6 q" i1 p! L# c另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
6 Q* G1 c8 b$ w尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。4 ^; ^5 {  |' b9 J
====================# G8 F& T9 v' c) C
我试过了,终于成功了!!!!!!!!!. t. P: C: t% Q2 X6 A& Y- f6 K
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
3 J6 W/ p7 L! w* ~, z7 Y请版主给两位仿真币!!!!!!!!!!
) e& n3 A" u) W再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-1-20 10:10 , Processed in 0.019777 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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