设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12432|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:3 h* X4 g& e# S& ?. n( q
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?5 \' W# t7 R4 i2 l
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
& I9 c/ v) _" G: H' B3 \谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
4 g4 s4 b. ~* dbegin model initialization function
& I* Y: G; r, u  create 1 load of load type L_null  to P_Creation2
+ r  D; d  i2 ?! e  create 1 load of load type L_null   ...
( ~( P& }" ~( a% G+ V) i! {( z2 x

, @+ i* c) `2 L( e5 J也许是模型有问题,也许是软件或者系统的某种bug。  I$ y  l9 s9 e+ H% y! E- W
$ d9 T4 b: X4 J  s# J: f* w+ k
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
0 P8 e9 y' c+ [下面的代码不知道能否满足你的要求。
5 j$ u) F! s( V% X- O
/ R" G4 s( Q  d& x. s; J# b# Lbegin model initialization function
, T3 e) ^0 u( i# L* a; o    create 1 load of L_null to P_creation, ^4 p7 w5 F5 G8 J( H0 _. }0 n( z
/*L_null is a load type of which the load create loads for the model.*/" Q# U+ o( z5 L
8 n, u  C% D2 {. c
    return true
" p: M8 j- j8 U9 u4 s6 v$ J) p2 uend! ?0 c, e6 @/ e% ^* H8 v

  m3 G; R$ C* o/ s% Fbegin P_creation arriving procedure
, D* @  e2 A3 Q3 y) l1 C: Z2 c    while 1 = 1 begin
$ x2 I* `7 t  n        wait for V_interval sec1 u; p5 K: w5 x5 i6 g) ?
/*V_interval is the interval of creation of loads, fixed or random.*/
1 Y* i3 B" S; x( \/ [: q0 G+ F( u  J        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
0 j% W: }0 w* N3 j, b/*V_p is the parameter of the distribution.*/
5 _+ f" b+ I' j& I+ |7 Q5 P    end2 z8 r. U/ s/ J4 X0 v
end
$ o  T& K6 W3 A# y! Q8 l; Q, k- m  q0 V( l5 }- q
begin P_process arriving procedure9 L2 p. l3 Y: A. z
/*Any process the load will be in.*/
6 P; Q- z+ R8 n3 |% u% A    print "1 load created" to message' k& J% C8 t& O
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答# j0 O8 a; c* i2 x6 a/ D% [) [! U
不过有些地方不太明白。
5 V3 g- l9 y$ U! ~' O$ k  q(1)L_null 和L_load 是什么关系呢?
4 S+ ^0 G/ S: j% s, n' w" e(2)create语句出现了两次,会不会重复呢; d. D; f6 H  H5 Q6 B
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
2 K6 Z5 Q$ o% s# l# Z- _谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
/ z* v8 H  A9 H5 A: i因为我要产生3类load,所以代码是:0 g3 t0 [2 x5 e! {: ~" }
begin model initialization function
2 `5 ~3 a: n% U; y$ p; D& V create 1 load of load type L_C2 to P_Creation2
  ]3 D' k" c9 Z8 q4 S create 1 load of load type L_C3 to P_Creation3
6 T3 O9 C2 ]5 g( j1 [ create 1 load of load type L_C4 to P_Creation4
, @0 z& W! h4 |2 _) h, ^5 G0 I( n return true
& @+ w2 `2 G% R5 Send8 s. ^1 i6 J# D( r! p
1 s1 @4 K; A; g3 t$ r1 N% y) Y8 `
begin P_Creation2 arriving procedure
: X- N& `, d. I9 l  C# q  U3 {* L7 S5 n while 1=1 do3 V' u' r( k5 M$ ~! q8 _4 e& A3 q/ J
   begin& @4 X1 W1 B+ a  R6 ?
     wait for 1 sec
- @7 S7 F) N& t$ O4 ]$ c     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)8 Z. w& ?& P" M5 k' l' h
   end
