设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14219|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:( e( t* b. r9 t5 [7 g6 Z( s
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
( V. u% k( F: k! S4 s7 t谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 * S5 X$ [7 ~7 S* i4 Y
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);; U8 Q1 I) D3 m7 ^* u8 ?
begin model initialization function
, k/ Z7 Y5 C4 x1 z5 j0 g  create 1 load of load type L_null  to P_Creation2" C0 k3 }) G+ X3 ^0 o' A7 s
  create 1 load of load type L_null   ...
0 D  F4 S2 y# a; U+ [

1 k* u/ ^7 M* {. x也许是模型有问题,也许是软件或者系统的某种bug。- i7 E# I6 {" A# t
2 K( h# n: q7 p! @( j
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
7 a, B5 j" W; @: Q/ Y0 V5 s下面的代码不知道能否满足你的要求。
3 F. o' C: r2 }0 V
/ _5 K/ h5 |! \' J0 z9 e1 A2 Qbegin model initialization function
4 ]- P0 y3 R! u$ ]# H    create 1 load of L_null to P_creation  x& h6 ]- Z" v% N' q1 d& p3 T  K
/*L_null is a load type of which the load create loads for the model.*/
+ B& [' \  X0 f2 o4 Y
; z- x. ~% r' B, N    return true
/ m3 Q+ n7 [: P3 j4 h  F$ h) v+ I4 lend2 |, m0 T) k& q6 ~, m
0 k! ~" Q0 g0 u) G* C' d* c. X3 j
begin P_creation arriving procedure
. g  I: C& d2 |; I    while 1 = 1 begin2 P! L0 c- e' U' f$ i- {- `/ _: e( j
        wait for V_interval sec
, ^# ^- t" c1 q$ _1 i! n/*V_interval is the interval of creation of loads, fixed or random.*/
3 n' l) _+ x8 t2 A5 F0 a        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)  n/ K# E+ Q+ P( o# _
/*V_p is the parameter of the distribution.*/' Z: {4 `; A- E* H: @
    end% X$ Z4 ^8 u% Z% o1 G
end
$ {# O" a# X+ w" [8 }) C3 P$ `# [) J( Y
begin P_process arriving procedure
- q+ l( i. N# G* O* ]5 b; b/*Any process the load will be in.*/2 A" k7 C1 U5 w) N% B% H
    print "1 load created" to message
4 g+ e; B5 E% dend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答0 B1 X4 u5 ?# G* t3 g
不过有些地方不太明白。
% L2 p1 [& e9 P* ~+ X0 f4 H(1)L_null 和L_load 是什么关系呢?6 J8 Q8 j# h. A- F
(2)create语句出现了两次,会不会重复呢% F1 @& R8 y3 t
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
+ n7 o$ z$ c1 p6 s谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
3 i$ _" q' S- H* b3 H8 I+ w因为我要产生3类load,所以代码是:
* g% o  l3 p' H. y' C1 O' I2 a7 o6 Wbegin model initialization function2 M* y# [# t% [5 ~
create 1 load of load type L_C2 to P_Creation2
0 H5 o% c5 n5 F3 n create 1 load of load type L_C3 to P_Creation3
' |, Z5 z* m% Q. V4 @/ K create 1 load of load type L_C4 to P_Creation46 j# _: y" f3 s  D5 y2 {* Y" b2 T' H
return true9 E  [3 F! _* i2 ?3 W* M' N1 P$ _
end
/ N! {1 X- w& B
9 k+ I9 t2 U4 f/ Fbegin P_Creation2 arriving procedure
# n* |5 W1 d$ C* [8 M  Z while 1=1 do
5 l( L" K: c0 l2 ~- C8 F- a   begin
: r, N6 h! F3 I5 F+ s     wait for 1 sec" ~5 r: u" @- c# V6 J6 b8 y
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)4 f- x& I+ P/ M& k
   end- ^) `* G1 |  a& }, P+ c8 n
end  h4 V2 C$ C* K  g: \3 Q
3 J5 Y6 g% \, D: z; Z! t: b( k
begin P_Creation3 arriving procedure
- y: _" s  o" b4 M$ B while 1=1 do  f. H+ U# s1 u+ h7 Y; d7 \  {8 `- J
   begin
6 C: T/ ]0 s+ ~* q1 |# C1 b9 N     wait for 1 sec
# Q: Y5 h9 \/ Z; x$ V     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)  q# G0 b% W2 i$ F) v2 z5 s
   end2 V1 l; |; G. K3 o  Z
end   1 X1 Z( B( ]" }' V/ _4 e

. e" z  z9 Y) P( m& }begin P_Creation4 arriving procedure7 U- S! _4 ]! k" n7 ?
while 1=1 do
/ ?2 i& r( X: o* {& Z   begin
* H1 j. m; Z- K. ~0 V; s6 a2 \     wait for 1 sec0 L7 s1 l: y3 W4 t5 J
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)+ L) x7 M1 Z# K9 J# _
   end
8 I# b% a" x- Y$ q9 {8 u/ G  y: M end3 {# J9 _. z/ L+ T. }8 F" y" t& }

* V# B7 _" T# g7 y; g可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?* P6 e* z9 D+ x7 S8 L
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);" P, m6 v8 u1 f( f
begin model initialization function
' _4 e1 P; V' X# }  create 1 load of load type L_null  to P_Creation2
. _& }& I' p" Q- w  create 1 load of load type L_null  to P_Creation3
9 Y' A2 m7 B, P  create 1 load of load type L_null  to P_Creation4: ^+ T7 t3 D6 W2 z
  return true
% e. D- g4 F- Wend
: m1 f* m5 d* K7 z- V% W5 g; x& {& C9 L7 A( B, I* K' [9 z
begin P_Creation2 arriving procedure
+ b& P: b. i1 Y! W  v5 b( z/ [while 1=1 do
& F( Y; \3 @( |, t( x   begin. |  \' ^- Z- p. D4 ~
     wait for 1 sec1 K' V% q+ I& X8 k- j* U% Y
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
7 X  F7 j: ~) z  [3 D$ [3 {   end
5 C# J+ W; I0 v4 S# k( v) A! l- Qend
% [! W4 `- h1 W7 v3 t
( J: o; l2 b- H% ~' b1 ~begin P_Creation3 arriving procedure
' U  _7 F* Q1 P7 q) Fwhile 1=1 do
9 L, H5 U# A2 V0 R: }( ^* o   begin: W  j8 n: i6 {  u% d4 h( p
     wait for 1 sec3 J4 T7 t4 ]  T
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)( V& b; l# G2 l$ Z7 x1 U+ J
   end
$ u6 {6 q7 q& L# \end   2 H8 [$ u) m% `" @
/ R) G3 y/ _: @9 d
begin P_Creation4 arriving procedure7 d' k& C, \' j
while 1=1 do
! C2 s4 c. V9 T8 E   begin
! r$ U. j. A6 h6 q& h     wait for 1 sec  L& _+ p2 n6 m2 n2 A
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
: w  x" v3 x9 q   end
8 X3 S! O4 ^" D! J$ L/ aend
& F" F' A' F* K) ^) @" I
! X9 Z- L$ j: G& ~+ w! e但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。4 t; f* c0 r9 f; O. j3 ]  k3 p# q/ `
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
* w! I$ g, B% x) f0 [另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。; u$ c% a# R# ]
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。5 Y4 r2 T) m; s# [; R: m
====================
" _8 X2 `& c9 l( m, H5 v4 j5 @5 w" ]我试过了,终于成功了!!!!!!!!!; V: V/ S8 _$ U0 j! G- _" Q$ x
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!" `# }5 p* d5 A7 Q& t% G3 L
请版主给两位仿真币!!!!!!!!!!
! ?7 v( H- ?6 \" `9 {5 Z  Q! j再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-30 03:48 , Processed in 0.021170 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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