设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11131|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
. S8 m' D" v5 l2 h如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
0 h) _, R8 \& j  R7 w, S" q. M5 R谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 ( X8 M7 P; @8 n" y3 h+ v/ S
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
, Z% j8 Q6 Y/ r  E: kbegin model initialization function
9 \- u  W) F+ ]  i# w  create 1 load of load type L_null  to P_Creation2
- q( Y0 i3 D# q& x. j# l  create 1 load of load type L_null   ...

. @: x- `2 d& A1 H' j
! x2 g% }" e5 t- |6 V$ D  W+ ?也许是模型有问题,也许是软件或者系统的某种bug。
0 c" C& d3 r& ?# ~2 d
" p/ c7 i; y3 x- T( k  f0 p尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?1 [8 W* f& T6 y( ?" U
下面的代码不知道能否满足你的要求。( D6 L% U. d3 O
& Z  I" L! |. U' }+ \
begin model initialization function& U+ x0 X8 q0 i3 l
    create 1 load of L_null to P_creation
( C1 O  d1 M$ v" ?/*L_null is a load type of which the load create loads for the model.*/0 ~5 m4 K- f+ O  _# E* `' R

" E! g9 _8 s$ U% k( C3 o    return true0 K2 N; R* s& s/ e4 o" A: Z
end6 d/ ]4 G/ ^/ d& C
# l5 H" [" F, \$ Z
begin P_creation arriving procedure% {2 u$ W4 ^8 c- T0 f: e: t/ [
    while 1 = 1 begin
/ w. A2 c$ V) I% _! }8 G        wait for V_interval sec
. e  G) z' U4 [, g: [/*V_interval is the interval of creation of loads, fixed or random.*/
7 K3 C# v$ L+ J- w$ h4 i        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
. D5 A/ A0 P" G3 E/*V_p is the parameter of the distribution.*/% [' C% C! t5 L
    end9 z" b# z$ }% z8 u; Z4 r
end
! K5 a' Q+ K. n6 C5 Q/ p8 t3 X2 ]( ^( ^4 }, n
begin P_process arriving procedure
- x1 j8 u% S* W: w; C$ q, |/*Any process the load will be in.*/
" O" n+ |4 I9 K    print "1 load created" to message* ]! ^" _2 r6 @: Y. I
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答1 v# P& j% @' O% ?
不过有些地方不太明白。! g" }; G1 L+ l+ q5 w
(1)L_null 和L_load 是什么关系呢?. v# x7 k0 u$ i7 ^- j, y
(2)create语句出现了两次,会不会重复呢, m5 R) G$ P9 p4 c3 ?2 l9 ?
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。. ]/ |; f* u, M% O6 T% h
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。4 y' ^; J  d/ C/ M' s
因为我要产生3类load,所以代码是:0 J7 o- Y4 Y5 Y2 v2 ^5 I1 A1 O
begin model initialization function
+ D4 M- o, H& h  v create 1 load of load type L_C2 to P_Creation2
, X; m" w) w8 [9 i create 1 load of load type L_C3 to P_Creation3
6 W9 @3 t9 H) N4 U create 1 load of load type L_C4 to P_Creation46 L7 p2 Z; y$ R1 _' J! {
return true( L% [% Q; H! }: Q. d7 B
end+ n% U5 ~, d$ `0 I2 d/ y; ~
0 D# Y9 _* b# m0 x
begin P_Creation2 arriving procedure
7 D, f# b; c2 o: N while 1=1 do( D/ J& G. x  O) h5 K7 I; f
   begin
/ j# [& @1 W; Q+ ~     wait for 1 sec3 E+ W% W/ P0 E% F! w. c$ O$ t
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)' j8 [7 g9 C8 h! y# \
   end
4 X% `. }( x' r& z end
3 y( e+ ?2 [0 X 7 O$ r: O0 t, }* y( j; [
begin P_Creation3 arriving procedure
1 A: K- \' T2 ]- \  c while 1=1 do
" J3 z' J! A# U( G   begin
: P  l1 e8 S; l# u+ A9 H/ f0 R     wait for 1 sec$ x9 `! e$ t# X( m: G3 P9 k' N1 W
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)2 m6 ?: r) u6 o+ _  b
   end
" Y1 F3 e5 k; J. F& O end   8 i1 ~8 s  O% d5 F
! V$ s% T, L( w/ w
begin P_Creation4 arriving procedure1 V( g5 b$ D% s4 p( A1 k: S
while 1=1 do/ h  \" }, }7 [% O
   begin
% D6 G, Q! R" j) [     wait for 1 sec
, p8 f* l0 W6 M; R" f7 L; Y# M8 F     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
; }. q2 K9 ~, N, g( c   end
+ z7 [% ^" k# s0 N end# W) ]- n  \' v- [  S
: U1 e4 y+ m  Q, }8 n! ]  `: l4 S
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
6 B3 x6 o% x6 h现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
! H; m( R( n- d/ U) F" K$ V  abegin model initialization function
# W3 Z- K& ?4 @: j  }8 B* ]- u2 Q( e  create 1 load of load type L_null  to P_Creation2
8 ^7 e7 s2 e. u7 b6 N2 P: [6 m  create 1 load of load type L_null  to P_Creation3- v" z4 u# M% v2 X4 @( W" t; P
  create 1 load of load type L_null  to P_Creation4
7 I4 Z. U' |) W* u  return true
5 d. e8 S& D  @& o( P* jend
( `1 k, b/ M+ V+ d4 T6 a2 l+ m9 V0 [; T' ?
begin P_Creation2 arriving procedure
% ^$ }8 B  U" X: v" `while 1=1 do8 [- H3 {: x! O2 k* a
   begin) W+ c1 y1 g( f
     wait for 1 sec. W( v5 J+ U4 x. @: k7 n4 |
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
( H% P0 O7 s* G; W5 \3 A* \3 i; M   end# P1 q) i# g; b6 z% U; g3 O9 O
end
2 l* `, R3 X% ?0 E1 a8 r3 b, C/ `# ?+ E* c  I9 o! K2 j7 W3 l
begin P_Creation3 arriving procedure
2 w1 M" j9 F/ h+ X* {while 1=1 do2 p3 @( a2 J7 \( N8 C- d
   begin
& I: S4 A* m) j" o     wait for 1 sec; k( g  l9 G. L4 _2 q
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)' A) I, u2 _; x# v( f# _4 e
   end  Z0 q( p1 R- _1 {( ?
end   + b6 u, w" q0 p" ^+ y# ?( [

7 v! l% ^  \- X1 E( _( wbegin P_Creation4 arriving procedure
; O+ Q" x7 k: b( f. Jwhile 1=1 do
+ r0 p; c! p8 A, Y9 p& p   begin* K. A2 }6 o1 P" D/ \4 ~
     wait for 1 sec" J0 e7 Q; L' w/ Z: f
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
" p  g# p; m* Z% K. J6 e9 G   end
6 ?5 p7 B. R3 K: K% J' T) V' ]end. T! d2 m7 {% r  x( [6 V! H; q
' f: S# y" P+ f
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
  h* M5 I! y4 u. M) v2 f+ ^4 M$ V如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
! [7 D* F$ U- ]" |另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。4 m$ C4 c0 t8 U0 x& `. {" R
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。3 h% A2 K4 E- Y
====================, a1 x" T* X. s' m* w5 s
我试过了,终于成功了!!!!!!!!!
; N4 s/ f: a2 w* e这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
; ~# V- o1 A) x; P; Q; b. ^) o请版主给两位仿真币!!!!!!!!!!& C6 M3 Z6 k3 B# Q+ I; t" g5 S
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-2-1 20:07 , Processed in 0.027418 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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