设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13549|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
, p& c( M- E- [$ S5 V, \7 E如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
, i' s' ~6 l+ |$ h; l3 d( e. y* U谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
5 G. p) p& N. m) B2 l8 j/ a/ a谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
! e! J. F9 D% [4 o4 g: Cbegin model initialization function
) M6 _. t+ z' e+ k6 W4 J  create 1 load of load type L_null  to P_Creation2
- P/ R# t# _6 B% F1 c" }  create 1 load of load type L_null   ...

/ }4 M- K# m2 T3 d, [8 L% ?7 a6 r- H4 ^! G% Y
也许是模型有问题,也许是软件或者系统的某种bug。
' H4 O5 R, g1 g7 i; z: w9 H# [7 M$ p5 a  u( \' j1 @
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
2 l, W! D9 o' `- u下面的代码不知道能否满足你的要求。) I- e+ u1 Q# Z+ K) a! p
: F  j& b6 n. ]$ P
begin model initialization function
5 G9 g# |+ l2 k    create 1 load of L_null to P_creation
# _  w0 }1 L# c' l( \/ S/*L_null is a load type of which the load create loads for the model.*/
% Q4 w$ p( x; \' q3 c" j( O) l! \
, U; L* Y8 O: g/ y' S' k" ]    return true
" w/ \: E+ Q. v6 s! T, E% B; p, b+ n0 ^end
* Z5 J0 J/ J5 m0 P3 i
  j) |; x: f! @+ ~; n# I7 _begin P_creation arriving procedure& q) \8 x; a! G6 s2 x# x# h
    while 1 = 1 begin( [4 o7 |& _4 V# Q' [
        wait for V_interval sec
+ c7 d' _2 J- Y! O/*V_interval is the interval of creation of loads, fixed or random.*/+ k; l% }0 T' g* q, c3 H$ V* t
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)1 ^! p1 r+ _# P$ T' {! z
/*V_p is the parameter of the distribution.*/& n3 n0 s* k, z+ P- A* l2 Q% }
    end& X$ c3 b- i6 k/ ~
end
2 i* `' a3 z% A, {0 {  s$ a) @5 _8 p% {  f# l- y
begin P_process arriving procedure) o* [: ^* F" G: U
/*Any process the load will be in.*/4 k4 ]6 m6 H. O& ]4 `/ b6 Z
    print "1 load created" to message
