设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13849|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:# O0 \+ V5 `0 y, Z; Q
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?+ E" I! m7 N. T, b& x$ K
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
7 z  m' k2 _& A- }* H, l& f' z) u. h谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
4 \6 q% f# a) I; e3 c+ _) V- k+ Y' vbegin model initialization function
, \! n7 s; B2 H' `# v, L5 N  create 1 load of load type L_null  to P_Creation2
' I; ~; W7 \7 q, j5 i  create 1 load of load type L_null   ...

! B. g% W: ^  E- [! E- L+ a$ Z; a6 }% U) z" Y& N; i
也许是模型有问题,也许是软件或者系统的某种bug。
% H+ `! h$ M) }8 q) q8 n
" r" ^% T  r, Y/ X7 ~尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
" m2 o" O# X8 O2 M7 c, e' E下面的代码不知道能否满足你的要求。
- c1 x0 R/ n: g  _. r' J4 K) ~' K( ^  i( X6 D
begin model initialization function* s0 j  s3 |  d
    create 1 load of L_null to P_creation
( U2 X' r0 D8 N/*L_null is a load type of which the load create loads for the model.*/
5 R2 G  J! D, f0 ?7 g$ `& N/ D5 i9 I* K/ t% k
    return true
) k6 J" j9 E& f" Lend
& _7 Q6 E2 l7 x/ F: @* Q" k6 y5 D
begin P_creation arriving procedure; w. G3 ~4 j, E$ d* P0 x  f
    while 1 = 1 begin
8 [  J9 ~8 t3 v- I        wait for V_interval sec
. W" z3 C4 l0 \/*V_interval is the interval of creation of loads, fixed or random.*/
! s! h1 ]5 R# _        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
' m. P- I2 `1 ~! o  _3 X) \/*V_p is the parameter of the distribution.*/. \% x* {+ K) K% J$ l& Q) l0 ?
    end% a1 G2 Z. W1 t- X9 ?* C$ A
end) l& m2 H6 b) O6 j. E5 {3 C+ `
% J# ?. f5 L3 b
begin P_process arriving procedure1 G% }' I/ y6 O2 F8 A
/*Any process the load will be in.*/  |+ R5 E. P+ n: F' H* y3 {
    print "1 load created" to message
; H) M6 M- f) F3 S* Cend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答2 x- r2 D9 r5 _) m2 c, a7 u
不过有些地方不太明白。1 j1 |/ A# x/ S+ K, _
(1)L_null 和L_load 是什么关系呢?. o0 V; B* S2 Z9 n6 X, |
(2)create语句出现了两次,会不会重复呢
/ k* c# Q9 j3 r我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
5 d) a" M( ~1 S4 j谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。3 g. i+ @3 U% N3 N. K
因为我要产生3类load,所以代码是:
  j; I# |. e+ v2 Z8 x& D8 ~1 ?begin model initialization function- c3 C" x9 P6 M# d+ G% R
create 1 load of load type L_C2 to P_Creation28 O( E# y/ v. f9 U
create 1 load of load type L_C3 to P_Creation3
7 N0 g8 c. h& q  y create 1 load of load type L_C4 to P_Creation4
: m- {5 L8 j8 i  K: e* T" B return true. w) W+ T% [  Z" w
end
$ Q  Z1 z  M5 `- I" s, `5 r
% o- A+ `) U4 ^7 M; Q( v- mbegin P_Creation2 arriving procedure" w) _. P: V& E5 H( I+ i- Z
while 1=1 do- P+ m8 D" N2 u$ T5 R5 Q
   begin0 l6 z! M$ I  G: i" i# i" _" z1 W; E
     wait for 1 sec. @3 p- F/ U( H6 v: g5 e& A
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
: M( J/ m% T: l5 a) H   end2 A5 U7 B2 r' Q
end
) I( f; I' n$ f( r6 p" A
+ a6 E+ ~, q: F* f begin P_Creation3 arriving procedure5 v0 X3 @% {2 r: m7 _
while 1=1 do
8 U- ~. a+ l. g; c2 d$ I   begin
! k, c; B$ G  Z1 U! r2 @     wait for 1 sec( G; y) I+ U6 j9 b, }
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)- P) b8 |# G3 b# l  z8 v" x/ e
   end7 `- y  o* }# _: q* A& y# F, Y$ n
end   
' Q3 F4 E. S, c& M0 W7 F
* p4 O. {" \- r: x$ \begin P_Creation4 arriving procedure
1 h1 k$ m1 J6 {) U! J4 Y' B while 1=1 do9 V" E& o0 ~  |9 Z8 K. S
   begin( M: Z; ?( b8 m
     wait for 1 sec
% \# m% ~. L. `5 N5 X     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)6 X* r' O9 ]  b) f6 c
   end- B3 [  c4 U& F
end
7 s& Z* _! K& `
  W% A8 ?1 S  W/ _+ j1 F$ ?$ _0 a可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
* R4 s/ ~( n  q) v$ {$ h现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
3 f& ?: L2 ]( i; Obegin model initialization function
7 k5 L) C5 S$ i( B: M  create 1 load of load type L_null  to P_Creation2
6 q. {1 M! C, f4 C4 O% |  create 1 load of load type L_null  to P_Creation3/ X& Y) O8 {8 ]2 ]- O8 e# S
  create 1 load of load type L_null  to P_Creation4
) y3 j# X+ q) Q/ j  return true $ Z7 f) @- [- }# [
end
8 ^+ \0 {' n5 ?3 H2 R
( j- A. z. ]/ v+ ^0 Pbegin P_Creation2 arriving procedure2 A% u4 o4 j) H5 Q
while 1=1 do3 [) e/ E1 m. t. d# p
   begin% }9 q6 S' n  r
     wait for 1 sec
& O7 h' \( _3 ^  W$ D( _. ]     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)+ ^# l5 H7 E" u+ T8 i5 e
   end
& Z' B# M" z) \/ e, u0 K# g) yend% N! B" n0 Q. u' J3 G* n( S

( }, _, H( b  s  c8 t# rbegin P_Creation3 arriving procedure
3 [% D$ C! P% K4 E0 U1 dwhile 1=1 do+ W$ V; v1 h, Y$ X' [9 R& W9 U# _
   begin
+ s7 t! b& E) E     wait for 1 sec  D. _2 C  U# p' ]8 l. g
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)- h4 W; B+ m& P& ]' T8 z
   end( R/ @' @! C- |3 Q- J6 v
end   
" Q+ M4 M- `# S3 z4 X7 _2 P8 W! i- [. A  I3 \: ?
begin P_Creation4 arriving procedure0 R& W9 |9 _+ h, N1 b- U
while 1=1 do& }$ }2 a8 u9 H' s9 x- u
   begin
5 l/ @# u8 u; a4 U     wait for 1 sec
8 H$ c* u- K; \, ^5 ~( c) x' I     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
. n5 s/ U. @/ Y0 K4 q7 h0 v   end
9 w% _* o" u' a" T) e: g! S% Nend( s4 p4 }1 p3 g* ^3 _  |

5 n( S% ?% Q+ H但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。4 }9 M/ @7 Q3 p" D
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。! d9 F1 M$ T% W
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
# o0 ~& H) g& f- ^0 l# F$ L尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。2 R* b! L5 Z/ b' h' |
====================
2 }" n4 h, p/ v$ ?+ a# p我试过了,终于成功了!!!!!!!!!. O0 |; A4 p7 E# _4 x; D7 |" v- |5 [
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
" b+ ]: v, F1 p$ l2 |* @请版主给两位仿真币!!!!!!!!!!
  y) y8 d. R! g6 E% L再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-5 19:23 , Processed in 0.016347 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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