设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11533|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:: W4 a+ u% N+ |) Y1 p! A& C5 g4 o$ v+ d
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?: d( m9 ?  A0 `8 \  F/ J' S( T3 n
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 4 |' B( ?6 x. |: f. {
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);5 x3 P3 _* }! {+ W
begin model initialization function
: v4 ]( M4 E& c8 u  create 1 load of load type L_null  to P_Creation2
3 [" O7 j+ I3 s  create 1 load of load type L_null   ...

, d  E* ], j0 d3 l5 G
8 h2 R- J( ^3 E; p" G也许是模型有问题,也许是软件或者系统的某种bug。
# K2 ~- U4 T0 I- R6 {2 Y& Y. r) w6 F) [8 N4 l% J( I
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?4 I* e* [9 h1 _' s" C  i/ V+ ^5 Q
下面的代码不知道能否满足你的要求。8 ]: y! m% f  h* h7 N5 Q$ q) i6 o

; e$ n. M7 [- \, h" s1 qbegin model initialization function
5 T; c4 ~& S' x9 Y! x  @5 l    create 1 load of L_null to P_creation
) I2 Q; L) g% F5 p4 N( \) B! I! O/*L_null is a load type of which the load create loads for the model.*/
2 K7 c$ ~5 S/ F7 L( A, ^( P3 x5 h$ b- }6 J/ }+ J& Y: v& Y
    return true% v1 N% K1 V6 {3 L0 N
end
; {( r7 P9 h) C  d' t
" M9 Z) {/ P! U, K$ ]- E. i) p# pbegin P_creation arriving procedure
3 W  d; f9 \/ l) |    while 1 = 1 begin
' F* q8 Z5 v0 n$ A. C        wait for V_interval sec
) Y  [. b' _' I$ t. [% G/*V_interval is the interval of creation of loads, fixed or random.*/
$ i6 W+ f' j( K7 [9 T& B        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
0 ?( ^7 {; o& u4 x$ F, r/*V_p is the parameter of the distribution.*/
. Q  R5 f$ _4 |    end
/ ]1 q4 j6 b+ r7 s. [$ q( h) tend
1 T( I! `/ E) S7 o9 m% g  k+ ]6 ^2 f8 A' b4 f9 z
begin P_process arriving procedure
" \: a# Q( v9 ^1 @( e# S5 u/*Any process the load will be in.*/
1 U) X2 v; o( O7 ~6 ]    print "1 load created" to message" d5 w  m5 u9 }' F. u
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答
9 K& B6 a. M8 [3 O. d不过有些地方不太明白。* m/ U3 ]- ~; s+ `" l/ a; t
(1)L_null 和L_load 是什么关系呢?
% Q  L( T$ H, I0 T- F6 @2 A3 n6 R(2)create语句出现了两次,会不会重复呢
8 d: @4 B( T0 M4 W( ~* S, w: u我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
/ m: @0 s4 _6 T2 n7 i% O; _谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
" h9 I, t5 r! k  Y* u$ n% F因为我要产生3类load,所以代码是:4 G- F! m5 b6 u/ f) F  D- Q$ N
begin model initialization function
0 D5 s% r  |6 P/ f+ ]1 M create 1 load of load type L_C2 to P_Creation2
2 G' k; G. s; C( E" f1 k create 1 load of load type L_C3 to P_Creation3
9 `$ u$ g$ J- {# g- ?8 `; Z+ ` create 1 load of load type L_C4 to P_Creation4
" T, b( k4 X" R  E3 W return true
& J1 W" w4 R+ \- Z& {end+ V- g6 ^/ p1 |
4 q* }) J. q5 |
begin P_Creation2 arriving procedure
0 p+ k6 f% w4 X) M9 [5 M  h5 m while 1=1 do6 ]" o) e+ `. ?; R2 R
   begin8 _- \# \9 ^8 P
     wait for 1 sec
