谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);7 k% j9 I" e1 I% O( k3 O+ o
begin model initialization function& I2 D B& G2 l1 b: P
create 1 load of load type L_null to P_Creation2
H% W% e3 _0 ~& j create 1 load of load type L_null to P_Creation3' O: d7 W4 K) q m( \; Q
create 1 load of load type L_null to P_Creation4
! ~2 F! S2 X4 N5 z% n. Q/ b2 Y" m" ? return true
, S& D/ |9 Y! b8 l; X% v! Z4 _end
1 o3 H6 ~" B2 M, \! e4 _; a# V; z/ H T8 s6 a. K, ~: O0 A$ F
begin P_Creation2 arriving procedure
2 I1 A) N" q. F8 @0 W" v! ywhile 1=1 do
7 u! V( [& D+ t! h8 e! r( p S begin g4 Q2 |% F5 s) c, V& k
wait for 1 sec8 ^8 c6 ~8 B. g" c! U! V
create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)5 A I7 L* a6 M9 d, J
end
& C) Q- I- X4 `% send; S! q# a5 Y! f
8 A3 X$ `$ t) Y
begin P_Creation3 arriving procedure
* P- K. ?, z" f0 Hwhile 1=1 do
# B/ X7 X e9 K4 D begin1 m. I# }2 N+ g p
wait for 1 sec" y2 c2 N3 n" V, r
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)4 Z5 u" y& K$ {; [* O* `- g
end
, N, S) W9 R/ y- |" [- Nend
0 m8 @: v& [3 `. d) g
. }; A$ A; m1 d( N( s3 @% gbegin P_Creation4 arriving procedure6 A& r) J7 m8 |( O+ G( k0 P9 I
while 1=1 do
8 y+ s+ t" Z z! {$ | begin$ j: u# ?9 X3 [' @3 G0 F
wait for 1 sec' K* C4 `$ i6 z: I+ A7 d; V* M4 b+ \* m
create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die) h6 p, f1 |; y, J' s
end: g7 R/ _ f o6 v
end
0 t9 l0 U+ R5 s8 m, V# ^& y* [" m) B$ q! i
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |