设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10722|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:& K5 z+ ^$ T7 O  `+ f' N0 Z
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?
  N0 Q/ P( i" r$ P; Y谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表
+ B& M* q+ q# S% u8 L谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);1 z" U4 d( l6 Q4 \" O9 ?7 G: O) z
begin model initialization function/ z. y' K' V4 F7 M
  create 1 load of load type L_null  to P_Creation27 p1 u1 j2 N4 j. X9 q
  create 1 load of load type L_null   ...

  J  k) Q+ z+ {" [" ~- d# Z8 N* A1 A9 |* n+ j
也许是模型有问题,也许是软件或者系统的某种bug。* ~# P, `4 o+ g0 O
6 W# C" L- U3 r" s+ g+ {
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
7 o" g1 |- K, e, _0 }( t下面的代码不知道能否满足你的要求。
" U, g5 M6 _+ n+ Z) C/ U6 n: R+ R0 O  _
begin model initialization function: [1 T" Q8 f3 ?1 z, H% N/ V
    create 1 load of L_null to P_creation
& L2 \; W7 _$ _/*L_null is a load type of which the load create loads for the model.*/% ^5 s2 g8 e; k* M1 ^0 ~7 o( `9 U
: I- l3 _3 v1 ~% y. {/ N
    return true
! ^5 \( Y/ R7 z" Z1 kend
6 t: L& V' H2 l$ w+ q3 q
* L0 c! z0 ~9 {! @# S- N$ X  wbegin P_creation arriving procedure
9 \2 N6 V- O( ~$ B* K( y1 _    while 1 = 1 begin
5 y0 E- ^3 X( ~' c7 X/ z        wait for V_interval sec# i" q8 p  Y+ Y4 ~  }
/*V_interval is the interval of creation of loads, fixed or random.*/
( G: b3 Z6 ^, p0 {% C# x9 \        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)/ Y( D' ?" F, }7 l& `$ l- Y/ P
/*V_p is the parameter of the distribution.*/+ V0 j9 w* l4 @$ ^. q) `- e/ n
    end
: S5 f- Q: ?3 D, e$ h% Gend
& d' C4 ~. K  k' y5 I% p& O- a" {
begin P_process arriving procedure
, y& G( t4 s8 O! T# O5 W, E/*Any process the load will be in.*/6 x4 K' Z8 @2 ^
    print "1 load created" to message9 k4 g+ N! W5 {8 g* T5 ~& w& F
end
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答" a. y, v4 L% f% }/ f* n# a
不过有些地方不太明白。. T2 G" `6 `+ u: F! `
(1)L_null 和L_load 是什么关系呢?
2 {' z& {% ~: I' {(2)create语句出现了两次,会不会重复呢6 h% g8 l" n. |/ m
我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。; }  X0 s7 m$ ]2 S$ H
谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
# [* _! S! r' W5 s5 A. i因为我要产生3类load,所以代码是:
  t( s$ o7 w& Rbegin model initialization function
; n# j' ^  e& B create 1 load of load type L_C2 to P_Creation2+ l% I5 Y8 o9 o. g5 B1 S
create 1 load of load type L_C3 to P_Creation35 C. S) Q5 k1 U& P
create 1 load of load type L_C4 to P_Creation4
/ d" l# x: s- l$ b. l8 k return true
# u' w2 _, f, k: S. L! E4 R# i( eend. z8 r  n* y2 J7 r9 r6 x1 j

! k- S$ a' b4 h" }) ^+ v2 D/ A3 Ubegin P_Creation2 arriving procedure
1 Q/ F6 h# W' u8 O while 1=1 do! V" s4 l( ~* S9 x5 b# X
   begin
. N4 C" ?- m$ @2 _. X2 ~) s0 |) O     wait for 1 sec* Z/ T" |. t! Z$ A
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)1 ]: q0 N/ L; x, b, l. @1 B
   end
