设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14088|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:& }% Y& Z8 \7 U5 {
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
* o/ e. W6 }6 V3 f" J, ^谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
8 w" ~) Q* n, j$ `. t; u2 ^谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
# D7 [$ k+ y+ }" h' o3 C- m8 Lbegin model initialization function
1 C2 u1 x" s! S3 S- q2 T  create 1 load of load type L_null  to P_Creation2
8 F1 t9 [' J/ ^! g  create 1 load of load type L_null   ...

4 _$ p; M$ Y  l9 ?
, b, @( f% ^$ m. C& o也许是模型有问题,也许是软件或者系统的某种bug。
7 e. h! r; p( z/ Y/ d7 M$ b' z' _+ o* U
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?+ P# q0 c8 s. W/ B( ~
下面的代码不知道能否满足你的要求。
& t7 Y- x; V9 f: V9 F& m4 y$ h4 H1 o! B/ |7 [. Y
begin model initialization function8 ]  ~2 ?3 w& J/ U+ |5 w* n
    create 1 load of L_null to P_creation  o- |; c6 c6 ]7 e- E5 T
/*L_null is a load type of which the load create loads for the model.*/
* c* K" B0 T1 g% }5 m# ]/ Q7 F% h1 }) S7 n
    return true  y+ b1 ~( l$ [' z9 \3 g9 J( u1 a0 H
end% P5 p+ _: f. {+ p
/ v8 x' A. p; {
begin P_creation arriving procedure& h! y$ B8 D! p( C4 ]3 t1 ^
    while 1 = 1 begin! U: T0 |' [- O1 Q* `  W
        wait for V_interval sec
2 b( W. h( b5 X0 y, R* J2 I- L1 w/*V_interval is the interval of creation of loads, fixed or random.*/5 t# E5 O; O6 i2 H8 [) g
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
& k; p6 O3 O- C, i1 z& ^: [/*V_p is the parameter of the distribution.*/+ h2 g4 z0 K# N
    end" A. M  x+ a1 M. \! b
end
+ f5 H: i) P& Q/ c$ v9 @' h7 S# G- Y: K5 P( N9 K0 V5 R* x
begin P_process arriving procedure
1 L) n$ @! }; u& j, W, S4 n/*Any process the load will be in.*/
- W6 H3 [2 F) T2 x. W    print "1 load created" to message* }. O" L1 D( z/ _* Y' {- Z
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答; V! t/ h2 S% |" a) h
不过有些地方不太明白。& u4 M" H' T7 k  @+ Q
(1)L_null 和L_load 是什么关系呢?- l' W. k$ Y# \3 B8 B/ u$ b8 y
(2)create语句出现了两次,会不会重复呢: u+ g0 ~0 U  E& I& R$ @' D" D
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。: S: U! m* V  Y7 ^+ d$ ]: j) j& O
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
" u/ G1 ^# t) M因为我要产生3类load,所以代码是:
; L; F% T* }8 s6 ^/ r' R% Abegin model initialization function% l* r: G* A* A$ r
create 1 load of load type L_C2 to P_Creation2
; L# V* R7 m' v* s create 1 load of load type L_C3 to P_Creation36 l; K2 D: r0 k, I
create 1 load of load type L_C4 to P_Creation4* h1 {/ ^; y+ }! B" Y9 O) P  c1 D
return true/ E4 i+ z4 ]" `+ t2 m
end
8 p, j! R6 ~9 F7 ^, E" ?
7 H* f: A7 A9 @; ?" `( jbegin P_Creation2 arriving procedure8 V* B1 d2 I$ W: S
while 1=1 do6 C# y+ [" P5 E0 x9 y
   begin
( h/ Y" T% I8 m# Q; {     wait for 1 sec' a  Z" R$ M3 X* o
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
$ L# O* O: I; O+ Q   end
, ~4 m2 o( B' d  S5 Z+ r end  q( j, k# U+ o* m& q  v' k

* O, [6 P, ]" l- k8 ~+ O3 F begin P_Creation3 arriving procedure
* z. s" u7 W9 { while 1=1 do0 a; C' L: ^( d( T1 @+ n' t1 f
   begin
6 G" s$ E8 s: x8 _; C/ O/ _: L) L     wait for 1 sec
) U" A. \+ k' T4 ]  A; W7 Y/ k     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
) t+ r+ J( A5 N: k   end- P6 p' Y4 c! M' Q. U( _" U
end   & J% h- i& i7 W* B" j
9 e8 U, |9 Z1 X; H5 I
begin P_Creation4 arriving procedure
3 @% C8 \! L; `6 k) z7 Q5 l5 E while 1=1 do6 `) k: }2 Y, d; I$ |& u
   begin$ @  ]1 k) d0 E+ Z5 j) p: b, @
     wait for 1 sec
4 C1 s9 b7 t! T  C6 G5 T! ]     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die). S0 m, O5 |* ~" H1 x8 n
   end5 L& p  C% z% z8 E6 R( d' J0 s
end1 P2 F  ~0 G9 f2 y7 f
9 d4 E/ B, I1 n* y# N8 c
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
6 z, o& v) J/ n; r现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
% W0 b0 {3 J8 T' H) f) xbegin model initialization function
; n0 U  A+ J. l5 l+ |- K  create 1 load of load type L_null  to P_Creation2) N* x, M3 `+ f! [2 Y: d4 M5 t
  create 1 load of load type L_null  to P_Creation3+ h/ `8 t$ m8 S  u5 k  D
  create 1 load of load type L_null  to P_Creation4
+ i4 P5 |7 B6 E  return true
4 \" Q# x* E4 o9 H. n! {. Iend' {4 x; `1 e- l! c
) K4 A8 L6 n; }( q8 [* H' [
begin P_Creation2 arriving procedure
+ V2 ^% d3 T6 V. ywhile 1=1 do  k# B/ n8 Y- e/ u/ g
   begin& \& t- b8 F' \0 T# ~) G! k
     wait for 1 sec
$ `! r9 G6 U- \     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
0 @+ e. u7 {5 ?+ [- F  I" W   end+ ^# c) G+ L9 y- {
end
# d$ K7 C/ t9 y( ^7 Z* I3 d3 c' L. z+ c) ]
begin P_Creation3 arriving procedure) ]6 G- I/ v$ Z
while 1=1 do1 o6 T' m; D: A; w$ ]- t
   begin
% t, R7 k$ r6 Z: r8 K     wait for 1 sec
5 q# M* j/ v: o* n' L: d0 x# A     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)4 O" z- y5 k9 V, D4 V0 a9 I
   end: W: y! o6 m0 ]
end   
9 H) }3 J1 \) @1 ?: y+ q! M2 q
+ `6 R" K- c- r0 f+ M/ t5 `8 abegin P_Creation4 arriving procedure
7 q% a+ H* C# ^, z) lwhile 1=1 do% J0 |0 Z" u6 D( [+ V" e
   begin3 U( p' M3 q- O' J& {5 U* N
     wait for 1 sec; f  v# i5 g* \
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)* X/ {1 a$ e( I2 ]# q
   end
: r- R$ [  _& p! C9 ^2 [end1 v7 i7 U' q# T3 G5 w5 `# q

* z. s. k8 H( }( U5 ^但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
6 C3 r: R; M; A8 e& N4 D! u如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
* w6 B: {0 `; p+ c9 G* s2 ~1 c6 i/ O另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
$ u; U$ a8 h* E. I尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。1 n! ~  Z  P5 e0 V( X
====================
" }  ?8 N8 ?, |: i1 G4 ^: v6 e我试过了,终于成功了!!!!!!!!!
! r: @. B8 L2 K0 E0 u这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!( q* v3 J3 k) s
请版主给两位仿真币!!!!!!!!!!# t0 X( C5 X7 D( P+ T- R, V* ]
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-21 17:28 , Processed in 0.013876 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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