4 ]3 t# T3 o# P     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)& C8 S, i  D, k) _- g$ q  }& ]
   end( C% F  V4 t1 S$ H0 i5 o- G1 b
end3 k7 F( F" g) l: d6 j
! R- @8 p6 Y4 c# w: Y
begin P_Creation3 arriving procedure# Y5 r9 T- f8 P
while 1=1 do
  r, t+ e' q+ l4 K$ N   begin
7 ~) Q8 u2 T3 t" @' n) w( L2 J     wait for 1 sec
4 l& |1 k1 Q1 _( }0 D) x; n     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)# Y# I( P* y  }) N/ o
   end; b5 S! J& T8 p3 g
end     G0 j) ?/ t- L
* l5 S* Y9 k9 q7 _  F6 ?6 U. o
begin P_Creation4 arriving procedure7 V, o8 c( X+ \2 f
while 1=1 do
$ k) R; G6 D* L% r# \   begin
, p; R/ W4 B- a. N. ?0 R1 J. F4 Q$ I     wait for 1 sec+ N8 K4 A( q' [7 K: n
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)7 B+ X5 C" b( _9 z0 D+ t
   end1 `- x5 }% ~" _: J+ D0 T' K
end
& G  g4 ^# M6 Q- p$ k/ \
( Q" \+ ^: m4 X3 c可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?- p! A, c  o7 e9 l) P2 d* l. o+ j
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
# N# [$ z' H! A) kbegin model initialization function& h! f0 @  G  t. ^# u
  create 1 load of load type L_null  to P_Creation2* {$ F# A' }1 |& V
  create 1 load of load type L_null  to P_Creation3
9 u4 M" @0 f; @9 s* d  create 1 load of load type L_null  to P_Creation49 W% y/ K0 `; i% o, @: t
  return true 6 {* V# R0 l* B/ t) J4 u& R6 K
end
3 l6 K7 G( P( a5 B7 u* W- u
9 N+ Z) g6 r* y6 ]. U7 Cbegin P_Creation2 arriving procedure
5 w6 G- Y  t$ C7 ywhile 1=1 do
6 A6 V0 r# v  H  l, S) U# e   begin
! S; N' A9 t5 C$ D" I0 F     wait for 1 sec, z, C0 {, {2 C! e) _. U7 L5 z: h
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)" B8 B5 M/ J/ p' v7 V1 \* g- r
   end7 G- o. i8 Q0 m# g$ T/ q
end" w/ Q: R2 a, ^; t+ X9 i& l( U. Y
, E) j- ^, }6 ]& O3 N
begin P_Creation3 arriving procedure2 j2 G  Y* X# U2 A
while 1=1 do3 X" I4 n. j8 B; d# v" l
   begin
0 {+ e! \1 S- X( f) @     wait for 1 sec
) ~/ V  n- G& \  z- e4 h     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
+ J* h8 r4 U7 n% E& m' v8 U   end
9 l- N( a* e% j& yend   ; a' i1 G# x  V8 D1 Y$ N; H7 B

! C. j: z5 i9 n* |8 S/ Kbegin P_Creation4 arriving procedure# H  e: m$ u2 M! G" Q/ h5 p" V1 r
while 1=1 do% Y  g/ B( _9 s8 q1 {* X
   begin
5 H+ Z  Q% ]5 b8 G4 \; x# L/ P     wait for 1 sec
5 `5 g" ~5 n/ r8 w5 v! n     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
- x' @7 Q! W! Z& _$ n   end
, {; U2 J7 M' s, Wend
6 q0 ?* V5 Q9 E" y( p) z; u) c; c7 V
8 o  |/ D! j! d9 y; K$ n" {但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。4 Y3 J. s5 ~/ c4 Z, c3 y- ~- `8 G- z
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
. t  v+ n& E  e* S另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。! f" b# }5 L" x' J9 T
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。: O  v% ]  @1 k4 M, V
====================. U! w& [- `1 A$ p; {; c, c
我试过了,终于成功了!!!!!!!!!
% ?( Y8 i: L+ r: o/ q3 t0 t; A这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!' \. q  Q# @2 e$ v, ]. w
请版主给两位仿真币!!!!!!!!!!1 G3 }# M; A, G$ W7 O8 |
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-3-10 01:11 , Processed in 0.022246 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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