设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13269|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:  U' \2 A& L) F# _" q
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?: i4 u- j' L4 o
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 7 W' s6 {$ i. W: C; q& |
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
' A/ H$ ]8 t" p. `- I0 }& l6 Y2 ibegin model initialization function; U4 ]; ^6 N  I, u9 o# q
  create 1 load of load type L_null  to P_Creation2( r) P! ]6 n4 z0 ^, t, x
  create 1 load of load type L_null   ...
% H9 D- `" X  d$ @9 v! I" r7 C9 W9 t

. o% D8 q' n$ J! v% V0 m6 N也许是模型有问题,也许是软件或者系统的某种bug。
! z, C. e- l/ d* D- Y5 k/ D* I) a# l5 k( s
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?& I4 \$ Q) E1 _) [* O9 y$ v3 k- u' q
下面的代码不知道能否满足你的要求。$ {& Z+ X. W8 [: r; S

$ _$ M  v: V4 Wbegin model initialization function& t3 A* e: w& w- r' {
    create 1 load of L_null to P_creation
( }2 X0 n5 T  G  d% {; |/*L_null is a load type of which the load create loads for the model.*/
' V2 Y' h/ U* G8 |3 [, a7 _; S& e% F; O" Y
    return true
& }# X, i1 w1 @4 W* wend  C' X& F! t/ P  l7 K$ n5 O
' S* J; s- S/ D. n0 Y
begin P_creation arriving procedure6 b, |' W* v( p) ]3 h) q% c0 o
    while 1 = 1 begin
8 f3 f' \6 I0 l8 M& p        wait for V_interval sec2 O# \5 n. E) K
/*V_interval is the interval of creation of loads, fixed or random.*/
4 V( |! k0 Z- b  @5 I- I0 J4 P' O        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)) t% t# L5 L- J) J
/*V_p is the parameter of the distribution.*/
2 t4 U$ D3 f8 Y    end
  o: z% w1 r0 m& t: r( Q$ nend, Q& d# b+ j& T0 B4 c& B5 z& I
9 r8 K! J5 D4 b: Q' z
begin P_process arriving procedure/ t6 r2 X# ^3 ]9 P8 x& o
/*Any process the load will be in.*/
  b' x8 j5 u! n- K, X    print "1 load created" to message, b- {& h+ r& z0 l% c; \6 _
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答. Q$ N" ^9 |0 P
不过有些地方不太明白。
/ z$ X) d9 T! {: K0 f(1)L_null 和L_load 是什么关系呢?% f6 H4 k5 V+ }. L+ g' c) r
(2)create语句出现了两次,会不会重复呢
6 s& p" ?- T) k6 S8 y, |1 g& b7 H我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。0 P% T' N1 \$ W/ f
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
- T' j6 Q* j# L' L: k. N$ r& V( p因为我要产生3类load,所以代码是:
5 ~: t6 B' e/ f8 \5 jbegin model initialization function% `4 v3 l. P  F1 L1 T' w
create 1 load of load type L_C2 to P_Creation2( m( K. E0 |2 \4 G* ?' b
create 1 load of load type L_C3 to P_Creation3
, ~$ c- d8 w- G4 q create 1 load of load type L_C4 to P_Creation43 K. [) ~: t' d/ i2 N
return true
7 d3 N5 z- S+ J. v9 f. Zend) x. a& m* [/ _8 Q

0 y. N4 q+ k) k% Y- A, Pbegin P_Creation2 arriving procedure
0 S  `2 U$ e& [) _ while 1=1 do2 x& E  z( N. z
   begin' I( {1 u9 V: E2 N" `
     wait for 1 sec) U* j3 O7 @  d$ Z8 Y
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
; W& Q' G. x2 X; p' G   end
" A! |# j' ]9 [' P2 V  U. e9 { end
2 j1 `1 u0 ~/ ?2 T% h
7 j! E3 K- p2 V* b9 M( l- Y0 L/ y, Z, Y begin P_Creation3 arriving procedure" {' H: Z2 t# w5 s9 \0 Q/ O
while 1=1 do# t4 L; V, G* \7 t9 k) l
   begin+ B( V3 d7 F+ v. f" ]0 Z3 E  h
     wait for 1 sec
  j5 _+ L3 T. t& H7 z! r. {  `- g) @     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