0 Y$ s# P# a* V) H end
: T) O: T) O4 O7 W, c
* {3 S6 a4 ~9 k' P8 I begin P_Creation3 arriving procedure# s$ i8 p6 I- D* T) L$ X& @. P
while 1=1 do
$ U, E; V2 @6 F0 }9 V6 ?   begin
% n2 I: y: K- S  Y! d     wait for 1 sec1 ^% @' |! G' _) G3 g
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)! _8 R4 c# x& D& P- X
   end
- T0 L% {& p: ~/ f- O end   3 C- B5 F2 R% |2 g! _

+ f9 c! e" q1 x3 J( Bbegin P_Creation4 arriving procedure
. c! v- O# x5 j- D9 {' W while 1=1 do
. m* a! R+ A+ r* v0 z% `) O   begin
6 h- g7 q: u' X# {2 k     wait for 1 sec1 |+ u* d0 O' Y2 I, |7 g  C
     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)& i/ ]; Z  {4 L0 n% a1 G5 p: U6 |
   end# @6 K. f& y/ {4 ^! M
end3 x: G  E; T" J) Z! c4 ?& ~: U

+ l: ?0 |8 `$ g+ d3 `可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?* o9 \5 g% n% {1 N8 L
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
2 q) V9 W  k8 Z* E% Zbegin model initialization function
; A" q5 ^/ n' Y( ~! j4 q7 K  create 1 load of load type L_null  to P_Creation2
+ ~% r4 J( K. a# z) |6 l/ p  create 1 load of load type L_null  to P_Creation3  F2 V) |, F* `& i6 V0 T- Z
  create 1 load of load type L_null  to P_Creation46 m8 g* Y+ E9 \( o. o
  return true
. u) W+ l6 m. }0 |. Aend0 ]5 e. h) I# w  m3 ^

: o' u5 U1 A7 i* J& jbegin P_Creation2 arriving procedure
, c' t8 Y6 f& Gwhile 1=1 do9 @1 p2 ~! C7 P
   begin" k& t+ I3 Q1 R; }' P, G9 s; }
     wait for 1 sec' S$ |: G6 Q! w+ F
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)
1 p$ [; M/ i5 w+ a- h- R# P   end
$ D4 F( _* I  X' I. _4 e  Lend4 S0 d) P# |4 y8 m& c5 q2 K( U
2 S# w- g! V! ~
begin P_Creation3 arriving procedure
; e. r: m# z4 Q. a9 i( xwhile 1=1 do$ q6 r# s, u" q3 j1 }7 b% K  G
   begin
: B' [+ h0 U. {- `$ T1 E     wait for 1 sec/ @6 o) v# E+ M/ d$ U; `
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)2 p; u# M& |1 }/ K9 b
   end
& E: R% y2 \- Kend   4 y7 G0 {5 I% h0 G: d; O

5 p" B+ _- U. Q! T- z3 n. nbegin P_Creation4 arriving procedure3 u" [1 t. z' z! C5 N, V% ?; [) j
while 1=1 do6 X" p; K3 w! R2 c  h
   begin4 w; ]! ~& @' c8 H7 C  {
     wait for 1 sec
" M$ v7 l9 a6 h, E: Y; H     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)6 k1 E$ a6 |$ j; q8 y: Y
   end
7 p: O. o% C0 }( e0 P8 Cend- ~" }1 |0 o1 U) x+ c
8 X# o) d4 `1 k+ F  a- Q$ u
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。7 ?9 _" F, m0 P. E- v: `
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。
) A2 D( \8 z+ a另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。* L% v. V) i: n7 d. y/ R3 f) s, s4 u2 t
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。4 b. U6 s7 a4 w+ f7 c
====================
  m2 C6 |) }& {4 G# K2 M我试过了,终于成功了!!!!!!!!!3 A  t3 H, V" ^  ~3 p' J$ T
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
" |, J, O4 P# D4 b) _0 X请版主给两位仿真币!!!!!!!!!!0 p& q, O: r% d. L$ k6 t6 M
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-12-29 03:45 , Processed in 0.017341 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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