设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10313|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:( c& @  Q: h" t  D; \: r
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?( Y; p- S3 G8 v; H% z4 z. W( \
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 0 y+ l. ~, e( {8 H& M/ q' P
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);0 Y, b* h2 T" o
begin model initialization function
) j/ Z: x1 i1 G% p" Y* W: [! h; _  create 1 load of load type L_null  to P_Creation2
# I5 H, q1 o$ S- m+ X3 H  create 1 load of load type L_null   ...

/ F9 g% m# D) E7 |! ?5 r8 p1 G3 i: w' V8 l# L# @! C: p
也许是模型有问题,也许是软件或者系统的某种bug。
) l* j1 m+ u1 z' d
. B- ]0 `, v8 N: c& d+ P尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
+ m" G% y. d/ q% b4 M下面的代码不知道能否满足你的要求。$ e8 K/ i+ S+ _7 P
9 C3 n. V! s: s8 j6 H
begin model initialization function
, {9 X5 p/ }# X0 k; Q' H/ }( C    create 1 load of L_null to P_creation4 L. K! v- S; r6 e% p% x! S
/*L_null is a load type of which the load create loads for the model.*/% W) w: I$ R* h5 w  b8 n

; |( k* F4 P3 z9 z$ v/ }    return true% q' w- l# n/ V! l4 _6 Y2 {
end! R& n  `5 O& f3 v5 m+ M1 `
4 d, q2 \" |; f6 x! ^
begin P_creation arriving procedure
& }( T# M1 \. ^    while 1 = 1 begin1 `5 x3 o( ^) q2 I' H
        wait for V_interval sec
& _4 ~: V4 N6 F8 F# U( q% }/*V_interval is the interval of creation of loads, fixed or random.*/" a3 Y1 d" b+ H. y
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
) Z7 A9 T3 G8 i7 u' y/*V_p is the parameter of the distribution.*/$ j  M+ d6 K. I3 ]" O% j: y
    end
( N; r$ {" `; K9 f* V& [, |( Xend/ c& M) T: m# H  B. v

+ Z& S& h7 w- X7 m+ O; g* Rbegin P_process arriving procedure
3 E1 h0 y* L- C* N7 e3 |# N; z8 h/*Any process the load will be in.*/4 C& K5 Q5 u- L9 w
    print "1 load created" to message, c# O: T7 ^, g0 j# M
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答! P2 x) z" @; y4 }) a
不过有些地方不太明白。
! R) h# b6 }7 G! i5 [1 I4 V(1)L_null 和L_load 是什么关系呢?) I! X. \  d# N3 n; s$ q- _) L
(2)create语句出现了两次,会不会重复呢( `5 i) |' Z7 T2 K# q
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
$ M5 Y0 A$ A, k4 G; p" H谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。" b2 @* M( O$ ?' a
因为我要产生3类load,所以代码是:0 @* U/ v  y7 o3 ~! m: a
begin model initialization function! `9 K, D: Z8 M, _* g
create 1 load of load type L_C2 to P_Creation2
' M- r3 K2 n: S) I create 1 load of load type L_C3 to P_Creation3
* |& @& B" q! d* A( ]  j5 R* U create 1 load of load type L_C4 to P_Creation4, {3 O4 W& i" @! ^( x! E7 _
return true; k5 L( w, I  u1 Z. X" O
end9 }# {- N, S: b# o8 s- h$ a/ h

- q4 p. p0 @+ Q$ W* k/ d& sbegin P_Creation2 arriving procedure
( m* u# L- [( k8 y: N while 1=1 do" L9 ~6 g+ v; }4 ?5 ], U
   begin
$ ]3 z1 }1 d& e: m7 }. R$ i     wait for 1 sec# f3 R/ `/ C) r. E, M% W
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)  Y- g& y5 h9 h  S$ I. Y6 {/ T& W
   end9 G, \5 @4 J5 s7 E
end3 D/ h3 x7 m+ t# x

# H+ V; l$ y6 z& C; f begin P_Creation3 arriving procedure4 C* t8 J3 F/ ?; _4 U* A0 Q4 {% M
while 1=1 do9 V0 N9 T* }* j, R
   begin5 |5 }. Y( o" C+ M3 t
     wait for 1 sec
" P6 I- x+ Q8 F" d     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
4 Y  W9 `" g1 F8 n) I% e2 O   end
1 h. q$ G4 Z, H end   9 l! w& O' E8 @2 |( V
6 o6 E+ O7 K* R" Q, E3 T( @
begin P_Creation4 arriving procedure
" S! Z! a  l" L8 { while 1=1 do
% q" a) n( {4 i0 N. Q! J" ?   begin' A1 x3 H+ H5 h# ]1 u
     wait for 1 sec
6 N8 e% E& B" G$ J/ s8 A) k     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)/ x1 i0 C4 x9 }; c
   end( I4 [* d* `2 S8 p. u: ~
end% z/ G4 b: @- T) ?

