设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11278|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:" n- C) S. w( k( A
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?1 z7 D& k% x. f; D* e2 @2 Z
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 & a: z! R2 o4 Q% r) D
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
+ g. x* T: o: [8 V1 [4 }begin model initialization function
4 Z8 ?& }' t- E. i6 L  create 1 load of load type L_null  to P_Creation2( U5 _* D3 _- g% u+ e% P: \
  create 1 load of load type L_null   ...

& F+ F* [& C6 ~/ m" Q! N8 X% ]+ {. J, i0 [6 R" A3 d
也许是模型有问题,也许是软件或者系统的某种bug。
% Q6 S3 P4 ]- w+ x% C7 O0 L$ A! [9 H$ Y* \
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
6 O1 L7 o/ t% d5 u$ _1 D& a下面的代码不知道能否满足你的要求。
& f5 N( ]+ X: w: a2 j$ P- y9 c& Z! ^4 V3 w7 @7 {- X3 T- \
begin model initialization function6 x3 K$ V' G+ h; C; ]; e  c3 k
    create 1 load of L_null to P_creation
- d& k0 [. ^+ p% M* l/*L_null is a load type of which the load create loads for the model.*/" L# V) d# }  t8 S
; j- P, ^$ \: L2 `" o7 W- b# q
    return true9 q+ O8 G9 L+ x0 v* o& r* y2 d
end" j6 l$ ^: ]6 Q/ Y6 U
0 r7 a2 v5 Z3 w) H
begin P_creation arriving procedure
5 S' p7 w' B8 I( F/ w9 A3 |" m    while 1 = 1 begin/ n8 E" V, x7 U8 K" `  @
        wait for V_interval sec) E4 ]9 K4 _6 S, e) O
/*V_interval is the interval of creation of loads, fixed or random.*/
8 D. j& L0 D$ G  ?        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)/ X0 ], T! `0 y* ~4 b
/*V_p is the parameter of the distribution.*/
! d% w- h& S6 ~$ _0 x( W! T7 q    end5 v/ G* o* U) j2 C3 \0 ~( L5 `
end9 [4 q( b  O4 f# o9 [

+ h' g; X( T# |$ k8 p3 zbegin P_process arriving procedure, d# ], e( A- M" _: j
/*Any process the load will be in.*/# v& I5 }. E4 x
    print "1 load created" to message
) m1 G; m# Q! Xend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答" q+ P$ B( y0 C# [; b
不过有些地方不太明白。& x4 y5 m, p" j6 C  T
(1)L_null 和L_load 是什么关系呢?2 J- I$ T, v4 [
(2)create语句出现了两次,会不会重复呢5 b: i. H% ]4 o( ~  F: m
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
2 G$ n0 {3 b6 J9 l谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。" H6 `. k' E$ {* J4 \& _8 b
因为我要产生3类load,所以代码是:
* c2 K: k; o) M# Cbegin model initialization function2 k* P# H. f7 b, z0 B1 r4 Z
create 1 load of load type L_C2 to P_Creation2/ j0 L1 I# t9 S4 D9 J6 K
create 1 load of load type L_C3 to P_Creation32 F! _9 e$ s- I- [6 ]$ q8 g( U6 W
create 1 load of load type L_C4 to P_Creation4: U0 y' B8 B1 I8 [, S* F0 j1 _+ j* c- }
return true
' s! U# e* f; u2 u; `' cend
2 b! b' M3 Y1 j6 r
$ Y8 M+ k: R" vbegin P_Creation2 arriving procedure
2 @! t5 O0 z! c, g4 G while 1=1 do# q1 V, x. f$ R( g
   begin: {- |1 j" `- h1 j2 ^
     wait for 1 sec
! W* ?/ {' I' g" T! D1 d     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
5 G2 T7 v2 y9 G" M   end# H0 }8 {2 n. q7 `& w7 w, o
end
: y7 u$ A& H9 X! @
+ A, J6 b; y9 [% r begin P_Creation3 arriving procedure" s! X# R5 q% ~3 ]5 c8 f
while 1=1 do
4 F; E# G, d2 I; N: }& o1 K% p; g   begin
& Q5 G* @# [% n9 |7 ~& q* p     wait for 1 sec
0 f  c7 {( F; k2 f     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)9 N( F% I. d& V
   end
; G! S1 a1 }2 p9 [; l+ l end   - N$ N: o* S8 e$ E: G6 I$ }0 C$ j
8 w" ?7 v! z( t5 `0 X
begin P_Creation4 arriving procedure
' Y9 A+ s2 T( x while 1=1 do- ]0 U# t, z5 K1 K0 t, q
   begin
' ~, ]# b% I  W4 q9 W# f$ p* {     wait for 1 sec
# W1 Q8 x( F2 u, o1 B6 K, v     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die), W% D3 ~5 J# b  s: d* b( v0 D
   end& J( c  f: g1 @2 n- f! Q3 P/ O
end
9 ^" h7 g) W8 ^$ m! T! c5 t4 z! m( e9 ?
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?) X/ p# T. U- |$ ]  X" S5 X
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);, Y5 V9 Q! s0 i# r2 K
begin model initialization function0 W8 s- }; A7 O9 c: ?: S3 L2 l" h- b6 d
  create 1 load of load type L_null  to P_Creation2% Z4 l$ N- ~# p; y: p" X4 K
  create 1 load of load type L_null  to P_Creation3
' }( b) b! V8 U6 D  create 1 load of load type L_null  to P_Creation4- c- a  n4 \* C8 u
  return true
# h6 M5 h: i  z+ j' @end
: k" |6 o- a% X* Q$ w) a  I* ~( T. B
( O. X- w. P7 }) L+ kbegin P_Creation2 arriving procedure
" x, i% h$ |- k+ T$ o6 b/ e1 n( pwhile 1=1 do6 ]1 Z8 E8 {5 q2 a  K
   begin, H+ h' a* B0 ]% Z
     wait for 1 sec, j9 _0 v( E" N2 C
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)% J8 j/ v' X$ t, z8 D9 m
   end
6 ~4 q, w! t. c$ L* T' Qend6 I5 ^3 y8 @: n- y  M
1 e9 `- ]2 M5 x/ i
begin P_Creation3 arriving procedure
* C$ C$ \% L; k! owhile 1=1 do$ N; X$ f* X% Z
   begin/ B& N; A) q5 z1 ?
     wait for 1 sec$ g8 A" ^- U$ J! z. n
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
* T! @+ k" o2 P0 k7 K; o7 ~8 Y   end
  {2 t3 D# y# F$ E( l1 zend   
% n: g0 d" |6 g% T" l  n* w- c5 i
/ c; @1 |! A+ ^1 b  x" v: ~& lbegin P_Creation4 arriving procedure
' V8 I9 _8 _$ p) f1 u/ hwhile 1=1 do
6 c# t: U& c  `# @( D+ Z   begin5 r3 T* S4 Z7 h9 ?" g( f! d$ ^
     wait for 1 sec: N. x0 l9 r& N
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
3 I( ?% ~2 A( t- b3 o   end; P  ?% i- d4 w# S1 H
end+ d5 ~& q/ v) X8 n: V6 c

2 z3 w' v' j. s3 G但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。2 M8 c; T! F# j! R2 |/ i/ L
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
6 n8 N9 ^/ S" I另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
# N1 h0 j) x6 ?9 v5 a& s. s; @尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
+ T4 S: ~0 }, L# b) n====================8 b: C/ ^% j4 ~3 d2 ~* a% v2 `1 |
我试过了,终于成功了!!!!!!!!!: c" u; |% N/ F. M# B+ b1 T
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!! U" f( G$ W4 p- s3 h
请版主给两位仿真币!!!!!!!!!!
% ^$ F! `0 @6 f0 P% P% v再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-2-15 15:05 , Processed in 0.017622 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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