设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12744|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:% s  a7 ^% l9 k. o6 y( j3 o# a
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?* a% o* y/ K  S' f
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
5 G" F1 K, F6 j6 s谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);7 V' e. O, ^8 p: l
begin model initialization function
& j  A4 H, D6 ]" E- k- h7 a' U' k  create 1 load of load type L_null  to P_Creation22 X" \: H9 h9 W
  create 1 load of load type L_null   ...

: {  i& R2 Q! s$ \6 P# G3 ^! ^* u) m# N9 W' a
也许是模型有问题,也许是软件或者系统的某种bug。3 a9 P5 v3 U" i

7 l3 A- G, Z# S/ N, h5 ~4 ^尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
: `: Y# W; Y/ P# O! x( B下面的代码不知道能否满足你的要求。
7 x1 s- Q% T& G7 e4 J/ _
9 V: }$ x5 c+ W; e* B/ K" ~+ f3 {1 Hbegin model initialization function
% T' s4 `" `; G    create 1 load of L_null to P_creation
" _. X0 F! U  g8 t) H, `' k/*L_null is a load type of which the load create loads for the model.*/
5 v+ |# L) g. }$ r/ ^& O. o! z
  {% ^! |8 c6 s8 `+ M  c% U    return true/ r+ y+ d" a/ W9 A+ c3 D7 q8 `
end
1 E4 X# w" B! }- F! K0 [. S! a' c. b& Z' _4 M! L. G
begin P_creation arriving procedure
5 A$ [( c1 `( P0 @1 x$ A% J; q8 n$ r    while 1 = 1 begin
$ E# Y& Q. K6 x: m: _        wait for V_interval sec$ n' l+ ?' a" n  E2 e( \
/*V_interval is the interval of creation of loads, fixed or random.*/$ S, x- ^! C" B* E! V
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)7 f# @; |, M1 c
/*V_p is the parameter of the distribution.*/3 p9 k" N" w9 n4 J! ]
    end
7 w5 f7 v1 |( C6 a* N6 ]3 Yend
3 |# N% i! |  |4 j- G$ l, o; J( D2 ]* o. F2 z
begin P_process arriving procedure9 k' [- o2 A0 t' p8 @
/*Any process the load will be in.*// m& y" _9 e  x; L2 I( |! m) s4 E
    print "1 load created" to message" d5 C0 u* l2 [8 n1 f1 ]0 E& R
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答% [1 h9 {* f* J% Z6 r# ]( B  c
不过有些地方不太明白。
* o8 c; l$ [6 v% j- M- z- Q(1)L_null 和L_load 是什么关系呢?
, G. o% g( b% c8 f; l4 Z(2)create语句出现了两次,会不会重复呢
- `7 b  {+ W3 z/ X, W6 z0 l1 @$ Y- S我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
. A  F; v+ T; x3 t6 p- K谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
; k* _! z% G; A" s" V. K因为我要产生3类load,所以代码是:" l6 I- u7 ~, S1 l  q( |- U
begin model initialization function- u1 [- v  e8 b8 g
create 1 load of load type L_C2 to P_Creation2
8 Z7 l, w# F4 X) I" p+ V create 1 load of load type L_C3 to P_Creation3
) q% ?  N: A7 P, w) O( z create 1 load of load type L_C4 to P_Creation4
8 k5 f# S, E: W' p, [% |9 j; y return true
2 L% h/ m' x  s  v2 ?end$ v. W0 P: u/ E

3 X$ Q  g( K7 i2 Q7 l5 gbegin P_Creation2 arriving procedure
5 ~5 j% V- z4 N/ O) f6 T while 1=1 do
7 m  H8 I& J8 |' j. f4 V: ^   begin
* z, L6 k3 Q0 F$ J     wait for 1 sec, z& }7 K: t1 O$ ?, c- D0 O+ B
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
3 q& T8 h9 Q8 c. t. v9 V7 w7 c# \- t. E   end( w) u3 f1 V/ t9 a7 b: S, K
end* {! R/ {0 b$ p1 B2 n. T' s

- L) p% d5 `+ {+ Y& b3 w1 z# M7 B  K$ w begin P_Creation3 arriving procedure
9 K. w3 M$ N  H4 z+ S while 1=1 do
: v6 q- m& z7 m- H3 M   begin
$ R* o8 H4 y* j/ x- ^9 R0 {     wait for 1 sec
- {7 N' ]8 @% Y     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
# ]7 W. j( ?/ Q5 p7 \. `* ~   end' S" ?) a2 s4 L2 Q8 Y. r
end   ) T1 ]* R" |0 G/ X
6 @' z' o7 Q5 V1 J5 S9 l$ i
begin P_Creation4 arriving procedure
( g3 Q5 l* R9 Z0 m3 P while 1=1 do6 y" b$ R6 }* h5 O/ {
   begin  Q6 z; `6 _0 J' o
     wait for 1 sec8 s+ Z/ [9 m( O3 ~# |
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
  d2 ]7 J2 v& X2 l  p   end% o3 C" P: y+ F
end3 e0 e* c3 e" h+ A! o6 @  U5 J  @

. C& d  M  L1 ^可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
& s' R4 b" M: b  g1 s7 P% t现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
5 I  j+ f8 N* Cbegin model initialization function0 ~& D: h( ~- I9 Y3 u0 c
  create 1 load of load type L_null  to P_Creation2( Z6 p# R- ?: g, I0 F0 T
  create 1 load of load type L_null  to P_Creation3
- @8 I) H) L, `! ]7 j  create 1 load of load type L_null  to P_Creation41 E5 @' T( w% o/ [2 f  ~
  return true & a! C. t# d3 U* J; ^- T/ A/ k2 }
end* f; {4 G7 g# e
) D" Z5 X# X$ `; `. n1 P! h  C
begin P_Creation2 arriving procedure
1 |3 j) ]. _4 F& m4 fwhile 1=1 do1 C. l& ~" Z) T/ ~0 t3 J9 x2 R. H
   begin" f; T/ R; ~' ]) _  u
     wait for 1 sec
+ m$ R0 {- ]/ Z; C     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
0 H* L- _+ C6 n7 [* }3 n   end2 f1 y6 u% d* P5 a& ]% Q/ u
end
! p0 G/ u% @" R* C1 d+ ?
: @7 O, K: X- \( X1 Jbegin P_Creation3 arriving procedure- |. S; U0 ?! P. e; ?; j+ m9 `
while 1=1 do
' q& o/ b. b& V7 _# P" y0 [" r" g7 t   begin9 Z  K% i; O* d# ^7 I1 h" w+ ]" H
     wait for 1 sec
, u% l* i- X/ P' j8 V3 y     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
0 U+ [) p$ E, J5 v' I7 K   end" Q/ z, k/ R+ s- Y5 U
end   + m$ D( b) ~0 Y: E

( ]: x5 U& s$ @' d0 m1 W, Pbegin P_Creation4 arriving procedure% d7 d: t$ z( D0 `# @
while 1=1 do
. k- f3 \6 S) n5 ~  C0 i% \   begin
+ E! L+ d0 S5 B) s     wait for 1 sec
& W) R8 W: G: t: E: G     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
: v5 Y/ _1 R8 c* \  L   end( Y4 d/ J$ F* `; B
end
4 M  G1 v: |) _' K* ?1 l' G6 r6 b, c$ b& B% q9 Q3 R- k
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。( Z" a- l/ B0 R8 a4 y* Y/ G: o
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
  W) G2 t3 U0 Y3 g: p+ o另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。+ c1 D( m& L* t
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。* Z' }, a  ~7 p5 e# k
====================
5 n  u) R3 }7 o& U$ U& E; f我试过了,终于成功了!!!!!!!!!$ |. V% u& v$ l, f6 E/ |: F
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
1 b: w4 X! Z! W" X请版主给两位仿真币!!!!!!!!!!
1 a& Q. [7 h0 J+ N4 C再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-4 08:18 , Processed in 0.018207 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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