设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13953|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
4 M& p8 W3 y; [  j7 w" U. X. e如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?' G6 n8 `7 A5 {8 e
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 - ~  \4 ]) |. Q6 J; R
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
$ q' b# ~: Y6 ?) `) `* R+ A7 Vbegin model initialization function
  A$ F, i- I/ V  x$ j9 G  create 1 load of load type L_null  to P_Creation2
! Y0 {0 ~5 K* D  create 1 load of load type L_null   ...
. c0 K8 z* T6 V
6 H8 c! h! \8 |! I! @4 C, |( _6 l- G
也许是模型有问题,也许是软件或者系统的某种bug。1 T: }' d5 K3 N/ |0 ~7 N

1 A, |1 J$ m( w! b7 M/ W尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?& Z  Q1 x: {2 [# p" K$ c+ j
下面的代码不知道能否满足你的要求。
+ U: ?5 w9 M& k. f
2 A: o# c& O% \( @9 tbegin model initialization function
, ]/ D( Y1 X6 c; ?# ~    create 1 load of L_null to P_creation
, w* ^3 B6 l* e% j. Q# J4 B8 Q" l/*L_null is a load type of which the load create loads for the model.*/
; X( C8 h$ ^& y) r9 Y9 W8 c. v3 g% y. Y# C2 P
    return true
0 Z6 X, y2 V2 G+ X1 K* Dend/ _6 S  q) _' u3 @" I6 p
5 p3 b4 C: L# b" R; L/ A
begin P_creation arriving procedure5 e8 ^- ]- _: i1 }: E
    while 1 = 1 begin( b8 i$ x4 B3 x% G% A$ ?
        wait for V_interval sec4 Z& W% b6 U) k1 i: T' t, u4 G
/*V_interval is the interval of creation of loads, fixed or random.*/
7 Y3 Z% \6 V4 d) U        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
- \' P- ]/ Y$ G8 X0 v) d6 o* y: `/*V_p is the parameter of the distribution.*/5 w. c# `5 |2 v  ]* N3 T
    end% B; a( f9 f0 J* ]3 U$ s& o
end
3 Q* \& w( Z# J, ~- q: f# q2 p) H( ~& Y% I
begin P_process arriving procedure, C! u' i7 q& r* i
/*Any process the load will be in.*/
0 v; a4 y4 o, A* `  W0 o    print "1 load created" to message
! h3 f( g7 g5 n+ f4 L. B. Xend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答
+ l6 Y. e  x6 ]0 w. b) k3 i" h不过有些地方不太明白。
4 o; t) S. s* _6 _# _(1)L_null 和L_load 是什么关系呢?! z! I5 F" V4 k  t) x1 l3 x% [
(2)create语句出现了两次,会不会重复呢0 r8 E6 \3 }! G) V  ^# L
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
; s9 }( h4 \2 R6 r  Q; f4 x& j谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
7 g. Z5 J9 @. X) g因为我要产生3类load,所以代码是:
1 E  P* k+ X5 x- Dbegin model initialization function
) Z+ u* r/ z# ~$ R create 1 load of load type L_C2 to P_Creation2- v8 n3 {* E: V3 Q" n4 o
create 1 load of load type L_C3 to P_Creation3
5 P1 ~* M0 y, X3 P" o1 J  D create 1 load of load type L_C4 to P_Creation4: o8 e  l7 j4 _" E
return true2 f, t' h/ F! h+ n) i2 V; p
end0 w7 x' c5 Q. R. X) k5 ?' g
% |! g2 x/ q9 {
begin P_Creation2 arriving procedure
" K- z/ Q. n$ y8 h: G3 e& ? while 1=1 do
' W0 r! d7 G4 g& q( `' T4 U   begin
( c. ?. p3 n; }1 h     wait for 1 sec% G' ^% }; V! J0 g: E
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)1 r( v- {, j7 x& ^2 i+ H% S* p- E
   end5 X) R9 f  a3 v" S0 U/ l
end2 \: o* i# A( }  E
1 X8 ?! r! K& T! h
begin P_Creation3 arriving procedure
0 p2 _! K2 D! V/ K$ e+ Z& j2 b2 f8 q while 1=1 do
4 T0 v; Y& k5 m& ~* u! T  q& h   begin, s- E* p9 @0 V
     wait for 1 sec, i& U% H% M/ N0 U1 H
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)6 E+ Q6 W! p6 T* i; w; k; K8 `' g
   end
; [: u/ D" Y4 ?/ v' O4 Y  Y& K end   " Y$ g& P; _2 s2 {  r4 s& y& O; v

. Y/ c8 ^  C/ A: mbegin P_Creation4 arriving procedure4 n( M$ i5 J$ |4 Z
while 1=1 do
. V6 T" F# |& O   begin6 o; n, i0 Q" d$ x5 I9 n9 y
     wait for 1 sec
6 C3 ^8 t' I. V0 U     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
* n+ R! B2 ]3 G; ~8 |   end
: [, o& S0 o& F8 V end5 [7 `3 s- C" [( ?8 U

5 f+ ^' D1 `# n. x  ?) A可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
% N- u4 t& o) G, R现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
* |1 W; G1 ]: O# ybegin model initialization function- r4 J. u0 c7 \5 c& _, k
  create 1 load of load type L_null  to P_Creation2) J  }8 s$ T0 m' _
  create 1 load of load type L_null  to P_Creation3. G- V& [( u2 n: M& k! }
  create 1 load of load type L_null  to P_Creation4/ I( I- d; {4 v# E5 W$ {
  return true 1 a9 u; I0 `6 t; M8 z8 ]( h& t
end
  A2 W$ i* a5 J4 \; a' a7 T; R  p" n# a( P4 `5 J
begin P_Creation2 arriving procedure5 C" E; [# {3 R
while 1=1 do
1 C6 A8 ?0 N9 E   begin
; r2 G1 R* Y% _0 r# u     wait for 1 sec
2 B7 p6 i4 J; w# R3 I4 w* ~     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)- `2 M/ x% Y" m( g* }+ p
   end
& c3 y, C2 u* E9 Q% S$ Z( Qend
7 X: A( {8 t+ Q9 }9 a
/ _5 C* G/ c+ x. Tbegin P_Creation3 arriving procedure6 o' Z3 W" L5 V4 [
while 1=1 do- {! l7 G% K1 Z1 G. Y
   begin# v3 e1 w1 Z- a/ }! e% ]3 F
     wait for 1 sec
' G- r9 M) I' u  u2 ]     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
" g9 x( _" q  A   end
  J- r' J9 s  [7 Yend   2 j/ e6 Q' q5 M6 A7 y+ ]2 [. a! S6 M

& b' Q. @1 Z/ M0 g9 A. n2 xbegin P_Creation4 arriving procedure3 |8 l, [7 Z/ x: v, F
while 1=1 do
( R# q- p# W! v  k% J/ ]   begin
+ K: i8 G: c% m; e, V+ G5 y7 M     wait for 1 sec
; |: A% p# p( |9 t( j% Z. e     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)2 I; ]  |; K6 N, ^  X# a; N) |
   end
7 Y+ g0 k# Y+ M1 N5 g* lend
' g' p! y# O- o1 |* C' E' {
& M' U, e4 J: {$ ]$ d3 Y) V1 Y但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
. r5 }; k  a5 T2 z0 R如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。; N) e1 ~3 o, Z9 @9 q
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。' q! U5 N4 I/ _
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。& X+ |! n0 \/ W- p4 H
====================
) G% w! m! }. I( w我试过了,终于成功了!!!!!!!!!
8 K* }( ]$ l4 P1 [% x6 u, D这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
7 f1 ]8 ^% [: G1 F7 F2 b; {请版主给两位仿真币!!!!!!!!!!
% o( {2 f7 g, d3 ^2 P1 Z2 I再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-10 19:38 , Processed in 2.831439 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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