& s' R. g3 v3 p- t可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
6 e/ K; L& l, A8 X* M现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);1 U, V) s& C, l/ Y
begin model initialization function; k1 u+ m) @4 c2 c
  create 1 load of load type L_null  to P_Creation2
4 h8 l5 W  B2 g$ d, }& y; P  create 1 load of load type L_null  to P_Creation3
) S0 _+ H' C& |3 G9 J6 H  create 1 load of load type L_null  to P_Creation4
! c+ R1 B6 d+ q' e, P/ s  return true + d; e. o3 K1 w8 y$ q, g; T
end* D- t) D; H" [+ t$ K

# T7 U5 K/ A# G; {/ d- s) o+ w2 ?" Rbegin P_Creation2 arriving procedure2 l6 i% a/ T5 n
while 1=1 do. v( a/ L8 {+ O8 v
   begin5 J6 c  ?3 i+ E+ t# F, M2 ~
     wait for 1 sec; Y, X3 x+ P' c  S
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
! x3 v# h- S4 L. Z9 L) |   end4 ]/ w# [% f$ p9 w: R8 q
end
& K2 E2 }/ G" t( \8 f$ n+ @" o0 X7 e  z! U0 @% i, e
begin P_Creation3 arriving procedure
+ G+ A4 q5 X  O2 zwhile 1=1 do: _7 w& D4 ~( S% p8 {6 Y/ v
   begin. Q5 J. J5 r$ g& M
     wait for 1 sec
, i8 \4 ?. }- k) g     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
" u7 D' P1 B* C5 B/ T7 b   end2 O- T& p1 {% e1 K9 u7 o
end   8 o& F3 U3 d  y% Y

# ~4 k5 j& m( ?begin P_Creation4 arriving procedure5 W2 b( u) H4 \0 u  T
while 1=1 do
2 m8 p  v. F* o+ X) V   begin
! S5 N6 s* A2 H% O     wait for 1 sec
" g1 {; w* [4 l5 L     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)$ t6 E# A1 h5 L5 A/ E- L
   end
& q2 x7 b! b- v6 J2 Y" ?end7 f8 t. S! m7 c8 Y
' X9 E6 B0 [1 _* J) ?" y( `; {5 o
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
9 H8 Z/ V' n: h如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
1 W* m4 g. y5 R- k  m另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
$ X/ M) _6 f. H5 i8 V6 r% h尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
% y6 N( ^2 A7 f====================3 b4 Z6 V% D; g# f% P  M: ?* q
我试过了,终于成功了!!!!!!!!!) `- G/ P) P; v
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
# L% u, r$ O( |  Z0 U* P8 O请版主给两位仿真币!!!!!!!!!!
: k9 B6 Z3 j4 W( X1 O1 N$ f2 j再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-11-18 15:44 , Processed in 0.019647 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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