谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);2 f' I0 j& D/ T( H' Q" p
begin model initialization function1 l3 }8 l. L$ b0 S
create 1 load of load type L_null to P_Creation21 T+ K: o9 a: Y/ z, h# h
create 1 load of load type L_null to P_Creation3
, F' C8 p. n+ R3 A create 1 load of load type L_null to P_Creation4( j+ Y- L! H9 p; ?- H4 U% A7 z3 b
return true - V8 b6 E+ k) Q [
end
2 O1 p$ P; X4 J, E' n0 E/ h: `7 ~7 ~( u+ N. U1 {: x
begin P_Creation2 arriving procedure
2 d: G7 C8 [; xwhile 1=1 do
B" x5 d. F, t7 D* Y. _+ E begin
9 I* y/ `: p8 _1 l7 N( i( P wait for 1 sec
- `; v6 \6 V4 Q: M+ j. L create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die); Z8 }( U2 x2 o' _8 n# y
end
4 k' g8 a: c8 R* ~# v" K! M2 Iend
: r( ?) B" y4 |' `% F, W& `8 C$ i0 U% f+ d' W6 f
begin P_Creation3 arriving procedure
% D3 h/ Y: N1 U9 ?while 1=1 do
0 v9 u) z0 @1 G }3 p! v begin
8 L" s0 V# a, E5 ~# G wait for 1 sec
8 ?. c0 F, c, X. F6 t7 N$ w create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die): S2 q# j0 m3 h# T Z* e
end: O1 C$ E" F- n. R7 ^: E$ x) P
end R+ w+ d1 {8 @/ J9 f$ H( w
E w& B3 b% ?& x. Xbegin P_Creation4 arriving procedure. A$ M, q! a+ G; M' v' D" l7 U
while 1=1 do
`% W s' O# u2 _& p! x begin! S5 b, @. m" [+ {
wait for 1 sec( e/ Z) D' A# {) T, }2 p& y8 p: v
create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
5 i8 a* N" O9 D/ m c! m% V8 K end# F& _3 x' K1 t# h- i0 p9 z; }
end. \, I3 P3 H# v! N4 }: X9 K5 O
; p2 \) c& g; S- B" Q3 ]
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |