设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12819|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:
- e2 d3 {, ]0 H如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
+ h+ ?; j) R+ u+ W) D& Y0 I) e谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 9 p- x2 A; @8 d  t" }
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
. W  K5 b+ r& B. mbegin model initialization function2 O" [8 l3 b8 i$ ]2 k9 x! \
  create 1 load of load type L_null  to P_Creation2
' B* O9 M4 g5 m0 d  create 1 load of load type L_null   ...
( i0 ^3 G8 o* \' b4 ]; o

8 s* p3 j$ L6 W) a9 N8 W! a也许是模型有问题,也许是软件或者系统的某种bug。
; e4 d8 A6 L1 ^# n8 G; V; ]
8 r8 g5 ~9 v: X& c+ D, }+ }. E/ @尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
$ }# f7 E" y5 y6 H9 L. r8 d下面的代码不知道能否满足你的要求。
* m: \" z% `2 h4 I# C) d2 i3 ]  m. s9 I. n3 D" G
begin model initialization function% g1 }2 j( W% m7 [# n6 }
    create 1 load of L_null to P_creation
3 X5 b. ]# c- p2 M8 @/ E9 T6 u/*L_null is a load type of which the load create loads for the model.*/) Y% R& j% z, @/ u- t$ `
) p1 H  V1 B7 C& o7 ?
    return true: ~0 v8 Y4 W# v3 `
