设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11971|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
) E4 Z! Q0 ?1 x4 b如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
5 X7 V' i- `  d1 a  |( D8 j. ^2 Q谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
6 Y* z& H. |) ?9 R: Q( s2 F5 O+ c# E谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
: j5 w' B7 Z! h; kbegin model initialization function
' A3 g/ k& |/ F& k" O5 y3 d: I  create 1 load of load type L_null  to P_Creation2
* D, E" C; u& z  create 1 load of load type L_null   ...

, P. I7 g$ C' [+ I; d- H) q$ A+ \  N" I6 y
也许是模型有问题,也许是软件或者系统的某种bug。( }/ N1 b. w' l4 s) h1 \; Q- Y

! M% k& l7 U/ V9 `2 i0 S8 T尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
. n) }2 r; M  y" T# c7 c下面的代码不知道能否满足你的要求。
$ B5 e# f4 v( S: h" d
  L, y  L6 }/ v" A+ C: T/ ~begin model initialization function9 `) J' @' _5 A. ^# H( b5 g
    create 1 load of L_null to P_creation
# c' |* R7 W1 q9 P% F/*L_null is a load type of which the load create loads for the model.*/
5 s. j$ [* G. Y: k" S/ E- @0 a& v
    return true
7 D9 l& c! F' \# tend
$ E( c6 a. c: O# p% G, h5 L1 K$ d# \! m( N5 t: t
begin P_creation arriving procedure4 l% Y2 ?% O8 ?" }
    while 1 = 1 begin# K: D" s$ _" P5 a7 j; T: l
        wait for V_interval sec2 W4 S# B9 u6 R; q: p" @+ L7 \9 [1 S- G
/*V_interval is the interval of creation of loads, fixed or random.*/' b0 J* M+ L! H+ N: M# o
        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
& v/ @2 L5 [0 ~/*V_p is the parameter of the distribution.*/
/ H; R) S  P" _% a% [9 D/ U    end
5 D: Z4 g, J5 k5 Q, o! V" w( Rend2 Y8 @: D  a( l$ [
" S9 ^( J! o3 b7 k
begin P_process arriving procedure7 b& Y& A" g! Q3 X  e
/*Any process the load will be in.*/6 c2 K& w+ `, q) I/ |# j
    print "1 load created" to message+ d) n% T7 [3 |8 a+ b2 J
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答
. u7 N' f) J* G& W5 x1 y. _: Z不过有些地方不太明白。$ z$ E. `7 X3 ^  T5 j
(1)L_null 和L_load 是什么关系呢?
8 ]* I2 O0 i% _8 ](2)create语句出现了两次,会不会重复呢
. }  w+ W; i: M0 ~# m我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。: K- z/ N- S: S* _: Q
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
2 o) o; M8 P0 |2 P因为我要产生3类load,所以代码是:
2 N4 f* o" J6 rbegin model initialization function
; {0 }3 ^8 e; x$ _6 @ create 1 load of load type L_C2 to P_Creation2
+ q( z: E  [8 u create 1 load of load type L_C3 to P_Creation3. }9 n+ P0 j* K# c* X
create 1 load of load type L_C4 to P_Creation4
6 |2 `. y6 c. J5 T; ] return true+ ~; h: i$ m% n$ O3 A0 I
end3 g% x( ~0 C. _/ v% y

  d& u, \: \1 A3 fbegin P_Creation2 arriving procedure3 d' t& |- i& Q1 Q! e7 I( g! l7 A
while 1=1 do
2 z! S5 }* D+ u# R( w5 o/ h   begin
, n- s6 b/ o$ q2 T: U- w5 j- x     wait for 1 sec- ?/ q$ ^3 n1 `% i4 A' C
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
) ]+ ^+ n# Z3 R: p   end
  `1 Q. T1 [( H end8 D2 P9 A( ~4 P* ]
0 m6 _/ }" w" P& L- x
begin P_Creation3 arriving procedure1 y4 {& G6 {) L4 a+ _+ Q& c
while 1=1 do
2 B+ v5 @+ m7 P: `8 N1 D   begin
' c0 z: i0 T, u6 i9 [     wait for 1 sec
& L& `  h, \+ O5 `7 o. H& G3 @     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
1 m8 G  e" U% ?) p9 A9 [   end
! G' ?$ k8 t' U4 ?; Z* Q% | end   * o# o+ B' @2 ?. p" N4 g

2 m, w% u2 \8 x& E7 p$ i, l9 tbegin P_Creation4 arriving procedure5 |" s( P2 H! H/ Q/ h9 a7 o
while 1=1 do
4 t  u* x0 @& n8 ^   begin" K, Z4 `, n, [
     wait for 1 sec
% z) V4 Q. j1 o! A     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)& g, M, i! Y4 _
   end: E6 h4 C! K; ~+ ^
end. n# _8 O% X  E9 @# Q# c# e: k

# U& A. n1 _, h6 V: K# |可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?( K( s9 s, x# v2 P8 V
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
& y. X: s5 M4 g' }begin model initialization function
- j+ G6 _, e+ ^1 ]- J% w5 ~  create 1 load of load type L_null  to P_Creation23 B4 e+ ~1 g) |
  create 1 load of load type L_null  to P_Creation3
$ h( |4 g. a3 ^  z9 C) [7 F  create 1 load of load type L_null  to P_Creation4
4 J' V, ]1 ~# ?4 v6 a* B2 M  return true   {* Y. f' z# T
end
& }$ c3 z% W3 J( L5 X8 S1 c/ i$ `/ {+ K
begin P_Creation2 arriving procedure
9 W9 e6 R  C4 _1 c% \while 1=1 do* r7 o! I: {3 ]2 ^- b
   begin
) g+ m# y, F( g  [     wait for 1 sec
/ Y. u6 G" r; E" Z     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
  U$ C/ {8 Q5 e( I$ _) c   end) F9 p9 y/ k( T2 U" D: ^
end# y7 K7 |' L: Q* Q
1 _+ |$ c1 x) h! O$ g
begin P_Creation3 arriving procedure3 R: y9 [$ ?" B# s
while 1=1 do2 z8 l1 @2 H0 H; c
   begin
- O+ F+ U5 c0 [     wait for 1 sec( H* y9 I1 f7 P
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)9 ]2 b3 O! e) ?! Y0 I
   end
: k& C! d- K$ f( }# v- pend   
. T1 K! @& B; M: u  |! Q+ r
7 \4 p' J$ @7 L# Mbegin P_Creation4 arriving procedure! a+ S3 n& S. e! n# l, D: P, a
while 1=1 do, E, b* q5 c  J6 b
   begin% q8 Y9 O/ P# a- {, }/ w
     wait for 1 sec
6 }3 v$ V( @' y7 `* V9 d8 u     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)8 A- m# b* _" q) S4 W/ [
   end
" e5 @" A1 |: B7 ^9 B0 send
, s3 b' O6 Q- l4 W
" ^: X- X) t5 `* `! u. h+ J但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。
8 S' J9 t) C/ I& f' E; R; L如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
* a8 }) y7 |5 M3 |) U另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
: a5 R6 q9 Q! {) ?: g尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。: _2 b4 T1 u  U: q
====================" t" }: A% }, P" R! t; K% a2 x
我试过了,终于成功了!!!!!!!!!. t0 }6 r- M0 ^
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!; |* q8 Y2 u4 T1 B# O
请版主给两位仿真币!!!!!!!!!!
* ^/ _- n5 p$ R6 y+ u; w3 g9 G" \再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-4-11 13:30 , Processed in 0.017051 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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