6 h$ a$ j4 m. e8 g end
& o/ ]* w7 W  R( ~
) [5 w; i  K3 d! Y& ]+ O# M6 P begin P_Creation3 arriving procedure
) b8 }6 Z$ I/ {1 m6 q* @; ] while 1=1 do
. Q# j# l5 U! B" g* b$ N* Q3 P   begin. r& q8 Z# \6 p9 f( S7 ^
     wait for 1 sec- L5 x3 K% ]8 I2 d
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
& o1 a' ^' C* Q6 d& r7 @   end
  z1 E1 K6 ~+ S& c- A1 B end   : @* M  {- J! B8 B0 G9 l

, k* O2 V9 {6 ~: abegin P_Creation4 arriving procedure4 W* T: h- M+ {5 n4 ?
while 1=1 do3 }  A3 C$ k: B: d" T$ X+ u, y
   begin9 `, Q/ A* C- N- i! ^
     wait for 1 sec
6 s8 \- X- h  F     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)+ B. k+ M9 }0 W% G' Q1 r
   end7 l5 ]5 W  y" z# A; a0 l" F
end
( f0 J" t; E8 Z) S, M- y7 {( {# a6 L5 g1 J# A; I
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?! ]; n( W2 J& K
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);: ^4 i7 G; s) D! f# a. {
begin model initialization function
- [7 E. o+ \0 r+ D  create 1 load of load type L_null  to P_Creation26 P8 Z' ^, B3 U5 l: z
  create 1 load of load type L_null  to P_Creation3
+ ?8 P( g( o$ F, r: Y2 C  create 1 load of load type L_null  to P_Creation47 c2 @) j0 A; J. P/ H
  return true 7 C5 o9 o* Z) z- \
end
6 }; }! d2 e3 {/ G" i7 p+ i' w) o7 P9 i
begin P_Creation2 arriving procedure* l" H* P% J4 f' X8 h! R
while 1=1 do
# V4 K$ H# e, e. T; Q6 g   begin' Z# C% i+ C7 T) {; k* u- a3 W
     wait for 1 sec  i8 K3 G! G( i# ]8 |6 X  j
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
" }9 l) L6 h+ l1 w& I* G/ ?- v" ?& U   end
4 j' q2 A  U/ c$ Z6 \; P) J8 qend
: b1 O- W! C6 d0 e4 d
7 ~; \8 v! }; m7 V+ ?) qbegin P_Creation3 arriving procedure
# X- j7 ]6 w* |( p( f/ Owhile 1=1 do. b, a- i) J) U) i& [* q
   begin0 @7 e3 _; c- U: x2 K) W. t
     wait for 1 sec
# p& X* i( V+ I7 P0 ]     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
8 c0 E- D$ N- S; ~) C   end
" V4 [7 z! R" P2 c  i9 ^. a# D% ^end   $ L, e, b4 f. ~, |& x; Q/ S

, |0 n' h$ n& E5 y5 t; Z3 v( dbegin P_Creation4 arriving procedure: u& H$ ?, `' G! ]1 F
while 1=1 do1 P. G: d& U3 \. U0 j; x
   begin9 v3 O) H: }/ z
     wait for 1 sec
- R; t8 ?0 T! Y! q3 O     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
2 K9 N. y7 r1 }! a   end
7 H2 O, |! q9 F9 {/ o5 jend9 |4 w# Q+ R3 C7 r# Y8 x2 F7 h
, a7 S5 w" D6 e; W
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。4 F4 s6 z, u3 ~; |
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
5 r2 N2 p4 D7 i) A  v另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。( v$ z, T- I; V, E& S1 w
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。2 b9 ]( q  S# J- |1 I7 {
====================
( q5 t0 g0 O  v  H0 U我试过了,终于成功了!!!!!!!!!, h: O- ?  @; h- Z: L- m/ a1 Q8 }
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
, |4 e, T) ~" s请版主给两位仿真币!!!!!!!!!!% C" W) K! S- y: J2 i/ J
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-5-9 20:13 , Processed in 0.019211 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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