谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);6 J, u- _- X) z! }' S
begin model initialization function
/ E& Y9 `7 W; G* A! l( r2 a create 1 load of load type L_null to P_Creation2
+ d) m& L2 F2 A- h3 K create 1 load of load type L_null to P_Creation3 p$ j$ p! \: p- v* i b, Z" \0 U
create 1 load of load type L_null to P_Creation4
A) Y+ L- l: e* f return true 0 ~ R# _& ]/ I4 m6 ]! B
end0 a' j: q3 e( p" ~* z; I
+ d& ^' o4 z& ~9 D! Rbegin P_Creation2 arriving procedure
7 S$ l8 W2 P, J1 ]! x0 o# Ewhile 1=1 do G) O8 y6 T# u2 |0 b- v
begin
" k3 _( a" L) J' f8 n2 w1 E wait for 1 sec
( R. W7 r. i) o! R create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)! n% B9 j d" `
end+ |3 ^* [% J! `4 T# O
end) Y$ Z# e, U7 h- u7 P
3 b% P$ C: b! I6 \5 f% C$ Sbegin P_Creation3 arriving procedure
, P$ R a Y+ L+ {: Q7 @while 1=1 do
6 I9 G" E3 T/ b: }# j begin- G4 M* A* q, I5 g0 n. `
wait for 1 sec
0 u2 [1 z I/ L/ l) l create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
, D* S$ ?3 w) H' e" s, O end1 T# n& f% o) n3 q/ N
end
; M% N4 Y9 `2 R, `1 h. C" b' {
2 h, g/ p- h( J- x" R: T Xbegin P_Creation4 arriving procedure# ]% g; ]0 i2 M1 J) V$ m
while 1=1 do
9 B7 O% [ E. G, E begin
) W9 I& P# Q$ o+ u* T wait for 1 sec
+ F2 g. V( L) Y; B8 P( L create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
$ c, o- o5 \1 M1 h0 b; c1 A end1 ^. v" l/ v |& L! l' Y
end) N% w6 h2 k$ } }8 ^, w K6 r
6 @5 Z% ~3 ~" t
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |