设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14614|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
; Q% b4 H2 q2 @1 o3 z; U* y如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?/ n4 X5 @8 w( b0 ~! i7 `3 ~& @
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 ) ?$ z; j% `$ Y8 h4 H
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
7 Q8 @2 g" F, Abegin model initialization function' u2 S! c8 \5 l: D
  create 1 load of load type L_null  to P_Creation2; W# w# t) c* F9 B2 E; A
  create 1 load of load type L_null   ...
$ ^; O; L& U* J8 B7 {. j8 b

4 M8 {  z" u: m6 ?8 X0 @- Y7 a' D也许是模型有问题,也许是软件或者系统的某种bug。
+ V, o# V) y# `: ~" R& v: x% g" t4 t
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?2 A- \2 B" l% m' X& o% V
下面的代码不知道能否满足你的要求。- r% X" {! n) t

% r) P, [$ M7 h, w8 Jbegin model initialization function+ Y" l8 E- H; b! m2 B6 A( u
    create 1 load of L_null to P_creation
% P3 C- {( @& N. N3 U/*L_null is a load type of which the load create loads for the model.*/
, O" E' a9 v! b% N& @- G
8 y' ?4 Q9 N0 l+ n* k, b* r" l    return true6 u! s+ M9 d* D# B% A, q9 w
end
+ y) ], z. S4 j: P7 i* i( _& V% U" X5 s( K4 @' L  M% p
begin P_creation arriving procedure
. v1 Y9 _3 R' T: s0 V5 j) U' L$ _; V    while 1 = 1 begin: h! f' a4 O4 B9 ~; A6 k
        wait for V_interval sec
, K. t+ t+ H4 M# E# }/*V_interval is the interval of creation of loads, fixed or random.*/
: B& E4 G" t" e) |7 C( k        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
) i$ A: q/ Z+ e/*V_p is the parameter of the distribution.*/; Z* Z. ?' H8 ~7 J0 t2 Y9 N" \
    end! n6 P" |2 a2 N' z. f' U1 ?
end
7 G! q1 d/ w* g' g2 m. n& R5 M
: Y" z+ _1 S% u* N/ L9 vbegin P_process arriving procedure
) h  H" o; F% Z! U. N! x: `" d/*Any process the load will be in.*/, K9 r& i# L" G$ m. v& A# A
    print "1 load created" to message& W+ m  K) ]" U2 I& U3 G
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答
; j6 Y5 u; o1 C* E不过有些地方不太明白。
" h# f- G1 P2 F) N(1)L_null 和L_load 是什么关系呢?
  u5 A1 X  e$ p, f+ ^" [(2)create语句出现了两次,会不会重复呢
4 `2 f& [% n) z$ q; _我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
, i7 O: p! T$ E7 p. c" z3 c7 M2 W( b3 Y谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。7 o; X: h6 d, a0 x; G+ }2 G4 {& T
因为我要产生3类load,所以代码是:' s. U9 M2 K* u3 \2 Y
begin model initialization function8 E4 d) {! \0 ^# f( W
create 1 load of load type L_C2 to P_Creation2& L0 ]: w9 ~, o( {  ^- H/ X
create 1 load of load type L_C3 to P_Creation3. h4 ~$ D3 C, d3 {3 P
create 1 load of load type L_C4 to P_Creation4
" V( d; e, G/ v' T& ? return true3 X7 K1 ^) N! |7 S& T" ?: l7 e
end& f1 Q4 u$ P4 ^$ ?2 W2 [7 b

  R  A1 u! t: @. x3 `) X! n; A$ Fbegin P_Creation2 arriving procedure# X4 b8 q# T! q- u
while 1=1 do4 E8 y3 Z3 h7 O& i
   begin
( i# W, Y( F) R. ^7 b0 }$ @( q     wait for 1 sec& a" K, d, S) {/ B
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
4 ^& F: q  ~  {: F  T4 p   end
) g1 A7 I2 l- J- A end% {1 x+ z) n9 P" O$ s
! j! i( ~' H4 O  G, N8 @" o
begin P_Creation3 arriving procedure
+ g2 L( ], G, U% }: \ while 1=1 do
5 \+ p  C" I/ z$ h: C   begin3 W) r: J, n; s$ J+ A- [# o
     wait for 1 sec  r6 `) k, `; R$ w- l* D! l- z1 k
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
: S' x2 p$ I1 }0 g% ^$ l   end
  n' S' X  K; z& A4 |/ P- S! ] end   
; k# `+ ?7 V! \1 N. A+ n* L" A& M9 r
begin P_Creation4 arriving procedure( i* |& Y3 P- t% x- N& L% C
while 1=1 do) K1 b" N2 ~7 e" V: k/ `
   begin
" ~" T: g) m$ W% `6 K# M     wait for 1 sec! J7 s8 [$ M3 w$ \1 ^- E4 B0 Y
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
( N/ u2 E4 M0 L   end3 \# E5 u( L2 {
end% r# v$ f4 ^9 Y1 P* [! n& _) W
$ `5 n3 I6 F0 d: e6 F
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?* m! t. J3 C. O
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);$ J+ h% M+ z9 A& P2 D+ e0 e* F
begin model initialization function' ~$ T2 X+ O8 o9 Y
  create 1 load of load type L_null  to P_Creation23 G/ v0 ~& p( K( k$ s
  create 1 load of load type L_null  to P_Creation3
7 W$ O% W. m# D  create 1 load of load type L_null  to P_Creation4
7 c9 E) W  |+ u; C: G  return true
9 e! d6 b# i9 zend9 l' [7 }  F: _8 m9 o" ~

1 C5 }8 a5 J% F+ m7 rbegin P_Creation2 arriving procedure2 c9 ?# R) h; @7 ?
while 1=1 do
. t$ k7 J4 Q9 o# @   begin" T* F1 O* H8 _* b7 a+ ]5 `' T$ G- a
     wait for 1 sec6 S) [& C; c; |# y( w* d) O9 u
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)8 _( K+ d( f& S9 h- g
   end" D) Z5 a( w3 _8 W7 K% {; k; m4 v
end
4 A- p; Z  }, B# B  V& ^6 }2 |; ^1 A3 E7 `7 U3 K8 ^1 A8 e- K/ y
begin P_Creation3 arriving procedure$ Z" V: r0 s# q1 b3 _3 E
while 1=1 do, q" g! c" m' v% q* O* k
   begin9 D4 a* c. }7 j4 ?1 _6 i  X2 c: `
     wait for 1 sec
+ g9 _6 j; I$ a- w     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)) |- q+ ^% I" j! ?7 \& [& t
   end
; G% t9 [) r/ z* }2 {& A2 W1 J0 Uend   
$ _) A) B) @0 K9 y! _# x6 `/ a$ i6 U. J& y, p& c
begin P_Creation4 arriving procedure
9 y, K0 c$ N. ?: Mwhile 1=1 do
/ G- G' O, m' v+ W6 T& x, l   begin
) v! m0 H6 h2 {; P6 N8 t; D     wait for 1 sec* P/ I/ r- |# I; d8 W9 Z
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)! {; ?- w5 O# F% P6 G8 Q6 O
   end' b- k7 c8 @  u/ x
end( A2 R: ]3 H1 N+ _3 b
/ g7 {2 I$ a: j4 ?) `
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
2 ~0 O0 ^1 z8 @: {) I; H2 f如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
4 e0 Z  s2 \( k, z' }! @另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
: c  B2 Y0 S+ {4 O# T% L尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。) @# Z! `( G/ C, _
====================' S2 [/ `+ d2 C5 p- R# C
我试过了,终于成功了!!!!!!!!!
: F  X# U) n; c$ c/ L# C这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!. k0 T: ?4 _9 v$ S( `# O& B1 q/ i
请版主给两位仿真币!!!!!!!!!!- ~) u5 l! d  b& a! N  }/ |
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-9-22 08:50 , Processed in 0.014767 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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