谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
! k, m# c* ~- v, ^5 Z+ R; ~begin model initialization function. R- Y) d1 s+ Z* q$ Y& c) ?
create 1 load of load type L_null to P_Creation28 r" V0 ?. n" A
create 1 load of load type L_null to P_Creation3. X3 |- h/ D# e% O7 u* Y
create 1 load of load type L_null to P_Creation4
0 a- H% C$ @, D0 a: v1 g$ A return true ; t. @- @6 h% @7 @; S) A
end9 p, e- \$ @" q; E
0 c% z+ n$ Q$ Ebegin P_Creation2 arriving procedure4 Y9 n9 G1 ^! O3 N- o5 c3 p% |& d( }
while 1=1 do2 R2 i9 ^1 [9 e4 W
begin
) ~) i) x+ D8 N% a- [4 m& Q wait for 1 sec
3 P9 g1 q- o* R& ~- G create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)
[4 _* X4 w6 w$ d! c4 O# x end
/ A% X3 O7 D# t: Send- P6 R& B: Q, C2 z
; ^5 n) H3 h A9 O6 d* c2 \begin P_Creation3 arriving procedure
$ V5 V1 [3 z& C0 U, @! h N7 @. lwhile 1=1 do3 w" _, x* r9 f* s/ S
begin/ n% b$ Y# I- g3 ?5 g, V
wait for 1 sec+ F7 e$ C; A; [: \. ?
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die). s9 ^9 Y, F: `# \9 A" `. k
end/ b! W- b4 W3 i& U+ @, j/ ^
end
) H% K5 \' N* r% T# j) f
; O( e% F% Z9 d E5 sbegin P_Creation4 arriving procedure# {- h& J5 n+ d$ y$ `% Z" s# t
while 1=1 do" a: [! B9 V7 l6 T. h0 K& K# Y
begin
' ?! E8 `- o% F' { wait for 1 sec& y4 p% ^ y, s+ u6 C9 ^$ ?/ N. F
create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
- q$ K) H4 C) F! r. X end# D( Q$ M5 k4 y7 C6 O+ P& _9 }
end
; T; d2 }; M. f% F( t& c+ s$ f, r) ]/ `. r5 @ O8 U p
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |