设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10924|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:, i9 x0 ?! U' D- |3 `+ j
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
5 X& }( _7 w& ^2 u) _- y0 n谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
: m* H9 s6 p: x谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
! x, a5 q6 {/ Fbegin model initialization function" q& \& _, \$ A. F, h2 V/ l1 {
  create 1 load of load type L_null  to P_Creation2. q7 @( K* M% f; h+ ^- c
  create 1 load of load type L_null   ...

0 I& N' p% m" q7 x  L" G8 f4 v  k3 `
3 R9 x0 ]6 L& C. U* N, ]0 G也许是模型有问题,也许是软件或者系统的某种bug。
; r1 c5 @4 \8 I& L0 }* Y$ e! S) s
3 o: m" }5 C4 M( y尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
* `3 L6 Y! \* E9 e; R下面的代码不知道能否满足你的要求。
) ?4 Y% U* x% G& l
9 b5 F( ?7 Q% abegin model initialization function$ m" a  N: C2 ~7 K, q$ c
    create 1 load of L_null to P_creation, t5 I& u7 c7 ^4 A/ P
/*L_null is a load type of which the load create loads for the model.*/
' V& M5 c* h" q6 C* {4 w* h
- Y, Q( S, ]  @" d. t3 ?8 W    return true
; Z1 G/ N. C4 j5 |  yend
. ?2 G& \9 o7 g/ X2 ]9 U+ a6 M3 D. b0 V& i3 |7 {( L# s
begin P_creation arriving procedure
' k. T6 O6 o& E* h# N% l    while 1 = 1 begin
% |3 ?2 e' X  R3 \/ \# [, A9 D5 y! T        wait for V_interval sec
. T+ K( G+ X0 z/*V_interval is the interval of creation of loads, fixed or random.*/$ F2 v! x5 B$ u9 {
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
( Z$ {- L5 J- n1 f5 k/*V_p is the parameter of the distribution.*/
# u, N1 {$ V* p    end
  C- l- ~4 a$ n4 S: gend# x, s8 r! @3 W! S8 \6 `5 U
( B% J( |( a' H
begin P_process arriving procedure/ U8 M, G. q) Q
/*Any process the load will be in.*/
2 C  `  M! P+ L5 I8 A: o, x4 h    print "1 load created" to message( G4 Y& v& {% E3 _! w4 M8 t
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答8 R, j" p# b! u/ z
不过有些地方不太明白。
  ~& y; p4 L% ?. L1 E  g. ~1 y(1)L_null 和L_load 是什么关系呢?; B5 M2 D% p* t* Q9 h. V+ _
(2)create语句出现了两次,会不会重复呢' c0 k- b" w& ^' W5 s0 j$ D0 m
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
6 b, b9 }' n- z& @- \  G谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
8 ]6 n$ i9 n) d. b6 |$ k$ I因为我要产生3类load,所以代码是:
" X: S+ x. a# a: j4 obegin model initialization function+ ~4 T1 y/ k" ?
create 1 load of load type L_C2 to P_Creation2
% S8 ~/ k! ?2 C create 1 load of load type L_C3 to P_Creation3
9 w: _) V; r" K+ k1 ` create 1 load of load type L_C4 to P_Creation4( O& D4 a9 d! S
return true
% e+ C5 U0 Y; T4 V* Y; Send9 M, S8 w# k7 u# B

, }. @6 R& w- c( b( x* Q+ kbegin P_Creation2 arriving procedure
  I- a9 v8 e) t while 1=1 do7 C& T3 O6 k; M
   begin& S& y4 o, a3 Q
     wait for 1 sec, _( s+ E9 U+ f" W
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)! `: A4 V- w. t- }+ ?
   end: x) x, g( n1 c+ ]# k( w4 l
end
4 L! g* N# p8 `
  Z4 G9 ]7 g: e, t, P begin P_Creation3 arriving procedure6 I+ v8 [% r0 n3 k. m4 `4 ~  t5 [% }
while 1=1 do8 \4 v: h0 d+ \$ T. x% }
   begin
# ^& t/ E5 r& B. t" C     wait for 1 sec' W5 A/ {! @  }# w7 t" S9 _
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)& S+ [# G0 g: w7 c. M/ Z
   end
9 v# ^- i: F* `9 A end   * ]. j$ ?, ^  z. q8 A
0 f# `  U2 o5 v
begin P_Creation4 arriving procedure
; G" ?2 E* B, Q: [1 Q while 1=1 do# k8 F5 w4 p( L) B0 D3 j
   begin0 R- g- c" U  R7 z; d
     wait for 1 sec
  m" k1 P) B) q3 `( v     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
$ n8 D) ?' W6 Y0 j; i   end1 z' M+ X/ I) O# k
end
5 V! r7 k5 m' p% P4 M
4 S2 V( a3 n! i* [3 L7 G可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
- E! d. m) S; u( l3 a* ^7 u现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
5 D. c- a# M. ?( [begin model initialization function
2 X7 w5 a& C8 `  create 1 load of load type L_null  to P_Creation2
; \- Q; J7 B  I( }% ]  create 1 load of load type L_null  to P_Creation3% H+ Q/ ^8 r/ z- \7 {# q* _8 W
  create 1 load of load type L_null  to P_Creation4
7 V* e$ s3 O; \9 z8 z  return true
, r, t/ o) E1 S% |$ d: mend
$ K  B  |, u* Q  i8 Q. [0 \$ ]. [+ n$ N9 p1 Q- f
begin P_Creation2 arriving procedure
: L: B% k$ {# C! Z+ u% z4 c8 K8 F1 Y; iwhile 1=1 do# J' `2 g) j( k2 H4 d" ^
   begin( x& ^5 m/ S. T/ ?1 C. S
     wait for 1 sec4 j1 L/ s7 K; p8 D  l0 d
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
% T! p$ `) W- ]" U4 X! q- V' D   end8 \% w2 |- Q4 Z5 d
end) e' o- ?* i5 a% ?8 R

! }3 R! F6 _6 q/ h0 V& s9 @begin P_Creation3 arriving procedure4 E! N( K; ~* `! H, N4 x) T; w
while 1=1 do
% B8 X8 y9 ~$ i$ r: d0 \" j1 o   begin* S! `" P2 G* s2 }
     wait for 1 sec+ [1 q4 ?9 u8 `9 d3 n4 _; K
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)% I+ s2 p2 [2 U% Y0 H
   end
/ V: ]& p" O8 j$ fend   4 h& I# h2 k1 ~7 P7 V" Z: C! q: w$ u

; N/ k2 n  Q" K% b9 E0 obegin P_Creation4 arriving procedure; Z: e9 U& ^9 [* ^$ r: ?. M  G
while 1=1 do$ S  W. @. X% M' d& R- o
   begin
8 j! a* U5 @- l4 }4 p& C0 u4 T# y     wait for 1 sec
* W8 K% S# E' x* }1 H  P     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)2 g9 [2 K& E8 _- l% P
   end
3 t# y+ Q1 d/ E) \) p- R6 Aend0 l* R' W0 ?3 _! O  Z* P4 Z! J4 A
, y# A( |  W2 ^8 F& ^5 G! @
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
3 M. d6 p( m0 c& a3 j4 H如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。7 i- }0 h" {( r) j
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。. Z1 n, H9 q$ y' M% E
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
; Z# h4 \9 w+ a& R' ?% i3 C====================
8 w" `+ k' a2 B. P2 W我试过了,终于成功了!!!!!!!!!/ w, T1 z. f$ t8 w
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
* n. }: _, f' [  d, K  g请版主给两位仿真币!!!!!!!!!!
8 Y: ~1 T$ d$ R4 J2 ?7 P& L! [& I8 r再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-1-20 07:07 , Processed in 0.016548 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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