: u6 o+ X; q# {5 t( K: }, O8 Yend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答( F( g5 A( V. v) e
不过有些地方不太明白。# f0 X5 y, [: p1 l  D
(1)L_null 和L_load 是什么关系呢?: t" P  Q8 l) m& M; a! y! R
(2)create语句出现了两次,会不会重复呢& n3 }- E( t  A% O, z
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
" V% |4 w, y4 j% ~& B) h谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
7 L, c0 \" k  `# N因为我要产生3类load,所以代码是:
: \2 Z: i5 O3 w3 D7 E' [4 Ebegin model initialization function1 @. R/ c+ x3 W. t& l7 u9 F) G6 N& Z
create 1 load of load type L_C2 to P_Creation2
3 v* ]: q  A4 w  u create 1 load of load type L_C3 to P_Creation3
) w9 K- d6 Z% q create 1 load of load type L_C4 to P_Creation4! D. v; j7 g* v$ ?1 g
return true# X' n! b8 w; U" {" Q% e
end7 Q9 B# L* X9 \% u$ c
1 L6 |' I; Q0 K/ H! s+ ?' {9 ?$ Y
begin P_Creation2 arriving procedure& L- z4 X" ?  U
while 1=1 do, [$ o  `* u9 S. _- \
   begin
+ ?- x( x: r9 U$ @( J0 M( |     wait for 1 sec
* W# `  \6 H1 _( j- q$ f     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)- a% _+ y* Q, Q
   end  _/ z/ H" F( Z+ J$ X; z
end6 F% n4 }* V3 M- h8 X& c

. w+ l0 f- G8 r2 W7 Z begin P_Creation3 arriving procedure
' I" t8 p) O* w6 |# H while 1=1 do
' o0 q8 I; t9 V5 Z4 r7 [9 Y   begin
- P3 I4 O1 E5 E9 g+ @( g- s3 f- I     wait for 1 sec
7 |% o* j4 l  I) F     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
2 G/ l7 I- c5 p1 h+ i* S   end
  q% A: h5 \9 C: m+ h end   5 m# y' w- b5 x9 B, Y; f' Y) t
, b% F( U* y0 p" [# o+ j: |
begin P_Creation4 arriving procedure
0 q( L: P1 p9 V: l8 c6 ?, } while 1=1 do
5 |2 H6 E2 a/ o   begin. X& N  m/ Y% a8 P! G
     wait for 1 sec
, y6 v# u5 X% O  L  Z- ^' p/ _     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
7 [; a/ n9 Q5 J' Q5 x# O   end) k' \- ]+ s* b' c. g2 u
end
4 q5 N4 _+ H% b1 c0 N$ G0 i7 U8 _% c( x" ?$ O
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?! c' k' Y# ~8 G3 L& y4 G
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);  C5 ?2 y# S- @* }
begin model initialization function# K6 t3 e3 E6 C0 b. Q; w
  create 1 load of load type L_null  to P_Creation2
( C$ F3 @- O8 z1 S/ R  create 1 load of load type L_null  to P_Creation3
" E' Q3 B) [" F  create 1 load of load type L_null  to P_Creation4
; \- P6 h; l" V( ?# U; ~" l  return true : F- A4 f0 U2 A) Y4 }( M: V
end8 x* Z0 P7 F: y) e6 M
# u8 f$ j# E8 T
begin P_Creation2 arriving procedure, E9 y$ ]/ u- k1 F* H( n  ~9 I
while 1=1 do! J( u% n. U8 M' j( f
   begin
. c4 t9 L( m! L4 W3 F) D     wait for 1 sec
8 F! x! y  r6 a, h     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
6 W3 j& {8 C5 c6 ~  c$ e   end
' u" c4 g6 X, fend9 K5 h; V/ j* x5 m) n
  l4 n4 Z5 f+ t' L
begin P_Creation3 arriving procedure$ X) ]7 i7 u1 k6 D
while 1=1 do
* Y! q! n( E- V  Z& q" |   begin! z9 D  J4 W0 k' _3 J
     wait for 1 sec, W7 P' s* s# y' ~
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)7 @' S: I8 T2 q
   end0 }3 V& x5 @: ~! K
end   
2 R  @/ Q- s! B" h
: e7 I, q5 D  `& M1 tbegin P_Creation4 arriving procedure5 E; k1 Z  A& h" t
while 1=1 do
* Y# k& s9 `' f( `   begin
$ E# r0 c6 d/ N     wait for 1 sec' J  Q! J9 ?: F/ Q9 q9 O# ~1 p+ }
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)$ B# m) D9 n1 I/ b  ~
   end
( i. ]4 ^; o/ I0 r6 Fend
+ {" k+ Y; j& S2 w+ D1 V
5 |- ?& |4 L6 r4 a但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
+ w" x! H" U0 L$ v7 e' C: k$ }7 ^如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
7 [8 m, @/ _6 U) d1 ^另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
, l: C5 s8 d) j/ d$ |8 ]% c尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。; Q! C, \% G% B# F5 E6 l& p
====================5 _; i  D- m. \8 C) ^9 [
我试过了,终于成功了!!!!!!!!!1 y' S& D6 b( y+ `
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!! p7 A- b+ a) s
请版主给两位仿真币!!!!!!!!!!$ F  ]9 ^. k) o8 b4 A4 p* \
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-24 06:37 , Processed in 0.019305 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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