设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12593|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:8 v9 L3 v: t* J; l6 S+ l8 z
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?8 u  M  U4 D$ v$ Q* o
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
* I/ a2 N) I& F$ M谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
$ A1 i* A' f( X# F) _8 Kbegin model initialization function
3 s0 V  ^. T' |  create 1 load of load type L_null  to P_Creation2
/ i% a9 z1 o7 v0 W- q7 W  create 1 load of load type L_null   ...

8 ~+ s9 ]2 {. K2 U" k# o
) l( ^. n9 K, |2 [也许是模型有问题,也许是软件或者系统的某种bug。( G. w& r3 i6 V
% F* i5 P. i0 H5 b
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?; p! C. _/ s. y
下面的代码不知道能否满足你的要求。( ^9 T, [* d) B7 P( J" |

' R0 T# E. m4 t% G0 l+ p6 O# ?) vbegin model initialization function8 I5 Q) ~9 u9 M, I6 ^. i
    create 1 load of L_null to P_creation
( |3 Q+ Y# t- Y& o, Z  T/*L_null is a load type of which the load create loads for the model.*/, E  |, @% ]1 @0 v- }$ G

9 t9 o4 z+ d3 k: C  |    return true
0 t% o: t& d8 H# C! j7 L$ Qend
' Z$ d5 Q- N+ R  p/ u
( I, J. l, h5 X# a. h- f# l( z2 P) Q0 S$ ?begin P_creation arriving procedure
8 i3 R8 g  W. o    while 1 = 1 begin
3 Z; h  E( M4 I, L% Q        wait for V_interval sec& |* N! t9 j+ O  O. ]
/*V_interval is the interval of creation of loads, fixed or random.*/
8 \% @( Y+ r3 N) R- @6 {1 B* \        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
2 x0 W& \1 U+ b3 }/*V_p is the parameter of the distribution.*/- c1 @' Y# X0 B. T0 N8 [8 \6 C
    end) E8 x' W$ O" R4 {- Y% a
end. A* j7 ]3 ^" E+ l' }2 c
. N/ A7 q- o( e1 D
begin P_process arriving procedure
  s" i, |' y! M* _+ C/*Any process the load will be in.*/
5 D* u" d% Y' C$ X. a    print "1 load created" to message
4 ~  _' y2 o  {% K4 D6 Wend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答6 q0 M; @! `$ q
不过有些地方不太明白。/ r4 y3 w, \5 {1 A; F1 M3 `; Y
(1)L_null 和L_load 是什么关系呢?5 a% M9 }( ^; d4 z3 W
(2)create语句出现了两次,会不会重复呢1 T: Y1 _" j7 I5 N
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。6 O9 K* q+ \0 Q- S1 g& @, v" l; S. L
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
' T- h( o) ?9 Q因为我要产生3类load,所以代码是:4 k0 V- z. e. R# o7 o" A
begin model initialization function" w  X; Y: y% d+ z/ n" b
create 1 load of load type L_C2 to P_Creation2
, A7 }! l0 A! O4 [1 B create 1 load of load type L_C3 to P_Creation3
& K9 p. W7 K% i create 1 load of load type L_C4 to P_Creation4# `3 a3 B' F! }: u6 {4 [+ H
return true
# e9 [0 X/ F4 ?7 u: Y7 ?0 Kend5 P' b2 x# E1 l. Q
8 A1 j3 m6 u5 g) s$ p6 H7 m+ O! g
begin P_Creation2 arriving procedure
' s5 z* f! j6 q1 O: k& a while 1=1 do, O- p; d+ H9 W+ u: T. b
   begin9 J) N8 H% `; H  }: o' L
     wait for 1 sec
( y; g4 v  T! a) P: D; `     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
2 o/ v5 s! Y8 P5 b/ i# S4 X   end
5 a+ Z* B1 \: W/ n2 E8 d" w0 p1 f end; \+ t5 V5 y" |- D& |

9 i. o! I% a* k$ `5 l begin P_Creation3 arriving procedure
6 t" J6 `7 c1 c* k$ d while 1=1 do9 q1 r, U: H9 U7 a1 e3 |% U
   begin
: r, J. A2 \/ E  X( {     wait for 1 sec
9 A' m2 H" ~- A6 {: d     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
7 i" g2 ~. n: G: P3 {   end, f) M- f" Z! k, C
end   " z% ^8 D; _8 {7 a7 p; a
5 o, x  o  |1 U4 {& o
begin P_Creation4 arriving procedure0 [$ \7 P2 ^6 h8 L
while 1=1 do% p/ G) e* Q; f8 k' a1 v8 ]
   begin
& \2 Z/ w+ k/ F4 c     wait for 1 sec+ t. e$ U7 r" `/ e9 A
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)$ o2 @. S) _# s& ^
   end
! L1 e' X- c8 R5 K end8 C3 c( G' [) o+ q4 _. l
7 K5 |* L  t- R, D6 Q: i+ `
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
3 i5 h) a' G% c: {: p现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);: R4 Q6 }* I* ?# @& S* h9 F! `- D
begin model initialization function
; y4 i0 {/ i6 V. @  W  create 1 load of load type L_null  to P_Creation25 H) e9 `" g0 y5 w, f- R
  create 1 load of load type L_null  to P_Creation36 w4 J8 w/ u8 U2 s
  create 1 load of load type L_null  to P_Creation4
8 @+ r1 O" z: [( u" i5 S  return true   P" Y2 T) Z/ n( Q8 w+ @
end
5 }+ O1 W4 p% r2 F8 P
' e% P. p* }+ S# {! u- b$ q# ^begin P_Creation2 arriving procedure
' Y  P! G4 X5 g  P. j) bwhile 1=1 do
: ^4 ]; k" _) \! J% G1 N   begin4 W. N5 `2 P# E' g
     wait for 1 sec
/ [% t  `' P6 p2 G/ ?' Q     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
! `4 B: b& e& o   end
! W3 P$ k" o% c6 Yend
" M- h' S8 l' G) V2 ]
" e9 B; r  C! v0 G6 I! N$ dbegin P_Creation3 arriving procedure. C% J9 q9 ]0 h  |- ]
while 1=1 do
( W- D. R- L* K, t: t   begin6 B9 i8 j) k) [8 v7 o: P
     wait for 1 sec
3 ~7 h8 \7 h# o: f. n# ^$ R     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
% V# g1 m+ |2 _8 N/ `   end/ }) |$ P8 ~+ w4 L3 h0 j
end   ! k; Y" Q- J0 k5 r8 o

* B6 V; O% B0 L' n, p' mbegin P_Creation4 arriving procedure
, r+ p. r  T0 \9 {" l7 j. gwhile 1=1 do3 J( V0 k7 I$ X3 D" n, l
   begin+ }2 G2 ?2 k+ f$ s
     wait for 1 sec
! k+ W9 H0 |7 n$ p/ G/ u2 {5 t6 @: f  c     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)7 @" h% ^2 H  n% H2 G
   end) g# H" Y6 i8 [. s6 h( B
end
( l0 b8 `) p. ~' {5 H, J, k4 L& ]: z' y6 @2 F0 X$ M: y% g
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
. a# I1 G8 j& Z/ L5 ~8 w( G3 ^如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
% J+ n% q% R" K- M另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。, x( f# J* b3 |1 {# ?- O
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
- g; w  J0 R4 f0 X; A====================
  K+ A2 o; ~- `* G我试过了,终于成功了!!!!!!!!!
- m: y* I! C4 t- S# V$ L- c这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
1 p% Q+ U% K: @+ e- Z) h2 Y1 n) [请版主给两位仿真币!!!!!!!!!!
5 `. B/ F% a* ]* N0 z. s; l再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-5-22 02:20 , Processed in 0.017163 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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