谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);: K; W; r/ w, c" b
begin model initialization function
+ J7 m+ Q1 k0 ~2 a# n' m create 1 load of load type L_null to P_Creation2
7 }. w2 v7 L' Y; Q create 1 load of load type L_null to P_Creation3
- b" |# k5 q% n" q# m( W% e0 M create 1 load of load type L_null to P_Creation4
4 T/ \/ z" k8 G return true & V* _4 u( V" g
end
6 a, Z4 G9 ^/ H% q8 ~ X$ U( b% x5 b& ~5 c) {+ a% t
begin P_Creation2 arriving procedure& {7 L( Y2 n5 h, b" I( V* m8 @
while 1=1 do* y, ] b2 N' T7 {' f2 I7 |+ }
begin
$ @" \& n: x9 l/ o wait for 1 sec
0 \" \8 |/ f8 F create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)
# G3 E' Z0 ~" E( W2 d# k5 ] end+ j2 P# r6 g( @1 `
end
# ]( |; }0 Z7 B% H1 f4 }9 _1 @
+ V' t7 N+ v1 |/ Tbegin P_Creation3 arriving procedure
6 B \0 x F q& F, W! m# R; j. _while 1=1 do
1 k. Z4 H- K" _. R4 w. i begin
! v1 h! R* M, c$ W4 G wait for 1 sec
Q+ m2 _) O, X/ q8 e create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
8 w: z0 }6 ~8 f( H; q% M end0 v; ^ y& r8 [( ]+ {+ a
end
& x( u5 u, k) z" x
! w- E8 m: H& w# V. F5 Obegin P_Creation4 arriving procedure
$ t1 {( K; i" f1 K( Awhile 1=1 do3 U6 ]4 _, I* }# S0 ?
begin( q( V% a, G) ^
wait for 1 sec
2 Z. G c8 p2 C. P9 N/ ~ create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
# o3 s1 n; a% X$ j end
' G3 c" a- L v5 p; B# _/ bend
r2 {8 E3 @$ u' m& X8 Z; W2 n! Q6 @; t3 M8 ?9 C: E8 X# N
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |