设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11387|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
2 I$ Z7 _0 u; O3 u) Y. D如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?  y: P' s5 v8 D& a) d4 V
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
1 q' M" i- n1 G+ [4 K$ j9 n) w谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
1 ^, c: E4 q* ?0 H2 x7 J8 obegin model initialization function+ w. u; Z8 X5 A% z1 U0 |$ G
  create 1 load of load type L_null  to P_Creation26 ^/ K& X$ a6 K* Y
  create 1 load of load type L_null   ...
9 b1 x& M: @- H

* m/ y) c  C4 l# u7 z, f也许是模型有问题,也许是软件或者系统的某种bug。
. h. g4 k6 E" Q5 O# S+ S
9 M( i0 }* [/ p' n% l5 U; ?尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?  N1 [7 i% M) ]5 o) D* ?
下面的代码不知道能否满足你的要求。
7 b  F+ l% Q5 \" F  g, i# L) y/ X
2 n% V8 l4 d5 P+ Q  I& A' g3 Bbegin model initialization function7 H; c/ Z- C/ `# |2 z
    create 1 load of L_null to P_creation: H. x) |9 p5 O! H5 M2 E
/*L_null is a load type of which the load create loads for the model.*/
" _4 g2 u' `- i: _
: P' m- Q1 m, }6 g    return true, x, a: U" k! D
end2 i; q1 e& g$ T! s  m8 Z
5 i* T: _7 {0 z0 v; b
begin P_creation arriving procedure
9 S9 W8 D9 i' b    while 1 = 1 begin8 T+ M2 [* z% x3 [
        wait for V_interval sec: E+ @7 A+ J" D
/*V_interval is the interval of creation of loads, fixed or random.*/
  N! }7 e# G( R" H1 j' O( g        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)6 p! V; V+ v4 ~4 U! e% W
/*V_p is the parameter of the distribution.*/
2 y" w- t; V! C    end
- {. m7 P9 n* ?1 u" cend
- r1 v# V8 O. I0 o
$ m9 r. T  g+ Abegin P_process arriving procedure
+ z4 q% B7 p9 p0 X. D- A/*Any process the load will be in.*/
+ l. _7 b! j" o, j! |    print "1 load created" to message" x' G- B2 Z* N
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答) V5 z. j' O( f$ c
不过有些地方不太明白。
" z0 U4 y  G4 T3 M% G( @! @(1)L_null 和L_load 是什么关系呢?& K7 }% m5 x: s2 d. x# C
(2)create语句出现了两次,会不会重复呢+ r1 N* q; c( r
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
! |2 n8 N- h1 V0 X/ O7 L1 q谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
8 {! J& \% Z* \4 [* m: b4 c  {因为我要产生3类load,所以代码是:
! W7 j' C! N, C6 a- j: u7 Dbegin model initialization function
) Y* h2 G3 L: e. @& i9 `* X create 1 load of load type L_C2 to P_Creation2
1 f& X6 h9 h6 O create 1 load of load type L_C3 to P_Creation31 I+ ?  j7 S$ P, T6 f" |7 [
create 1 load of load type L_C4 to P_Creation4
" P- @! I9 |+ S% I6 b; I return true5 u( U. J$ X! }
end
) w6 T7 {; s. u) A# G; h( @( P( ?' i
begin P_Creation2 arriving procedure8 g$ z" F; s, V8 x3 }( F: G- j
while 1=1 do$ _/ N! v& c9 |5 t: _. P
   begin. E* J" c" X+ n' R
     wait for 1 sec: i* m+ U5 M& m# W5 u$ p" Q. F
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
! v4 l) _$ ?5 P! {( z; [   end* {9 R* \3 T: I5 j% L* H/ q/ v& U6 m
end
. `1 q  l( H& R
5 ^' t8 Y- m  x6 G& [, z begin P_Creation3 arriving procedure" S( V: P* E+ A) y
while 1=1 do% R/ N5 t7 M: L2 f# a' R0 B9 `, w
   begin
& e; ~. W9 s+ w& x     wait for 1 sec
* A0 n' w' U9 T) y3 o- {+ i     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die), N. M' L' I9 J- ]$ R" A
   end
4 {* M% l6 ]2 J; e end   5 b5 i1 L2 Z  v7 t3 A9 }  ]
( V% T) j* E2 m0 W8 @; k
begin P_Creation4 arriving procedure( m( z5 F% g: Z4 I7 Y
while 1=1 do4 D+ h- Z. [% m" w2 ^1 t% t6 ?
   begin( g# s& g1 H; y
     wait for 1 sec4 c' t% U/ U; k; s) l( e4 ]0 W% A
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)$ T+ t* w$ q/ U6 ~; \1 |* F
   end
0 B. x) @6 s$ d2 j+ V end, L+ ?. V, d7 x2 }& \

9 H1 ^$ _; R+ ?+ Y  C/ f: n! Q9 U可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
0 v" B- f( B: i( e6 @" i7 W& {现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);0 i& {4 b: l. F
begin model initialization function
) g; b; f( M1 c# b  create 1 load of load type L_null  to P_Creation21 r& I; T$ n& ~7 [
  create 1 load of load type L_null  to P_Creation3
2 S& U9 N' I9 D4 B) N( _7 m  create 1 load of load type L_null  to P_Creation4
( h2 O) z  W' |/ u6 K) z  return true
6 U& ]* L8 T. \end9 b+ a0 B* y( y8 H4 w' X

9 J$ w% {- Z+ s# O3 Zbegin P_Creation2 arriving procedure
  v8 s1 P8 T) J3 D; gwhile 1=1 do
7 P/ T% n  N# q$ ]. Z& C" C( E   begin1 R$ J( F! p" _( M' b1 X% ^5 }
     wait for 1 sec
" _! W9 b+ C# f, s" F7 E     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)" i) ^; O6 S: b5 b  e7 D
   end
3 B6 p6 ?. _' f2 Cend
4 `8 Y0 m% d# L" x. s, L- L# c: B4 h
begin P_Creation3 arriving procedure
' f4 E8 W1 e) M9 r& s5 f9 Swhile 1=1 do3 C6 F! |: Q! o- U$ W
   begin5 a0 x: d! }, I5 [. G
     wait for 1 sec
0 i/ a" D6 _0 {1 z; m" H* @% R! B5 Q3 d     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
0 J% E  v( t! f9 z, f   end
% N, `3 R% h) l2 Rend   
' x2 l+ ]( ?3 o; K: s$ u2 \, n2 Z" h( {0 X4 q5 f% s- x
begin P_Creation4 arriving procedure1 @' j& M: ]# |2 i- d
while 1=1 do4 s6 U/ C& ^% S% k9 O3 K) P
   begin! C% e, O9 M' \/ O# |9 _* c
     wait for 1 sec" j9 T+ ?  V. l5 s! l6 v' E* \3 H" e+ V
     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
$ H7 e1 \4 ?6 B  I6 o5 ~/ D1 O   end# e* }% L2 b0 l/ O( N( u
end: ?7 {5 C; {* T: E

% C( N9 C9 i& [! W- A% a5 A; d但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。' }- z: ^0 J+ E+ j
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。) D( T( @" H) }
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
2 c  d/ n. T. }8 s, G- J尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。3 I' V( X: b2 x+ q
====================9 ]# {  v( L# O, T1 c& z
我试过了,终于成功了!!!!!!!!!5 h; N- C% g" G, o( t8 v
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
, ^- _5 T& z- z9 q请版主给两位仿真币!!!!!!!!!!
  H7 H( z) m6 O8 d- {5 r2 l7 f再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-2-24 18:24 , Processed in 0.016588 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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