设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12019|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
! m8 P# b9 O5 A/ _/ h如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?. @+ O8 z3 ]2 O' H0 E3 J
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 1 h! B, Q5 C- \6 N
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);% r  u/ B, z0 i* w0 J, n: |. q
begin model initialization function! O2 l7 Y- ]( v4 I
  create 1 load of load type L_null  to P_Creation20 [. E3 Y. X7 ]7 h3 Z
  create 1 load of load type L_null   ...

' ?; q1 A) m6 a; }3 I6 v$ @! S7 j6 K- r. g" P/ T& U8 G( s
也许是模型有问题,也许是软件或者系统的某种bug。4 a: N0 R/ U+ n7 W; w9 L

- k/ O4 A6 y6 w8 p" k- R尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
6 [. v8 ?8 c+ q. n; P+ {6 K下面的代码不知道能否满足你的要求。8 i' k! V# v) {/ I
: O  A; B' j" [7 P2 y: K6 k
begin model initialization function
) |* F; A' N+ M; @/ t    create 1 load of L_null to P_creation
; k9 E9 _) v6 O& H/ E$ _/*L_null is a load type of which the load create loads for the model.*/7 j' ^. y7 }% I- [' |: n0 b
8 o8 }& h) x* _6 h
    return true5 M) x* N2 A) b
end  W$ O+ U6 k  W4 ?. c
" X* y. m% @8 ~
begin P_creation arriving procedure$ j) \$ h% i. O+ k: [4 Y9 o
    while 1 = 1 begin8 s; ]$ H. ]6 a( j# J4 v
        wait for V_interval sec
( f* o9 D3 p7 I; V8 `/*V_interval is the interval of creation of loads, fixed or random.*/
* n" s3 n+ y7 _- |        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
8 [2 k2 ^7 G* r1 j. Q/ s/*V_p is the parameter of the distribution.*/
$ f/ Z8 i3 L7 c1 K) l5 e/ ?    end( @0 }  N9 {/ Y8 B9 E# N
end
7 h$ `, U5 U4 m, C4 B" Y) Y5 @+ q- L  Y: V% D7 C" y* k! C6 h
begin P_process arriving procedure! M& h, T/ E! D$ m) j* v% j
/*Any process the load will be in.*/
! V7 o* K( N8 F- O3 [( ?    print "1 load created" to message+ B9 U% c0 C' H- N$ Q
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答
5 ^$ D) z! F6 r( s( w5 H; A8 [! {不过有些地方不太明白。
* V" B; K% ~8 y(1)L_null 和L_load 是什么关系呢?9 L# x0 I& x6 Y: q$ K7 t! P7 d0 l
(2)create语句出现了两次,会不会重复呢- l+ k+ C9 u6 g9 _
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
/ D, F; o2 i7 B2 ?* c谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
9 ]% n2 B5 }" _+ Q3 h, ~- E) r因为我要产生3类load,所以代码是:
+ D" G5 {* ?: e' [# ebegin model initialization function
( Q0 u7 j% E$ E create 1 load of load type L_C2 to P_Creation2
3 H( F$ A5 {. B& a+ A5 ^& s" Z create 1 load of load type L_C3 to P_Creation3
6 Z/ Z. W+ D( a7 W create 1 load of load type L_C4 to P_Creation4
1 d7 M- r9 L( D- a return true$ d5 B! _5 e; T) o- D$ r; F- H
end
8 M' O3 ~# [( S" Z( K
: e# \/ M& A/ r+ l2 [4 K/ {# B4 t# wbegin P_Creation2 arriving procedure
( Y: c9 e! z" d0 W- N% |7 k! ^ while 1=1 do, N% w7 M" W/ V- c
   begin" C) f! c1 C4 d
     wait for 1 sec% X" D+ s" G4 w
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)3 u" I" G$ a7 k+ Y5 I: p7 c
   end9 y0 M0 A/ H& B  ]; t
end5 @8 t) W4 |6 R9 M# L
4 b  {4 }5 W6 H# e
begin P_Creation3 arriving procedure' f) A+ V/ C6 m3 T4 }
while 1=1 do+ K  ~$ z3 C/ W5 _" u# v1 S/ p7 c2 K
   begin
9 G6 w; c$ i. N; |8 u2 O7 s     wait for 1 sec
3 f9 {" h: N9 b& q1 \     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)" X! _$ `  N9 I
   end& R7 W0 w* Y! Y# U& O
end   
7 d3 f; ]  ~) T
0 t* b  s$ h/ A+ ~9 Mbegin P_Creation4 arriving procedure$ d) M4 [9 R4 S# _) \/ p
while 1=1 do. a' X9 Y) E( S- P
   begin$ |9 e7 A3 }- e/ |+ J* F
     wait for 1 sec
5 C9 L) }1 P, W: B" k; z     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)$ L; C# [% }# I4 w, v2 q
   end
8 e, T* b3 b  s( ]; Z5 f end" l3 Q% f0 K+ s

4 l2 H7 A+ |# n& o可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?0 U% R$ G- n. c! z" ~
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);3 w6 {1 e2 @4 O9 u
begin model initialization function
" V4 b4 c6 Z5 M  create 1 load of load type L_null  to P_Creation2
* r8 r9 [& K2 M1 J1 A' x) y3 f  create 1 load of load type L_null  to P_Creation3" |+ z& D" w) s# T* K
  create 1 load of load type L_null  to P_Creation4+ V6 g0 |8 [% H
  return true
: a% s' J- F  C: E: i! jend
; \+ L4 |) O. d+ \; }- }- L) N8 ^' u4 D# K- C" ^2 X
begin P_Creation2 arriving procedure% ?+ c" ~& h: O6 i4 ?, Z/ M9 a% y
while 1=1 do
1 Y+ {4 Z4 j4 Q* Q3 [$ F8 d   begin
# J7 v. X& }7 v5 j' |     wait for 1 sec. W% b5 m3 a6 B* b. L
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
1 `/ }" H9 }$ \1 D! W/ `   end$ j3 d6 a7 v$ ]+ n2 p8 s
end
4 n8 R' R! T" s
4 g8 ^6 N# M, xbegin P_Creation3 arriving procedure
& g9 e6 z+ F5 R% U' ^7 E9 R  ?& Mwhile 1=1 do( `" g& n) o, E
   begin
" ?4 Z* o8 o0 S     wait for 1 sec7 P. p, A0 o4 X" t7 @- R  F% j6 J
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
, N, {9 K0 k0 T6 l; t. |$ g   end
3 d! Q4 {3 {0 B5 J. o& fend   
8 \3 f9 H7 _' ~/ N7 M, x" K0 Z+ \: J
begin P_Creation4 arriving procedure
* n/ n; n# r( b3 g9 I7 Xwhile 1=1 do
( x' W  j  R8 F% b$ j$ S   begin
0 Y9 I4 w+ p! {+ I; ~     wait for 1 sec4 f8 K; n- ~8 V. o
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
" n: _7 w- F1 J5 F4 `/ M   end
! M+ r  }* q  {end
) T& V! M, `% @9 ?' y9 t- S3 {8 r. ?5 i* x" T# I
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
( T! Y( A% }' E+ n+ s如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。! `9 U* Q2 B) `" J, d
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。" [; n6 ~7 J/ H6 F
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。$ f6 L! w  {- l; c  I/ E9 B
====================+ q1 T" [1 F7 t( w  b
我试过了,终于成功了!!!!!!!!!
4 L" S* B, X* D# j2 r这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!  _9 b1 ]7 `5 W, b7 M2 ^
请版主给两位仿真币!!!!!!!!!!. V7 @. Q" F) b- L4 j4 X! B2 e
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-4-15 00:42 , Processed in 0.015066 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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