设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12228|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:7 s. [; r9 `* x0 [
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
5 X! r7 L& E4 X  [谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 # X6 _# ~3 i% P9 [
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
! P% R# A7 v  F8 Z) ybegin model initialization function
$ J5 a+ N/ l+ a! E  create 1 load of load type L_null  to P_Creation2% |9 L$ [3 P$ Z
  create 1 load of load type L_null   ...
: m: p, X# t- m* c

/ k$ I& ^; ]& g' P; H+ X也许是模型有问题,也许是软件或者系统的某种bug。
6 g/ z* b& B0 C" ]1 k9 `/ V; K2 G) y1 O+ `$ A
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
7 ~- O! h  b% l( z* W+ n下面的代码不知道能否满足你的要求。
$ r7 N# [$ S/ [6 Y6 k
3 H+ g: z- g6 Y% Pbegin model initialization function0 h3 G: J3 u( Z* b2 d$ q- }
    create 1 load of L_null to P_creation
  d4 Y! t8 ~1 l: e/*L_null is a load type of which the load create loads for the model.*/
9 j4 [$ U# b" {  Z% b5 H' y% g& X. ?# R
    return true
# W/ r# z! v3 I0 s) f5 Gend) h9 m- q) E  R: f0 u2 A
, a. w3 B2 r) x+ f4 P4 b
begin P_creation arriving procedure
4 [& O3 e. m4 z/ W; X- ^. F4 ~* f    while 1 = 1 begin0 u0 [' I3 e" ]: a7 z( q! _
        wait for V_interval sec  ~- c) E( N! B' ], q6 _  ]  }
/*V_interval is the interval of creation of loads, fixed or random.*/
& d* k. C& L/ e        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)3 R- b8 q5 g  p: x' g
/*V_p is the parameter of the distribution.*/
1 \0 b4 `% Q0 I, e9 K# T+ w1 e    end8 `/ e9 l: @0 U7 b( C, v7 O/ E3 _. p
end' |# |6 S4 t# W# g$ g3 c
/ ]  s% @0 Z- m+ \2 I8 O0 ]
begin P_process arriving procedure5 B: M, `/ k! _4 N& E% e+ T- m
/*Any process the load will be in.*/8 T6 t' q' ]- U; ~2 s; [& U. `
    print "1 load created" to message
- x% Z0 \$ W; s& F- a, ?, Send
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答
# W! `& O! t8 X不过有些地方不太明白。
' h( y7 j( U5 o7 `(1)L_null 和L_load 是什么关系呢?
1 o6 |- T+ ^1 s" q(2)create语句出现了两次,会不会重复呢
4 l( s' Y+ R" h1 I$ G2 o5 ?& @& w我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。/ _. l4 Z1 ?* i- m) ]" d* E
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。' s, X1 b1 p' ?+ m
因为我要产生3类load,所以代码是:# X- u1 ^! [. u
begin model initialization function
1 ?7 ]3 Y  P0 t$ j& R create 1 load of load type L_C2 to P_Creation2) l' s6 w/ v$ r% y5 N4 r% R
create 1 load of load type L_C3 to P_Creation3
( t( w) w1 ^& j, F create 1 load of load type L_C4 to P_Creation4
# [1 U4 M' o+ q7 ~9 W return true
, D) D5 R, r& z! q- S& F, S3 Lend
, l- w+ f/ J" o& `+ X# b0 C# Q. r
begin P_Creation2 arriving procedure
. R3 E" Q- d& M4 C) O; L while 1=1 do2 P  |4 v' @1 ~+ g0 N/ A% r) ^
   begin
