设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14350|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:! e! j, T- |8 N1 s2 W7 D
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?3 @5 `+ k% X  _
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 , P% @3 F7 v: ^# y$ z
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);9 {" ^" l7 E7 `# R
begin model initialization function: u8 @! x; o# J, _  n( K
  create 1 load of load type L_null  to P_Creation26 e* ]; |8 x! I, N
  create 1 load of load type L_null   ...
% Q$ u) V) a0 i

# M; T: G6 S2 J  v. I也许是模型有问题,也许是软件或者系统的某种bug。  K. [4 o% h6 E- q5 F

1 e! J. |* {) \5 j$ s3 Y2 y- \尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
2 }5 X1 g- D3 q# [: {; E, _下面的代码不知道能否满足你的要求。
  [. P& D( b' ?' |/ X9 l# Q- t+ U7 q, c5 \
begin model initialization function
- C) C1 [' b/ v7 q2 b' I    create 1 load of L_null to P_creation
. d5 y+ s: J. x) X% }/*L_null is a load type of which the load create loads for the model.*/
; B$ y& o" y! P2 a" @
1 l' ]$ ~, l1 ~; ?' V2 G    return true3 W( h7 U7 I. u# ?9 t& M
end" z, S8 \3 t4 {2 l# i: |7 H0 ?

4 \. f6 e0 f0 L+ Z# Obegin P_creation arriving procedure6 \4 M+ E. ^! A- Y5 [5 l
    while 1 = 1 begin' L8 R  A6 R; ~2 X; |7 P4 c
        wait for V_interval sec
( Q8 E, v# A; Y9 K2 _4 [$ \/*V_interval is the interval of creation of loads, fixed or random.*/8 c, v, [/ e8 F
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
" }- Y3 p5 P' ^* a* g5 L0 O0 {4 k/*V_p is the parameter of the distribution.*/# c/ {8 k  E2 A* w' V5 v
    end
( c; a% n8 `1 w9 _6 g, Q" Iend
# ]0 E+ F3 F+ {5 g& A- w) T6 J) R2 T* f7 U% |2 Y' m
begin P_process arriving procedure- m$ i4 O; V5 Z$ Q4 g! h
/*Any process the load will be in.*/* {/ V; X- ~" Z- j6 Y% E1 a
    print "1 load created" to message9 P9 y# B7 o6 L/ o
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答
) m- W" F9 [  o2 \% r+ G不过有些地方不太明白。
2 m$ P; K/ p8 ^$ z6 o; B8 Y2 G1 s(1)L_null 和L_load 是什么关系呢?
& Z9 b3 R0 A* f8 h  U5 E% `( {(2)create语句出现了两次,会不会重复呢: C/ {4 H! ~: j1 W. n. |9 H" X. K
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
/ Z3 W) a5 Z  Z  H, [8 q谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
+ n6 S: H8 `3 x( c/ ]因为我要产生3类load,所以代码是:
$ M4 w9 J$ g" E% S2 R3 Vbegin model initialization function
+ V8 Q) t0 F/ z: f% v create 1 load of load type L_C2 to P_Creation2& D, e0 C# a% R" {8 E2 u3 w
create 1 load of load type L_C3 to P_Creation3
. M( W( R. {* H: P: U create 1 load of load type L_C4 to P_Creation4
% V8 X8 X8 m0 n, r4 ^ return true
: {# W3 r- Q4 D& Vend" C2 I4 Y$ A' O' V9 x

0 ^( J2 w4 a: P2 _( |2 x! Hbegin P_Creation2 arriving procedure) }  A6 L, l+ M& L$ c$ G! \' S
while 1=1 do
9 o" H+ P, A9 h# k   begin
# X# {% E: m# R# V     wait for 1 sec
  J# [' J( x- @9 _# L8 u/ i3 g0 T     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)3 F* b) o, L4 C. G) z8 v2 Y
   end$ Z9 N& S& E$ l" q  E
end/ T+ ^3 `& u% J3 a* M- u" ~

' y. [3 P7 }& d; k& t) M begin P_Creation3 arriving procedure7 m- d& x7 i1 s8 @5 ~, f
while 1=1 do
2 V: H* ^  q: {8 U5 k0 k   begin0 ^; b, W* C7 A  g7 k5 _
     wait for 1 sec- a0 m6 N% r. ]9 Z/ l& F% `2 R2 l0 B! p
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)# }+ g# p0 {$ |% x7 R# A
   end3 r8 p6 m( Q( m) E- ]; T$ J
end   
  h7 C1 u- }2 Z" b: z" |+ k- q- P& m: Z0 B. s) I# O7 L, u+ s- n
begin P_Creation4 arriving procedure
/ P5 u4 b/ E, t, j% F while 1=1 do0 @; ~) ?% k) k0 z
   begin9 w) @5 S1 V$ ~1 ~
     wait for 1 sec1 D8 _2 ^7 K0 k) G
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
- h! F. P. J2 X   end! e' h9 [  t, K- }+ [: p/ Z
end% z7 B' h# a$ [; H. s# }

! W5 E( B$ D' y可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?, F1 c; |* f2 h( [( n
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);! E% a" x# x2 q' s. `
begin model initialization function  p$ c0 k( N  R8 J  Y# S# G; `; [
  create 1 load of load type L_null  to P_Creation2+ T9 z/ l; ?1 C# x' \! u
  create 1 load of load type L_null  to P_Creation3' j5 Y9 N" a" Q4 L
  create 1 load of load type L_null  to P_Creation4
! v; _, }. p) S; r( J  {  return true 5 ^% B' @0 V8 {/ {7 s9 Z
end0 r" m' M, H( H& V+ Y" K

. ?& T. q3 q5 abegin P_Creation2 arriving procedure
' U: [6 n2 T/ h$ D3 L, ]while 1=1 do% }1 m$ x9 ~3 ?$ m
   begin) F# y6 O" F8 g) B! O* s, y9 }9 o$ @
     wait for 1 sec
. l7 p( B/ P5 i     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
1 p0 A, W( X" `   end, M/ V, w, N1 Q
end4 A- L! e2 j( @' Q% U* I

9 C" f8 ~( f% gbegin P_Creation3 arriving procedure
6 j1 e' J/ G1 h6 Ywhile 1=1 do1 X& e1 {& f% e/ @" {
   begin; x4 O7 y. ?9 |" O" l3 G) N: G- j' c
     wait for 1 sec) c# m& K+ t7 Y' j
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
" a, o9 ~( \0 Y0 I   end
/ ]9 l& ], ^8 I) M2 S4 hend   , O3 v& \+ n+ d. [, J
8 x2 e" c  X( G  F+ g2 O6 `% `
begin P_Creation4 arriving procedure& z. n' W$ E; u' B0 N  S9 a) ]! K
while 1=1 do/ w# ?( _, @/ w+ z4 u1 W
   begin1 {3 n# d, ^3 U7 |1 p: k
     wait for 1 sec
7 r9 y7 i+ K8 e) c3 a/ F     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
  R6 f4 k9 |" X5 s5 `, I   end
. b5 \7 c: a1 p5 qend& w$ N  L5 D- j5 d! D4 m( b
- a4 |1 c) k# L- ?' u  @
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。1 U# x% B0 d# }* u3 n" I; E
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。2 N5 b% E2 S2 g
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
7 |' B/ W- `  L4 v9 I/ Y尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。0 k2 Q2 g4 U) E% I! r9 B- a
====================$ d- o: P+ ]: @# z
我试过了,终于成功了!!!!!!!!!2 y! Z6 n+ D. Y/ Y/ b6 W" N) {
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
  |4 [4 |9 x7 L% a* Y- N- o- f请版主给两位仿真币!!!!!!!!!!: b& p5 D& r( w
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-9-7 16:45 , Processed in 0.018006 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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