设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14082|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
$ M8 M1 G( m$ M" @' \如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
$ t  ]* @+ z' o3 Z; }& _谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
! s5 |6 s4 Z+ ]* [, n谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);0 V% x8 T- A2 f
begin model initialization function
+ a- S% k$ z/ _  s0 l8 r! t  create 1 load of load type L_null  to P_Creation2
* ^: l8 O/ [3 q9 E% J  create 1 load of load type L_null   ...
1 }1 Q' h$ z" G
: n6 D$ a0 V% I% r7 Z
也许是模型有问题,也许是软件或者系统的某种bug。/ W( f+ O2 C2 {, q: @* _
5 K& c+ \3 r6 b/ m: `2 C& @- o
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?& {7 ?# Y5 Z+ s  M- N
下面的代码不知道能否满足你的要求。
% \- Y* K2 F9 K1 p' G  \0 [
, D5 d( H8 u2 y6 F! `# wbegin model initialization function" p; h- I2 G& x
    create 1 load of L_null to P_creation
, f) M3 |% ^1 y8 T7 o3 f5 i/*L_null is a load type of which the load create loads for the model.*/
  Z, X. ]; w9 F- x1 [1 r) o4 a* n0 K. l% ?  o2 W: N' k
    return true
$ L6 T8 @8 D" _# W9 D1 }: lend
. I- _/ z. u6 m' j: y" d1 W9 g9 R) Y. p* W! C
begin P_creation arriving procedure9 U( s: a1 }+ W3 P5 r: c+ h
    while 1 = 1 begin
" l) z* k# A" C6 j6 \        wait for V_interval sec
9 M1 }" P" I6 V3 V/ ]( T" r; \/*V_interval is the interval of creation of loads, fixed or random.*/9 ?( V1 r0 J' M- m
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
( N3 |/ O6 H- ?* o* t/*V_p is the parameter of the distribution.*/0 x9 T. W$ J" B6 ]
    end
5 U9 q9 W5 X) O; o0 [0 Y( ]end/ f9 H% K( i4 a# D- Q

2 A% R* k9 A: B5 p5 w, d. rbegin P_process arriving procedure
' ]7 _) l0 B0 Y. u/*Any process the load will be in.*/: [2 W# k) `/ n6 r; U# K$ N
    print "1 load created" to message) v5 ^# H" @2 Y& C0 M0 O
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答/ x1 N! E9 O( q! w9 [
不过有些地方不太明白。
) e. j/ C+ P. E. T% d(1)L_null 和L_load 是什么关系呢?+ a( L$ N7 k2 T5 V& f3 x& x
(2)create语句出现了两次,会不会重复呢
3 C2 E7 W1 n+ Q7 E7 y我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
# S; J* ]) |6 z6 i" w4 c, f谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。& Y. q- N# [: l) E* k, {7 @2 r: w
因为我要产生3类load,所以代码是:2 b5 |2 C0 F! X
begin model initialization function! B  W' l1 J  X8 C8 H
create 1 load of load type L_C2 to P_Creation2
& n+ \" l+ V9 m2 J6 }8 J create 1 load of load type L_C3 to P_Creation3
& C  F" \% t& b( `3 Z% n! K8 u. @ create 1 load of load type L_C4 to P_Creation4
/ ?1 n8 b' Z: j# }3 |! a return true
8 c1 ?: h" C0 V0 \end
, n: a* P0 q6 u5 I' Y$ b; o
. e. c7 ?8 E. Z! Bbegin P_Creation2 arriving procedure
( l; |: `' G1 E! I3 R0 a while 1=1 do* Y& O/ B" M" `  h
   begin
" o! f& m" i: `% E3 {# b     wait for 1 sec
; V: t; A$ R+ v& {  Y1 }" \8 r     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)9 ^" _/ N# n( P, M
   end
5 m- _% y+ A4 `7 ~. Z0 l5 C end
1 M* Y# b' Z! U5 b
+ C" w. q9 S" K- S: X3 q% _ begin P_Creation3 arriving procedure
  C$ }9 C; \$ p9 h5 j3 d while 1=1 do
% N3 W% o- y' y; v0 Z   begin; T# x5 ^" L7 X- x+ M  F' {
     wait for 1 sec
0 e/ y. x* {3 P% U6 P) |     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)4 |5 K  q) V; \' _, i0 e" o
   end7 C) v( \" l! j4 _% O  z
end   ) g% r, ^* U, t4 f
) _3 N# O2 \: t; a
begin P_Creation4 arriving procedure
& l0 V6 q1 v$ t5 b$ a7 @. V while 1=1 do
/ `: s7 C7 H0 a& P" Z+ i' g0 _   begin
3 y8 E8 V! _( g4 E- q     wait for 1 sec: {4 u8 x' a! N# `
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)( ~% t* y0 e( j7 v
   end# W; Z( p9 w' f  x5 a# N5 ~
end
3 c7 j1 ]! s- T9 S, O) v3 R9 a1 ^$ B5 k' s
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
9 f+ _+ b) q+ b0 X* g* Z现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
! w9 L1 [5 i* u* J8 bbegin model initialization function$ I2 ~( ~4 ^' Q# L/ A4 d  \( ]
  create 1 load of load type L_null  to P_Creation2, O* U, x2 @9 U
  create 1 load of load type L_null  to P_Creation3
  {' {1 F& U' S  create 1 load of load type L_null  to P_Creation4
. W& I! V) o1 b! q, K  return true * x8 W5 ~# x& [# c
end3 V' F% S" {, o  w
( Y- S# R8 q7 s0 Q
begin P_Creation2 arriving procedure
6 j# }6 p- m. W  M- _/ G% B; twhile 1=1 do0 F% n* L& R/ |6 y2 X% a
   begin9 C8 g: v# d/ b. i' U/ A' b: W: ]
     wait for 1 sec
* @" ~! ?& S( _' B     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)) `: X( p$ h9 s
   end) J, M/ b3 q5 K# S  J! J( }  I
end: c; }& O7 H3 R2 H
' M: o/ r& t5 H3 t3 y  o2 I
begin P_Creation3 arriving procedure9 X6 `+ Z' F" r7 d
while 1=1 do  P" \0 K) c  m  ]; h% R" `
   begin
0 q9 t# r9 f1 V* g" s5 T     wait for 1 sec
4 e& R( V/ |! D( R* F     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die): M; V9 p$ \( C, m3 N3 S
   end
: ~! S& j  B, ^+ gend   
; u& b1 T% G2 f2 G9 k6 ]+ S/ v7 Y4 C' v* `$ z9 q& }
begin P_Creation4 arriving procedure
) N9 o/ `3 d8 D8 ]while 1=1 do% w/ J0 ]* p2 h7 Z; N" B
   begin' J" |! w; U. X0 [
     wait for 1 sec2 E" h* m+ _* k- u8 \: I5 S
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
3 t: l4 n) X& K7 r   end  G( `  P5 c( i
end: n0 m8 l4 T& R( F5 c
  ~1 y5 q. J; H0 B
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
/ z1 e7 L. R; w7 R如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。2 z5 F! A9 b" t, @  |
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。" s: M3 S' z9 b0 `( S
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。) W- R& ]0 p8 `- b2 ^8 @
====================
' ]+ M3 @8 {7 V" K7 b我试过了,终于成功了!!!!!!!!!7 V, h, ^, t: ?- b; _
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!+ T% `$ y4 b9 B* ?
请版主给两位仿真币!!!!!!!!!!% k6 C8 R* d+ T0 @
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-21 10:27 , Processed in 0.025207 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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