" b0 F$ Q& s& B  E' T* e     wait for 1 sec' m/ c" _9 n7 p' T- S$ A- C" u
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)8 P0 e/ l3 A6 t
   end/ q" s5 X' L$ @5 p2 N$ \
end
/ K. r# i) t+ ]+ `6 ~
8 w. U  F' I) g" q' l+ m& F$ L begin P_Creation3 arriving procedure) F& O( W8 e; |4 a
while 1=1 do
( ?; X& ^* S6 [   begin: }9 ]3 l9 C8 C
     wait for 1 sec+ o6 v- y& a, M% P
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die), @; s) Z, L! F2 B3 v
   end4 ~8 Q* d4 U# |" o( Q  n2 _
end   
1 V5 T# e. Z4 W  J2 @" E1 b* c! Q1 [
2 y; N. A6 k  k" m. H6 p1 {begin P_Creation4 arriving procedure4 ~/ ?6 L6 S% q
while 1=1 do  Z* n/ x& R# U- \9 u% i5 W# c/ d' n
   begin
7 d7 L7 N/ B3 w1 Q     wait for 1 sec  t$ |2 l/ ]7 K" s2 @6 H( Z
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
' ?- D( G0 [2 @" Y4 x4 H   end
) B; K, C, ^+ J) X* @) C6 E7 V end/ L* w+ J% P6 g- Y! C( n0 I

6 a( k1 F* ^9 q可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?/ g, S' {8 {. v' H! k7 ^, X% T
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);+ B1 E3 [" z% ?' T# t3 b  `" G
begin model initialization function  r: D% ?6 ^: R! ]& s
  create 1 load of load type L_null  to P_Creation2
- ~# P  l, h. M+ L1 R% y% G. m  create 1 load of load type L_null  to P_Creation3
2 [1 t" I* N2 O) E9 R0 {- {4 y  create 1 load of load type L_null  to P_Creation4
! C3 `( H" H( K  \$ H  return true 9 n8 L; u" d" v3 A: \6 z$ ^4 N
end1 p# d) o. v6 C5 m6 o$ {

: {: K$ V6 h' l) Gbegin P_Creation2 arriving procedure
4 h; q- r  V% w. i5 k" M9 h! h; C" Cwhile 1=1 do5 W7 t: r; s0 i% b; X( C
   begin
3 M0 K$ k1 E! ]     wait for 1 sec
0 S7 b6 Z4 A2 {6 t     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
& o; j6 L0 B; K8 }* W. o   end0 \8 M7 Q! ?( `8 z' e. p; h- H
end+ s1 }+ l: Y6 q8 k, N. W

8 }- B1 Z( F1 p7 e8 qbegin P_Creation3 arriving procedure  Z( }8 Y# \* z7 Q6 B9 n4 b
while 1=1 do' D: [6 t5 w+ j  x- F1 G4 g
   begin
# o3 H# `. g* V1 O5 J     wait for 1 sec
5 O8 i8 q! o3 ~+ P+ C     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)8 i- N0 i( K! u& E% t/ z& @
   end
9 T$ K; K( h- A# Pend     \2 s! S# x" s1 f) {
, A( M1 U, k- v  x6 s% S7 l
begin P_Creation4 arriving procedure
7 [5 n3 r" y/ E9 W, c$ bwhile 1=1 do. A: ^$ ~" k2 e$ q9 Z& f
   begin* v  }* H' t- U, a$ s" @& E2 l& F
     wait for 1 sec
2 [3 \5 f/ m) k' P  g! t     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)! Z7 P" M/ |( h8 J
   end6 X& p$ E' u' r+ `" y: E) H# x$ r
end; \' X, i' l! h# |

, D8 H9 k0 |' j- G) [但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。+ D5 a/ K) ^6 \
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。* u2 `( l1 ^# {7 \
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
& p& A; y# |- ]6 a' a0 V尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。, B6 g: y$ O. [' q3 J
====================& G/ t6 p, P9 T6 Y( ~
我试过了,终于成功了!!!!!!!!!$ O' ]! M# Y* f' w
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!7 P: }: t/ u5 D9 Y0 R
请版主给两位仿真币!!!!!!!!!!1 N# w/ \" k& T; z8 [( r0 `
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-4-25 17:32 , Processed in 0.022464 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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