end
: P* O. u8 Y6 D
! A" d, C( I+ ~$ Ibegin P_creation arriving procedure
; p) }  `6 l) U: O9 [! t    while 1 = 1 begin
8 @, h$ x! m. k3 n        wait for V_interval sec8 A3 I% @, d5 X9 s3 i' L9 w
/*V_interval is the interval of creation of loads, fixed or random.*/
$ @  `& r, s/ p5 g        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
8 v6 q; W: I9 J% Z2 E( O/*V_p is the parameter of the distribution.*/6 E6 z1 V. _6 Z! C; \1 `0 C
    end
1 r2 T6 }. e: N3 H0 i& Hend
* }$ S& e' i& }, c- s
5 R9 U8 [/ A1 u, hbegin P_process arriving procedure' N9 D' g" p& G# [' T0 L
/*Any process the load will be in.*/+ @: T- l5 R5 e; I8 p
    print "1 load created" to message
0 C' c" I2 @' y4 xend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答6 B2 R1 z% d" p2 j2 C& k% E
不过有些地方不太明白。: i" }: s' x, r$ i/ d
(1)L_null 和L_load 是什么关系呢?( \9 G  V* b% M. \( U  S
(2)create语句出现了两次,会不会重复呢
; Y0 y6 H$ ?# s$ H+ [6 U# Y( Q我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。: l' o& E6 t' ]( V- a: i
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。+ x* ]$ Q  F+ ?0 [' _8 Y
因为我要产生3类load,所以代码是:' a0 y7 d$ o: I) W- ]6 Z
begin model initialization function2 n  Z- ?* b& S) H$ o8 ^
create 1 load of load type L_C2 to P_Creation2. b0 E6 y9 `1 O: t( D3 U( e9 g
create 1 load of load type L_C3 to P_Creation3, t2 g( k. J: Y! ^  h
create 1 load of load type L_C4 to P_Creation4
* ^, r! P9 \- `( o6 c; X/ s3 b2 ^3 P return true
# u. O; Y5 m( h0 Uend
) E4 X2 f' p3 P* i' p- ]  v
) c1 X6 C2 H1 p" n3 f' W, t& [begin P_Creation2 arriving procedure
; Y& R' r$ C, V4 h2 g# a, [9 Q while 1=1 do) I) l9 h% L- }  \7 ]5 m
   begin+ L% O" U/ t2 s+ S
     wait for 1 sec
9 h- e+ W5 \3 B& A. P     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)2 c1 w, T1 n2 F# n; i2 I3 A
   end
  g4 Z7 K( h6 [- W$ E- D0 I end# U0 }5 ?) _1 M$ N* ~- v
/ K7 Y- n8 X% ]& U. k
begin P_Creation3 arriving procedure5 F7 X" i' }. G, V8 s
while 1=1 do
7 D; A2 U  D4 u" Q0 t+ f   begin
: M. ~4 A0 ]. k' W0 ^0 m     wait for 1 sec% R' {  e  P) V8 W) d4 e
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)2 n4 u% r5 V8 H5 X
   end
, d; E" z+ i. j2 m end   
/ z+ ]1 F) ^0 R( j( _) ~+ A
' u9 R  ~% M) _begin P_Creation4 arriving procedure
$ K8 ^9 k' i9 l1 w2 y4 c! f+ Y3 f while 1=1 do
2 H* k* a0 K# E& ~' y( E4 M0 b' F   begin
- D; s- t1 ]; ]3 x9 [% L) h     wait for 1 sec
6 i' _5 w# [) h  B  d/ j" ]     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
, Y: N* ?' Q) y   end
% j9 X+ a4 [; b: R1 \. W: p end. j3 r+ F- }8 M: S, n; ]

. J- Y, o' g4 f# ~0 c3 d可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?+ a* j, |+ K) t+ T
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);6 q* j% e+ e( q1 o; ~" s
begin model initialization function
5 Q7 d1 s) y, ]9 c  create 1 load of load type L_null  to P_Creation2& u/ B' T$ g' I/ s
  create 1 load of load type L_null  to P_Creation3
: _+ p9 \; R! [7 {' t' l  create 1 load of load type L_null  to P_Creation4
- z  ?5 \4 w  w  return true
3 M8 z5 |3 g2 K, x) Dend
$ |7 Z: B( ?3 [3 _0 R" J1 s7 f# ?& f0 D% I7 f; {) j2 e
begin P_Creation2 arriving procedure# }/ a& o1 f$ ~. m5 L" c$ ~. y+ x
while 1=1 do
, w7 @# j9 d+ i1 }' A! x1 ]2 w! i   begin
6 W6 z$ [; `0 n# ?. f/ ^' B; {     wait for 1 sec
6 [0 c: g* b+ d3 H9 W& M     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
$ p5 N1 j& d3 I8 A% I& Y   end$ d! h' ?2 s1 \* f9 `) u6 q
end) e+ a# x) N0 f
" X8 b8 Q2 H+ @
begin P_Creation3 arriving procedure
8 @) |$ X% m7 v  p# g# {while 1=1 do, v/ s& R. [8 F
   begin) H4 ?+ o4 J* {0 W9 Z1 C6 Q
     wait for 1 sec9 r+ P9 f5 r3 F5 v2 C$ m
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
) U) [+ ~& O: R2 ]- |7 E9 O   end
; ~! r5 d6 O5 W  I  t6 D- p! Kend   
6 r" T/ ^7 q5 c& j( w$ Y/ h# [% c& {, I: u, T1 X! P- ]+ Q- A! @
begin P_Creation4 arriving procedure
" N$ Z( B! U4 Q+ l  F, x- kwhile 1=1 do- W' K) o1 `  c& H' Y
   begin# N' x7 W% T! E- c0 D! P- J4 ~
     wait for 1 sec
- b! _8 O8 M, X4 K% D* N     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
# D& y# {0 k) g1 i; q4 C4 y& A) X   end# \" _9 C4 _: l9 ?9 c
end
" F: n& \: N5 b% T# r0 E% Y* D; Y9 W% I0 [! e! f0 R
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。: h0 ?' p% D" W  C
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。7 _  ^" @2 t0 j" \9 d
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。* s; }1 [0 @  x, f! V8 I  ~
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。  \3 \+ O) d; v/ o% c1 ]
====================
% P' o# D/ B8 T: v* F( a2 S我试过了,终于成功了!!!!!!!!!
( P! x3 u" h/ r8 X& f这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!  F& ^5 a2 c6 J
请版主给两位仿真币!!!!!!!!!!" a6 E, A0 G% A
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-10 13:55 , Processed in 0.020042 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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