谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);$ J4 G$ T0 e2 w7 h n* ]6 {
begin model initialization function* N% d/ q. \1 V3 o
create 1 load of load type L_null to P_Creation2' t' S1 p: R) K7 L2 U$ ?/ i; C
create 1 load of load type L_null to P_Creation3 w2 S) }% i% @! Y2 D: N8 [6 e9 K' k
create 1 load of load type L_null to P_Creation4
% _2 O2 X2 C5 E' a. A return true
8 q9 d+ J4 \# A0 R* oend, m- h: F) c" ]* o
. f4 \* [/ L' q ]begin P_Creation2 arriving procedure
4 D) L. I* W7 w8 v) x, D& fwhile 1=1 do# ~4 W) _3 S6 @4 s
begin8 }3 s: M# O& d5 c) X$ ~
wait for 1 sec
2 M6 R, ]. l, _) A- d create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)
. P: O1 n+ p* d" |0 Y$ V4 ]0 z end5 z: u; l" o( U
end
6 o* F# q0 g% g! x4 x
7 J4 r2 d5 J' y6 {0 X7 D( mbegin P_Creation3 arriving procedure
, @2 u* P( n- T5 L0 k) ?while 1=1 do
5 Y3 B7 h/ S% C begin
' t6 z6 ]8 u1 b wait for 1 sec+ b! l! G: V& e# l& @
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
5 p7 [, Q: m( h Q3 T+ \ end
- J3 W8 Z# F, w0 L3 b0 c9 `& e5 \end
+ v6 r% T5 H) B1 ~
/ z; D6 {5 R' t) s& {8 M: ?begin P_Creation4 arriving procedure) u% r. L6 d; V: ~
while 1=1 do
, n4 B1 Q1 O% ^& Y# Z begin
" y- j+ S& }. N' @8 J \; _) n" G wait for 1 sec; A0 w U" _" r
create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
9 Y$ p+ Y: X- z( ]/ ]! U, K end# y! W% Q! Y! U" }
end
" f3 _) p. U6 a, m+ o4 l3 i' o0 R. X) n4 O4 S7 B# \. r
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |