谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
% c8 p. r4 _' D1 N1 sbegin model initialization function
. s4 N% H# [3 h3 v6 K- k! S create 1 load of load type L_null to P_Creation2) Q" \( V* H- O+ J4 y
create 1 load of load type L_null to P_Creation3& t8 T; e9 {- P: e& ^" U
create 1 load of load type L_null to P_Creation4
; U. O2 `, h3 L, F return true 2 [; ~8 n* ^* \5 C5 {0 y% N: m& B# K
end6 v# n2 ]1 r% y: u
; o. l2 l3 }4 Z* o
begin P_Creation2 arriving procedure2 s, w) v" I% Y. M1 X7 I, x+ d
while 1=1 do
' D/ p: {4 p% }: s; N6 w4 k begin6 b9 d! x4 x0 L j _
wait for 1 sec
* Q* } \" u [# l/ z create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)5 X3 M4 r4 ?) m5 \
end; }/ {, e) x6 ~+ ? Q2 h( v) l$ d
end
8 R+ D, p0 Q2 z5 d5 P
- g4 F/ M4 v s: ?5 f, R, abegin P_Creation3 arriving procedure/ x8 {! H/ R$ v
while 1=1 do
" o8 i1 b6 t" |- e$ B. h begin
! E; {6 s1 a9 k# z |1 N wait for 1 sec( \8 s/ n5 P0 E# c4 E6 ^( z
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
" @! p6 k, n8 L* Z: _/ q. U7 s end
; p4 v1 e% y, k% M7 Kend ! e& B7 i2 h b) h5 D
1 A5 s* I4 x" sbegin P_Creation4 arriving procedure
^1 P* U' I: t- A- ewhile 1=1 do
7 Y/ S- s; R& n6 U# J begin9 u' V+ B$ l; D5 R' z0 y5 d
wait for 1 sec
6 N: ~/ u+ _% v4 {6 W; `+ _/ w2 u& r create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
. @: |3 B& n2 J5 ~ end
Y- W6 e9 r1 x2 |* }6 n; hend) ?+ x% @& \: t& }$ D- `3 p3 y
5 d/ n' D+ A8 l3 S+ r; c
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |