设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11023|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
1 c* g! i+ p) N# D7 _+ I$ G3 ~! A如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
+ Y6 j2 u( C: F4 R7 L谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 $ `3 j* _7 Y7 h  t
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
8 a! o, J- x0 I- Ybegin model initialization function  N- p/ u& x) P. u4 H
  create 1 load of load type L_null  to P_Creation2
1 O: u; f$ V) k) }) m4 U  create 1 load of load type L_null   ...
6 `/ Y* G- W* K2 |
$ E; a6 h- }5 Q$ A' f, n  Y! Y( W
也许是模型有问题,也许是软件或者系统的某种bug。
3 q. z, Y; a( K% Y: h+ ^  t# w+ K2 X3 i
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?1 C" T$ A& d0 L* L. j1 F
下面的代码不知道能否满足你的要求。
% Z& ?0 w. d/ \1 j3 w+ Z+ S
, @' ~# \0 A/ D/ [begin model initialization function
) k* i0 w7 L  {/ x# h+ B0 q1 P    create 1 load of L_null to P_creation& R7 g1 M8 w' p( Q
/*L_null is a load type of which the load create loads for the model.*/
" n2 W' V; }( k; s' O1 U$ J8 X5 H5 e3 v
    return true
/ N( r' u/ g% p8 y. Q+ F8 w" qend9 C6 g* w- ?( g& O9 ^+ a

& `( d& _+ s" Bbegin P_creation arriving procedure
" D1 u+ I) [& m0 q  u& l+ h& T    while 1 = 1 begin
8 @! M  g! q! }; @        wait for V_interval sec
. J3 R" s2 k& c, o& }: ]/ V, D2 b/*V_interval is the interval of creation of loads, fixed or random.*/6 Q! b+ [+ Q) ^
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)' z! T* x3 \3 ^$ ]4 x& j$ ?7 D6 s
/*V_p is the parameter of the distribution.*/, q/ L! ?8 J" i& V3 Z  Q% x
    end; n" F8 u! Q* m) T: _
end% z3 g# S% @) i2 Y8 e
7 ]  d" D/ {+ @" T/ T+ Y- |
begin P_process arriving procedure8 n% U: ~% l4 J6 N1 r
/*Any process the load will be in.*/" o% p9 s5 s2 Q4 C1 b+ x
    print "1 load created" to message
( |7 r5 M5 w- w8 C1 Hend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答# _  C) t/ H8 V5 J7 ^, @
不过有些地方不太明白。
2 M+ K8 w- B8 |" O(1)L_null 和L_load 是什么关系呢?! ?6 {+ M$ k+ H
(2)create语句出现了两次,会不会重复呢
2 s! h  g. }2 ?4 Q我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。& Y; O# O) K4 x0 a# Q# C
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。4 B# f+ v2 X' n2 D
因为我要产生3类load,所以代码是:
- v' ?1 k& v* Hbegin model initialization function
0 O, U# `0 D% f7 a' m6 { create 1 load of load type L_C2 to P_Creation2" X) T  i" ^' p+ z( e# W
create 1 load of load type L_C3 to P_Creation30 ^/ T9 M/ d! P- t
create 1 load of load type L_C4 to P_Creation4
! c# s& J7 m4 D' m1 S return true  D/ P  q3 P. q- j
end- `. o. @8 v# m6 H' ^
# P* N: G- c$ J0 n8 q; i- ?9 T
begin P_Creation2 arriving procedure  R& N( f- ^! o& S5 I
while 1=1 do% [; u5 w+ e5 c4 {9 `- p- A" d0 p9 W
   begin; k( j' {- x; z6 S6 S( L  h5 j" M7 i" D
     wait for 1 sec. V% {# y* Y& E# `) o3 t! o. `) _
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)7 J5 @8 }( ?* L/ c
   end
5 y# _2 J5 {  Y end9 K2 C( O+ }' s" B# ~

' h( F5 ~7 f1 s( p$ j begin P_Creation3 arriving procedure' T8 |6 j, x2 G: U7 r1 x# u
while 1=1 do
& m  H  _" M" h2 o7 |/ `3 K# t   begin
* f  b9 k! V" T+ u     wait for 1 sec8 @' Y8 `6 `# {4 C# [
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
& b, t: E. E; P& w% W. ^" e  k   end
" A& ^" y) }8 q4 X8 M end   
+ t1 X$ G0 \& f; P: R- L  ^" r- D7 `) Y  s: i
begin P_Creation4 arriving procedure
3 r4 Z9 r9 C$ R  T) t) p+ O. W while 1=1 do
! f$ n, N1 B5 g2 o7 A, d   begin, A9 N& I8 R* r3 ]
     wait for 1 sec
5 t, q+ l( F5 ?     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)2 H3 u9 [8 N$ z9 `$ s$ o
   end
8 T4 ]# s9 k: ~ end
! s9 `6 l! A$ Q" V
) S5 E  Q4 V* Q1 F可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
+ I, |$ H0 V4 v6 ^( _, }( {现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);2 x% \. T/ n5 F. ?0 [3 j
begin model initialization function
& P% M' Z- {3 y6 c  create 1 load of load type L_null  to P_Creation2$ `, T' K9 p+ b
  create 1 load of load type L_null  to P_Creation3
- ^3 a1 D0 |; P! ~  b  create 1 load of load type L_null  to P_Creation4: E3 @+ B7 u* ^8 }3 B0 J- ]
  return true , r7 J% ~7 K5 J% M
end
& p' f9 X3 c4 o) z( M$ u; h' |( b& }1 c4 B1 R# y$ w( W
begin P_Creation2 arriving procedure
, U$ r2 g3 z0 e8 J4 Vwhile 1=1 do
0 r3 A, v3 C4 ?0 q4 y   begin8 @/ z, o0 o2 S; A" B/ E. V
     wait for 1 sec
8 c. y7 M+ ^0 Z. A3 ?  h     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)& U' k3 `' X4 o8 S( C: \* Z
   end
3 T6 U! @1 A" `7 e( j4 oend
1 M9 t: |+ A. J4 C( Z  G  J- ^$ e# z
begin P_Creation3 arriving procedure
3 U0 H* E: g& g) ]0 Nwhile 1=1 do
1 @0 b/ p/ m$ W% v) \2 ~4 @, s$ f   begin3 j$ ^. o* f/ ~: i5 Q! y+ E/ }+ U4 I
     wait for 1 sec
9 o# E2 x: T3 j- ]( ^$ A. o, A     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
  j+ b6 ^! Z: H: X5 A   end
4 H, G) ]1 n+ z" ?$ f* J, K$ Tend   
: b& }# o# G0 T7 P* T* R  p$ m+ H0 n0 d& {$ Q
begin P_Creation4 arriving procedure
( V) l; H5 r; A' q- V9 }while 1=1 do
* s9 R) C, N0 H1 o, b9 i( i/ j   begin, ?& t+ j* _- \* {' x; ]& |" B+ H
     wait for 1 sec
" T+ r! ]1 }+ ^4 G     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
6 a5 n  W: A4 O% x( z   end) n3 H; R- N( i' Y8 b6 h& q
end  l/ I- y& t, d' }( a& G
1 h/ `5 I3 I5 [
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
7 b& N! J# g5 T$ u4 U/ ?2 i3 R如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。' b' }& T! Z4 ?
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。0 N7 _; _7 m9 b" c  s8 K
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。2 @+ ]8 P; |7 P
====================
0 U- ?9 S8 O3 T/ E% g我试过了,终于成功了!!!!!!!!!6 {! [3 U1 D% s" ^
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
8 f- ^; l0 x% F% V' O: ]请版主给两位仿真币!!!!!!!!!!: X. E; q: D. X& U9 B# U, z/ Z
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-1-25 16:31 , Processed in 0.018292 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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