设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11167|回复: 8

[求助] Distribution of load creation

[复制链接]
发表于 2009-4-23 12:47:34 | 显示全部楼层 |阅读模式
5仿真币
请教各位:* B) ~* H; `; \& N* @  t% {
如果load 到达为伯努利过程,如何在AUTOMOD中产生loads呢?; g4 u% s9 f$ _% A: T+ V
谢谢!

最佳答案

查看完整内容

也许是模型有问题,也许是软件或者系统的某种bug。 尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 12:47:35 | 显示全部楼层
原帖由 Laura 于 2009-4-27 23:25 发表 & }4 T+ b, j* ^" c/ R* {: W( s
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);8 t' i" B' v& F' \6 ]4 [  N
begin model initialization function& J& o; N% p4 @; z8 y; L
  create 1 load of load type L_null  to P_Creation2: f" c" x  N- T9 q1 q7 ]' F
  create 1 load of load type L_null   ...

9 E/ b( y6 @% N  H9 F" L/ n4 U5 {; S$ _4 g
也许是模型有问题,也许是软件或者系统的某种bug。) f6 l' N& n% J  I: j, z
% _. y" \4 l; k5 V) _
尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
发表于 2009-4-23 19:10:49 | 显示全部楼层
什么叫“到达为伯努力过程”?是不是说,隔一段时间出现一个机会,产生或不产生load?
( c, j7 l% d3 p  L% [' @# m下面的代码不知道能否满足你的要求。* h3 U5 \, p9 c) L  r; k
& X5 o, ^! T7 Q
begin model initialization function
0 c% J6 ^, @( ^8 w8 h' S# C    create 1 load of L_null to P_creation
* J3 B9 R. d; b# H/*L_null is a load type of which the load create loads for the model.*/
0 E: t. h7 b6 O' d; s, \# H" x9 }5 v
    return true
6 W! n3 r! p' |. ?* kend' V0 J: P" r1 T/ B
5 x( d1 h0 a9 t4 c1 S9 V7 d# l
begin P_creation arriving procedure  u/ v  A1 H: u
    while 1 = 1 begin" h; X: `; b) V; n" T: h
        wait for V_interval sec0 U5 a  |- }2 \5 O8 [( l( \  f
/*V_interval is the interval of creation of loads, fixed or random.*/
6 k* e$ Y5 E, j0 a& X' d( I6 T* t* f        create 1 load of L_load to oneof(V_p : P_process, 1 - V_p : die)
( E5 S7 A) E7 j8 ?: N* c/ a) C/*V_p is the parameter of the distribution.*/5 t4 G5 F9 Y+ F- J9 U0 o
    end
. Q6 M' [: ~0 T1 P3 p8 send
& N0 a$ K$ k9 b8 q, j# k& T& A
2 s& L* i& h/ J, i, |begin P_process arriving procedure
( U3 T/ }0 O* o* H, E/*Any process the load will be in.*/
# x$ A4 g8 k3 t( n: R    print "1 load created" to message
, t% [( w( I) ^6 d. G) B! Fend
 楼主| 发表于 2009-4-26 12:26:45 | 显示全部楼层
非常感谢zhdew的解答1 w$ C& B7 V4 O$ F( p/ F& s# v# ~
不过有些地方不太明白。
, c- ?7 F- Q* ~. O2 d% b$ X(1)L_null 和L_load 是什么关系呢?
5 H; @6 f4 d% g(2)create语句出现了两次,会不会重复呢
: H9 @, C2 Z! C9 _& a- G我基本按照这个思路做了,可运行时却死掉了,不知怎么回事。
: v2 a( t% _& D- C谢谢!
 楼主| 发表于 2009-4-27 02:55:04 | 显示全部楼层
create 的问题我清楚了。
3 s( T( p3 R! ]0 v0 M" E因为我要产生3类load,所以代码是:
6 d, s9 L! P# v& U* _, S0 \% W. H( fbegin model initialization function
2 d( R# f3 v0 u% E- l1 B create 1 load of load type L_C2 to P_Creation2
5 c- n7 m' u: U create 1 load of load type L_C3 to P_Creation3- y: z& Q1 c, t* V
create 1 load of load type L_C4 to P_Creation4
' d, l& M$ u9 }' H  [$ o return true: F* R6 }, f6 z0 O/ ?$ N# @& {5 `2 m* i
end
. U7 K* r' k6 ?1 F
8 u1 `# G0 e7 ~# ubegin P_Creation2 arriving procedure1 \% V  I+ k) P9 f1 Z
while 1=1 do# a) S; @: \% Y$ b
   begin  k8 p$ O$ E; C* i  b. j% a, x
     wait for 1 sec
9 H! Z0 D" u( T     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)4 v  _' A" `( N7 B4 R5 e
   end$ F& D+ K, E$ G- `+ q6 z4 e- F% H
end
7 x+ \2 A' V8 u
5 o' s" r* M0 K; n4 Y; W4 x2 C begin P_Creation3 arriving procedure5 J! C& I6 c$ |# A) p1 m' V3 e" t
while 1=1 do5 G4 L' }4 e( s" G
   begin
; l4 U, f1 S) d% x. U$ ~     wait for 1 sec
1 o; t& k2 A; }; H  N9 A     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)2 }; Z# k# R$ C8 `4 v9 A: T* l
   end
7 f! {6 I6 g8 D* e  A0 A( j end   
- b8 d+ l" {/ N. o( ], U) F  y; u% o" y/ i5 H
begin P_Creation4 arriving procedure
/ Y7 H) F3 _# c' b' e while 1=1 do- ~* @' a- w. L# w% M& @3 _. @
   begin1 g6 ]$ ]" Q: M
     wait for 1 sec
8 d: ^" l8 j+ Z# ^     create 1 load of load type L_C2 to oneof(0.2_In4,0.8:die)
( n* N/ p4 _. F- U, Z7 P   end
3 B' @1 Q9 z, H/ I end
1 `( |3 h. I- I7 Y& ^+ L. y3 p# p( Q# ~8 d0 v
可运行时说"ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read" , 就死掉了,不知怎么回事。谢谢!
 楼主| 发表于 2009-4-27 12:59:44 | 显示全部楼层
谢谢shakie的解释,还有点不明,需要定义L_null吗?不同的loadtype需要定义不同的L_null吗?定义成load type?  c: [& D% a6 T. J5 ?- u, Z6 c
现在很惨,连模型都打不开了,提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"
 楼主| 发表于 2009-4-27 23:25:37 | 显示全部楼层
谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);: H# l5 @4 c! ^# y6 A
begin model initialization function/ R3 w; C2 e' @
  create 1 load of load type L_null  to P_Creation2
% j6 ]* N; Y" z, V& d  create 1 load of load type L_null  to P_Creation3
5 w& G$ u* z0 K- S0 I5 D* m$ d  create 1 load of load type L_null  to P_Creation4
9 N% U7 t# p  t8 w( W" P5 k  return true ) t# ^8 z3 n0 y7 X# f5 B0 c" {" C
end
% }+ R* J& D, C  y4 B7 T! ?9 P6 K1 z6 }
begin P_Creation2 arriving procedure
( Y6 h* D! ?3 v3 M$ [. E8 Wwhile 1=1 do
# ?/ z6 P2 x9 e  g9 i   begin
  F4 |. n( C" s8 W1 H: Y* z     wait for 1 sec# w" o5 |& E( v* p4 ^9 j4 J, i/ m
     create 1 load of load type L_C2 to oneof(0.2_In2,0.8:die)7 n: m! E/ L* h
   end
* {- B8 x: f+ K; Y' d7 hend7 l5 X# ?6 [5 v% u3 }
# m1 B& A& ?8 C5 [7 V' F# M+ C
begin P_Creation3 arriving procedure
2 h: u; W2 ]  i$ I/ kwhile 1=1 do
7 r2 n: D; ]1 F' m   begin
8 d5 a7 _& M' T3 a6 ?- }/ J( m* |     wait for 1 sec9 u" |  ?1 S/ v, o4 A
     create 1 load of load type L_C3 to oneof(0.2_In3,0.8:die)
( H& R: H( O1 B. i1 J1 D- ~! P   end
; F4 w# K4 Y4 g. a. X: M  rend   0 |0 D6 T, O  A0 Z

8 ^: L! @- Z  y& ]/ cbegin P_Creation4 arriving procedure% M, X6 p4 ^) g' [+ _  i
while 1=1 do% p2 Z8 r# J2 m- m5 i, |- q. E; o
   begin
( L& m7 q: ^" v; W     wait for 1 sec
# R3 e! ^0 @, D* ?/ X% m" b' w; a9 U     create 1 load of load type L_C4 to oneof(0.2_In4,0.8:die)
) j2 h6 n( H( ]% i   end2 R: x$ D5 A, G, X" ~/ m
end
2 H; h" H( r' k, h6 u  j
7 H( |# a; r# n! s, [5 e但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢!
 楼主| 发表于 2009-4-30 10:24:45 | 显示全部楼层
谢谢shakie的回复。1 m% ]& k/ W+ d# x
如果在窗口产生load,程序运行就没问题。可在源文件里产生,就出现这个情况。而且模型无法再次打开。- ~& v- q! @" v+ H
另外,请问在哪里可以上传文件啊?没看到相关按钮。不好意思
 楼主| 发表于 2009-4-30 11:10:59 | 显示全部楼层
也许是模型有问题,也许是软件或者系统的某种bug。
) f' R$ A' R! ?- b8 R4 \尝试把模型导出到arc文件夹,删除.dir文件夹,再打开arc文件夹中的模型。这一招对某些类型的错误有特效。
) [6 r9 j/ A. Q1 Q6 b====================
- B6 M7 i0 G  {* B# B我试过了,终于成功了!!!!!!!!!, `1 ?: k. `5 M" z( q
这个方法的确有特效!!!!!!!超级感谢zhdew!!!!!!!!也超级感谢shakie!!!!!!!!!!!!!!!!!!
9 c' n, P5 w/ N/ E/ m" A请版主给两位仿真币!!!!!!!!!!- I4 r; M8 K% g/ c; C; q" b0 P
再次抱拳感谢!!!!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-2-5 05:42 , Processed in 0.019227 second(s), 13 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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