设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12971|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:, R0 q& A# p' |. i4 S. I
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
7 s2 @" I' `" F: A' X6 }! C" \谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
/ c, H; A4 {0 W) g5 Z谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);( G6 B7 n8 H" E
begin model initialization function
$ D' ^8 [/ V# Z* y: Q  create 1 load of load type L_null  to P_Creation2
, F; k$ D* q; d2 Y9 r$ j7 z  create 1 load of load type L_null   ...
; k( y' Q) p* h( S5 B5 f2 Z
4 ^! ~$ M8 f' Z1 C7 ^& m
也许是模型有问题,也许是软件或者系统的某种bug。$ a. o5 U1 Y- I* v+ M
, y2 R' [6 m5 B8 v9 h
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
+ q; n7 O! r: S下面的代码不知道能否满足你的要求。
4 X9 K9 }- o$ `+ S& l0 X( A$ S* K' O7 D8 s! O) m! n
begin model initialization function
% q) X7 H* L1 Y% s0 K    create 1 load of L_null to P_creation
/ X' h3 W$ ?+ `$ Q+ z# p/*L_null is a load type of which the load create loads for the model.*/, }0 T1 k. z  ]% X

# w8 U; |) x+ f' _( ~    return true. O  p4 J8 }6 Y8 g2 x
end8 X# M3 ~5 k( d5 f5 f

7 r+ x7 |7 s% k- P# [3 h! Abegin P_creation arriving procedure
7 u1 l0 g8 ~. ^7 N    while 1 = 1 begin
3 [4 v, i( W9 j8 Y        wait for V_interval sec
( g$ U4 _1 N* B- C2 I/*V_interval is the interval of creation of loads, fixed or random.*/
; K6 Z8 i- S7 x        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
  |1 ^9 K& O& {$ l/*V_p is the parameter of the distribution.*/
- g, G9 e; T$ u    end; r( o6 a, g  [' T# O/ V
end- k9 ]+ R( U. e; ]
. p& W6 r' D$ H; b* w+ z& p5 Y
begin P_process arriving procedure( }$ ^6 x, Q6 V
/*Any process the load will be in.*/  y9 g. H  N. _: ]
    print "1 load created" to message3 y$ d0 K" o3 i( Q
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答( {2 Q5 ~5 z# L
不过有些地方不太明白。
. D% S4 s9 z" S' Z! }(1)L_null 和L_load 是什么关系呢?2 h3 J$ p: E+ O, s7 i( D
(2)create语句出现了两次,会不会重复呢9 c6 B2 W3 H+ U2 H
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。7 i4 S4 x: e; o1 E  O8 f
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。& `5 P5 `4 Y) R
因为我要产生3类load,所以代码是:/ E' j7 `, x! l' C& q' \
begin model initialization function
7 o6 ~: @/ C$ B+ P- T" D create 1 load of load type L_C2 to P_Creation2
/ ^! {0 u7 T* z create 1 load of load type L_C3 to P_Creation3
  M$ W- ]4 m; P' g/ y& S+ T" ^ create 1 load of load type L_C4 to P_Creation4
% P. g8 w- t; a. I  [2 a5 p return true1 C/ |0 c5 R# x; u
end3 c: F  h- [( X7 M4 O8 M8 Z9 V

) Y6 H/ h: p. ~, rbegin P_Creation2 arriving procedure
: \; g* y: T  h" [. c: [ while 1=1 do7 C. H1 c/ D. w2 f; a. P
   begin
4 J  m& U! X5 e     wait for 1 sec. W7 `7 H, C0 o& W: I
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
9 a& Z+ O: M8 F: j( I" k! i$ o   end
- u6 q/ g9 T! ^# o* y+ P0 x end* k4 V8 T  Q% S) D
5 \& {1 n# a8 k; b. f" r. Q
begin P_Creation3 arriving procedure
( v" i! `- j+ b& D0 b while 1=1 do
; ]/ e; ]* f4 @   begin$ f, v3 S. j( A5 S% b1 Y
     wait for 1 sec( N0 F) A" p, f/ H0 L/ f, S8 y
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)& B' P7 D- F2 ~1 t
   end
& Q' J, K9 }  \* T8 x6 P end   
3 M2 L( L' p7 T' k/ n6 B; v: ~. a
% z1 e" \0 w7 P  M0 vbegin P_Creation4 arriving procedure; E# F, Z) n5 g. G% T3 j; X
while 1=1 do" |; n- z$ l" x) L/ s
   begin" x7 k7 r2 |6 ^2 \9 {
     wait for 1 sec
$ R/ p4 Z+ Z1 ^) ]; {& h     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
& h) X" Z# _6 D- F/ @+ c7 {   end
  c/ f2 R+ R! p end; }/ t" i$ s; `( b0 b, A

. _* Z, v+ f0 K% j1 L9 V3 v! q. `6 d可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?
8 G7 i" q# H2 s3 i7 l" ~+ a) }9 O现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);/ Y& @+ Y4 g: c+ D) m/ C
begin model initialization function
0 \" [8 |2 ]. B0 |* M8 n: w- D  create 1 load of load type L_null  to P_Creation2. F6 C+ B6 K$ p0 X0 m
  create 1 load of load type L_null  to P_Creation36 W, K) ^0 h# p6 O
  create 1 load of load type L_null  to P_Creation4/ y. E9 ~- E0 p* b+ e" j
  return true % R( I) L3 p$ N/ h9 M8 ?5 |
end
/ i0 v. y% i2 u0 F9 q9 b2 v. O( u; p. Q, |/ D1 Z* v
begin P_Creation2 arriving procedure8 a6 v( d) r) S  s
while 1=1 do. H; }9 h2 Q* x: S- ?5 `- g& U
   begin
: a. v/ V5 t1 N* @; ^, ^$ f, \     wait for 1 sec
2 _8 Z. c2 |: v% q     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)3 v$ D+ K9 d0 ]  ~
   end
3 @" Z* W$ H: G2 D/ L: h2 Aend
" p. d7 V( L( Y* z  y
- G6 r% E- Z/ T' O4 _' Tbegin P_Creation3 arriving procedure/ R' B* k) e! ?. X" a- n& T+ E
while 1=1 do
5 o- k. w3 K7 Z" d   begin
4 r$ R$ R+ {- ?( @     wait for 1 sec
; Y: X5 w  o5 ?; _. }2 U3 U     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)4 S9 g+ w& a- N( O) I
   end% w1 N5 J- F( X( a, C
end   
4 v/ i, a$ c, `/ h7 A, U* B5 o
begin P_Creation4 arriving procedure) d: q- P% @1 @) A# @
while 1=1 do* p7 z- t) L( G- M8 q/ s( a5 M0 F
   begin
9 D  g: K( w; N' J3 F. |5 f     wait for 1 sec
$ l# W7 w- d, r% a) b+ X     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
+ u  e( J, W2 @3 m- K" T   end
& N( ^9 T. S) N* Bend
: j! q6 u# R" y# G1 h& P( k; q; M; I" E
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。2 C& Z& T4 x, T+ K/ M+ U
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。9 j+ t" F( X7 y
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
& N; S4 U8 P9 k7 F) p尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
" A6 `* `: `  y* s! Z( h, {====================- B' a5 B- G& P) |
我试过了,终于成功了!!!!!!!!!, ~3 g$ g1 f! G' w' h; P
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
/ b! V; M8 M  {4 G7 F" f0 m请版主给两位仿真币!!!!!!!!!!
4 o3 G3 a4 v( F' L, q再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-22 20:11 , Processed in 0.013391 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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