设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9844|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:$ u. `+ _- q- ?& [
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
* `& y! [- j" t谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 3 z7 _, o# p( S
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);: E8 T! Q! J% q9 Y
begin model initialization function( Y/ J" v$ w( w3 Y  L2 t
  create 1 load of load type L_null  to P_Creation2
: w6 ~8 i+ C$ K  create 1 load of load type L_null   ...

( x$ V. W. M$ o' W1 m# n) R: I$ E/ \' h+ P! d  E. w
也许是模型有问题,也许是软件或者系统的某种bug。
* Q( O, o+ m( B; `3 K' S+ Y2 j5 |8 a! e, I9 @4 t6 x/ W$ g
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
- F& e. E7 F# M9 k1 Q下面的代码不知道能否满足你的要求。
$ p4 D7 l1 J; @) F' L1 N; c& p9 E, X# j
begin model initialization function# ~: h: M! j. \# ?
    create 1 load of L_null to P_creation
+ B: D$ E3 F9 }2 u/*L_null is a load type of which the load create loads for the model.*/
3 O* {" e2 j3 B/ h8 Q0 O: }, t- h, J: D8 R) h
    return true( v5 ^1 x/ J8 o0 M
end# m: i3 m# _, d
1 U1 b( K& m% r% a" B8 {
begin P_creation arriving procedure
6 h! ]: }0 z0 P8 r, B  z, c    while 1 = 1 begin. k2 C  b4 I7 }- J+ N& m6 v" R' j! s
        wait for V_interval sec" M% Z4 B9 C2 K2 E* h4 x
/*V_interval is the interval of creation of loads, fixed or random.*/4 ], J/ o$ L" D
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
5 Q# o: D3 }* B/*V_p is the parameter of the distribution.*/# T! S1 V) c( ^6 O$ e' Y
    end
5 n$ i! V& D* u: G# |5 d/ V9 Iend3 R8 q: |( B: b6 l% @8 r( C  X0 `

& B  M9 y; {6 @1 X( ?4 A- q9 sbegin P_process arriving procedure
  N) n. w6 z+ A; ~0 C( O/*Any process the load will be in.*/
0 ~2 s& H! R+ m# `, O2 L9 F    print "1 load created" to message
1 D% w3 T% c7 S1 C8 n0 i/ Z1 Pend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答, q" s7 z8 B4 ^' w
不过有些地方不太明白。, C6 `6 E& M; f* C% U- C
(1)L_null 和L_load 是什么关系呢?* D: `. r* o/ f
(2)create语句出现了两次,会不会重复呢
% l8 w$ O* g5 o3 X2 x6 y0 J! y7 ]+ ~+ B我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
9 ]( }3 p9 C2 i谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
! l, q4 L) V6 u& a- x. b3 O1 Z因为我要产生3类load,所以代码是:( q3 R# h. A' k% b+ j; k
begin model initialization function
( z1 l+ r' A& C: w- l* {3 r" `* n( Z create 1 load of load type L_C2 to P_Creation2
/ F4 j6 @; E  S1 D create 1 load of load type L_C3 to P_Creation3" g* D4 d& G' Z8 [
create 1 load of load type L_C4 to P_Creation4
3 e, o0 ^9 r+ g1 ~ return true
! R) ~2 z4 v7 tend
6 o7 ?* K/ ]2 `6 x
" K7 k0 q4 ~% t& ?* s4 ]3 Tbegin P_Creation2 arriving procedure
! D+ c- ~$ _  L3 L3 E$ R while 1=1 do, H2 n$ f9 G7 u" _
   begin
# f2 p3 s% R8 r( h2 K5 o8 ~' g6 L6 F     wait for 1 sec( o4 Z& A( A- d6 G. t; u
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
' B3 W! i  X  \4 q   end0 Y- `- o7 x  r! E8 b
end. A3 x0 A! \0 M2 C

( z: [4 N* k" `6 b4 R4 a begin P_Creation3 arriving procedure
( v, j6 z- s2 C% ~6 o. \! o while 1=1 do
+ V5 T5 }# Y0 Z5 K   begin
" @! u6 ]0 v! B     wait for 1 sec
4 H' X) j" K; P' {% c+ O5 o" R" L     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
! u! H; O! T6 b: R1 J   end
4 s( q2 `' s2 K  }( L0 ?1 r/ L end   : R' H7 b- f  ]( `! b1 G

, ], J7 @  r/ ~begin P_Creation4 arriving procedure7 K# a- C+ `8 r1 |
while 1=1 do
4 M2 I; ~; V, [0 c5 E! k! k0 k# v   begin
& z  l# }# }' J& R     wait for 1 sec
$ |8 y) I( Y; X" N7 O* G1 L6 y     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
  G9 o7 ]* G: d) d. a   end5 c+ d, e  ]+ p! u& P9 \
end6 W( ~3 R0 P- l9 ?
6 G  R+ e; q2 ?" e9 H. B
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
% s7 t% l, P" ]) [1 g9 M$ Z* x. }  J现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);! ^; x' R; _! w" e$ Z
begin model initialization function8 m% H# R  U4 l5 V7 v: A
  create 1 load of load type L_null  to P_Creation2/ r7 A1 G5 Q( t
  create 1 load of load type L_null  to P_Creation3
% ?0 B1 L9 P- l6 v$ o$ d" T  create 1 load of load type L_null  to P_Creation4* L6 Z* t$ m# M' ^( U
  return true : x. {  ~9 X+ B
end$ d  t* a# j# V6 e! K

8 g- h+ o, X6 W- y+ T+ ~begin P_Creation2 arriving procedure' Y( A2 K1 M% }- x" f6 i5 T
while 1=1 do/ ^$ W6 I/ u6 b9 J4 Y. O
   begin* f. R: G% m2 g! b
     wait for 1 sec
0 l3 O  k4 b& B$ h* M" r     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
+ v+ y: h: N5 I0 A+ Z   end
" V5 w- S8 m, |( U2 @$ J8 cend2 c. {  G0 X; i- T* W
# X2 }1 M6 z% ~
begin P_Creation3 arriving procedure
1 l2 H, Z' s  e9 K( W2 _: F  V  T  Vwhile 1=1 do
$ ~) K" G. j- A7 r; y7 w   begin  b$ m- Z" i* x5 q& l
     wait for 1 sec9 R1 n2 f( ^) i0 M+ M+ a  g. K- }
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)/ G* @7 `" e, \2 a
   end$ J- I1 r) J3 F: |
end   # ~) q* g: E! X
; S9 [% x2 B3 J2 I
begin P_Creation4 arriving procedure; F) X' ]" |# W" G- ]
while 1=1 do
6 f, y' n( S# J7 g* E   begin( z4 j: m2 C3 w
     wait for 1 sec8 i4 ^6 ]1 c0 w5 r) b
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)' N: @6 C1 i) Z7 Q
   end
0 E' w/ `- h, L9 K. ^end& s0 N( c' A% \  @% M9 N) t

6 c5 u- L* R4 [8 a, `  h但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
1 Q! P# j2 _, n如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。  B  n3 W( ?0 k+ C1 K7 M+ u
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
0 F; m+ U& W" s8 E; I( X尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
- l- O* [# c! F7 `" }: ]+ n====================
! B; r5 d: e  e# m我试过了,终于成功了!!!!!!!!!8 P: v. _  Y6 h; w5 t
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!) C! Z( d2 U4 |, G* g9 r
请版主给两位仿真币!!!!!!!!!!; t5 m- y0 J# L& D% T
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-9-18 00:43 , Processed in 0.019042 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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