设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13824|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:. f) T4 c0 q( Z7 J- r
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
& U2 X1 t8 G$ K' O1 o谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
) J1 d2 z7 A" \$ L; K! O7 P4 n3 A/ Z谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
' L3 S8 N8 P$ Ybegin model initialization function/ L- B/ I6 f' @5 e/ c' S
  create 1 load of load type L_null  to P_Creation2
; F9 {# z1 K" Z+ C) O  create 1 load of load type L_null   ...
. `6 ^5 P& ^/ G4 G
+ n( {$ h5 S4 m( o0 @
也许是模型有问题,也许是软件或者系统的某种bug。
9 o$ X" j# j1 h7 ^/ I& m# k6 K! T
! f+ l/ g4 v" j( |$ y+ `# L; y尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
) g0 |' U6 C/ Z( e0 c下面的代码不知道能否满足你的要求。
' I  l: ?" r+ [" p& i
9 @) N7 P( O( {, Hbegin model initialization function
$ e9 M6 {1 K- `* M  r# u+ ~    create 1 load of L_null to P_creation
! M: b: \5 L* B4 U) \6 f/*L_null is a load type of which the load create loads for the model.*/: o) X2 B; W& T* g

. U- L3 b0 I8 j! s6 o4 p% ^    return true) \* X  w$ C) C2 L1 Z. Q
end
5 [' u6 N2 D, H6 A# H( d, y4 P! V  _
begin P_creation arriving procedure
$ z2 R% ^! A$ }( b, ^    while 1 = 1 begin0 x. `9 }) x  ?( @. Z. |& C
        wait for V_interval sec
$ t4 G+ Z3 K' r3 E- }$ h/*V_interval is the interval of creation of loads, fixed or random.*/) x6 V' \+ \' X3 l. b; `
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)$ w" F, q: O+ D6 a: d. `# ]8 Z: S, w
/*V_p is the parameter of the distribution.*// P) b6 A9 W4 b$ T' S
    end1 u* L0 ~/ L" J7 D- K
end
9 q5 W" Q5 [* Q8 |' ~7 ]) m" T% L1 {( Q
begin P_process arriving procedure
$ r! H1 T' R, y/*Any process the load will be in.*/9 t) v9 R6 y: |8 I
    print "1 load created" to message
; }3 ~8 h, `8 F; D' A1 g6 j9 Y. Z3 Oend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答& }& B& I* {' y8 D6 K1 o1 R( f
不过有些地方不太明白。
; I+ c/ Z# Q5 ]" H0 Z# N% l(1)L_null 和L_load 是什么关系呢?
( N3 S. n& w* _(2)create语句出现了两次,会不会重复呢" {4 u3 M+ v$ f% G5 u/ ?3 \/ Q
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。, j& D6 `+ \1 c) @
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。4 F0 P! M! D# y
因为我要产生3类load,所以代码是:+ e: G5 @6 a5 W1 k' r
begin model initialization function
) z  I6 d4 b1 A- T* Z2 \ create 1 load of load type L_C2 to P_Creation29 H( {) z3 a! O4 F% E+ e. l
create 1 load of load type L_C3 to P_Creation31 _, R5 U* d8 S
create 1 load of load type L_C4 to P_Creation4
, Y; e: q4 C% S, M return true( ?# J3 I* f/ e7 y/ ~+ ]
end
" C$ r/ ?  e% ~
. |5 y0 y7 U  u* ^, l# \/ fbegin P_Creation2 arriving procedure
- O) B- N% S7 _ while 1=1 do
. T/ w7 f5 r& R  Y  Q$ O   begin+ H0 {- q" V0 i
     wait for 1 sec
/ L! r6 Y  V! y! Q     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
3 b, U, B$ F3 @( q3 L4 g   end
9 c$ H% k- b3 b5 d3 ]& L" L9 l1 T3 l end
7 `3 {3 j; J. N8 Y6 L% d4 q . {& }9 n+ ?" Z
begin P_Creation3 arriving procedure
- R6 Z8 p$ y- o4 q9 k# k* I while 1=1 do% B  U" C6 Q+ J/ }/ W, v8 r9 W
   begin
! v, Y8 G, B- R( y8 V( b     wait for 1 sec- J( B: k- `2 y; g4 ~
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
3 f. O0 Q0 u9 |, M8 v   end7 p: u, `3 j0 \. O
end   5 s5 V9 N2 P% ^! I
3 V9 W3 y5 D" I0 M( }7 F+ y* X
begin P_Creation4 arriving procedure
9 u! B. B0 U" i2 ^) q/ \9 m' |" J5 h while 1=1 do
  m% L4 J! Q$ [, W# x: V& X/ ~% C   begin. d4 j) O/ q9 I; z1 y
     wait for 1 sec* k0 |" {, N$ C' u! j8 g! h
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)$ m0 U  m9 q0 I7 Y. ^
   end
2 S  U* A+ d( v end
5 v- _: x0 q8 }+ k, {$ v& P: q) E/ f* s; [- O
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
- h9 {4 m# J/ _) }( H; B+ Y9 x现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);2 D) S  s" B* u
begin model initialization function; s5 m+ I# `% N5 z7 [
  create 1 load of load type L_null  to P_Creation2
; ], W; e+ d8 c* u( W  create 1 load of load type L_null  to P_Creation3
" l1 ~9 v. L1 y  create 1 load of load type L_null  to P_Creation4* V% r. Y5 E* n: T9 I' i
  return true
# h: k  `7 U- F3 Bend
; s% ^/ k6 v4 f0 H6 M9 m" b7 I2 i3 J% M" n: h# Y
begin P_Creation2 arriving procedure
0 }3 @" M9 g( h) I/ K$ D( i- wwhile 1=1 do
2 }4 r( f2 H6 ^* k* P+ }   begin8 r; x2 f& I) |- o9 X1 E  W) ^" }
     wait for 1 sec9 R& I' u5 y7 b1 N5 k! N7 p4 R9 }) ?
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
% k! _, b2 [8 a7 ?   end
+ D' t2 t, y9 jend( a- o4 T3 l* R
8 v$ n4 e) X9 ~) j, H- `4 p
begin P_Creation3 arriving procedure
  m( v. r& `( E) Z1 xwhile 1=1 do& Q* c3 h8 a5 P$ h% y, @
   begin9 P' K" V( V4 G/ u7 E
     wait for 1 sec; S* i' l/ b) l: s% z, f4 B  V
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)7 h" R$ c$ P  u
   end
) N0 h% g" d3 r: @9 F) {/ wend   
; R* r+ j9 e- ?% u( k; B; G' j
2 Z2 J* C) ~4 Q7 j0 dbegin P_Creation4 arriving procedure
# U4 D7 o# ]: Q7 rwhile 1=1 do
; Q$ e6 ^4 J# b   begin
. }& }7 x9 ~. K& j; a     wait for 1 sec
6 Z# N& g6 x& g0 l     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
/ L  i# Q7 h0 r/ ^/ O  Q. w   end
1 E9 y! Z( D# ?- [$ Vend
, |9 K9 r0 ^* v( U# j! J% s8 q& v4 S5 O: O/ O1 `
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。. Z" H7 g5 u- F
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
# Z- I- G, J  z* }6 f9 H! y/ X* f. _" W另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。3 B( a2 r5 p- ?: ]  W4 a
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
  R/ X8 K$ e1 S* v" ]====================9 _% ^7 V" s* w  r' R/ D
我试过了,终于成功了!!!!!!!!!& f. R' M' F) O% I8 y
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!, U9 ?$ o( p. z  W7 ^4 |0 v$ d
请版主给两位仿真币!!!!!!!!!!
8 o7 {, n! \1 T4 p4 h再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-4 08:17 , Processed in 0.015355 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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