. C+ ~) b9 c5 ~4 ^   end9 ~1 [) L/ p7 ?3 d: g
end   * }7 e7 |7 o+ i# J' [. t

8 A8 U; W; Z9 o8 \begin P_Creation4 arriving procedure. _& S; _; L& }) [; k
while 1=1 do; v2 P8 L; l" Y1 L
   begin
( A% t8 M/ N+ \( M* |     wait for 1 sec
/ g$ t; }5 _- ]: @" K     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)1 ~% _0 n; _! \4 W8 n3 V2 O( ~
   end3 A1 s  F# z& w+ Q
end
$ H4 c3 f( Q9 U! Y+ x) s/ ?. b8 Z8 R; s" F2 e& l
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
5 p% w: ?2 u' N/ T5 G现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);0 b. Z$ O7 }3 U6 {
begin model initialization function; W5 p4 @* \- a  f5 q4 L/ ?; H
  create 1 load of load type L_null  to P_Creation2
4 _' y2 w/ g6 Z3 b$ X/ z& R  create 1 load of load type L_null  to P_Creation3
+ `" I. s& @* C7 k  create 1 load of load type L_null  to P_Creation4
  o/ l& u6 F) F! z/ ^. N  return true 4 z; D  \7 [1 f; c0 T% _% ^
end6 l0 {- a' o2 W

$ w4 s( _& J( R" l+ A1 }9 Pbegin P_Creation2 arriving procedure6 J: L9 H: U4 k  v5 I4 z. s
while 1=1 do; v# d: h( O+ [7 o& U
   begin
* p2 c% q# R' R2 m- @! C/ J     wait for 1 sec& E$ w. t' ?6 q/ y. V
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)3 O3 ^1 M( u) Q$ f
   end
( |+ `* Q& u5 N' ]) f4 Z9 a  Dend2 n* m1 ?; F, G2 r3 x, n7 Q
! ]" U' ?! S7 i
begin P_Creation3 arriving procedure2 T4 o0 a, l0 s1 x7 x5 Z; v
while 1=1 do
1 ~5 p, ]% |. f5 z8 D$ p# t   begin5 f3 v3 b- Y1 Z: `& {9 y
     wait for 1 sec. L0 u7 ^  b8 }% {  h
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)5 y# B8 _. L% ?
   end
/ Y$ X; v; A3 s6 e1 uend   
7 z0 w) B! [' b4 I% {
, p" {" i& ^$ n# ^begin P_Creation4 arriving procedure- n0 d! O( S/ M" F- u' e) [: @
while 1=1 do
1 \' W! D! B; L9 `! L5 g' o: a   begin
# I, @8 \1 s3 [! r5 e     wait for 1 sec
  p% R/ B4 Q# B3 F% H8 L3 @0 R5 G, ?     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
% a$ {0 F7 X# ?   end
0 b" o2 W  I7 vend% E/ j2 e3 ^4 H9 l* k+ O

) B" h7 e& R0 ]% o但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。0 B8 y) B: A6 C
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。% `& E; f  v7 o
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。  J$ Y% O6 r7 Z) j/ z, e2 Y
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
: q9 y) o$ K) b% o- y7 z====================
# {, P5 f& l' _$ o0 ^1 T我试过了,终于成功了!!!!!!!!!& x6 J) ?9 l- M" L+ C% F- i8 ~
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!2 E6 H1 \8 q4 C, U9 Y+ @# s
请版主给两位仿真币!!!!!!!!!!
+ C' ?- B) e7 `0 K, n再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-12 21:36 , Processed in 0.018625 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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