谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);* S& P+ v5 a" {) I9 `
begin model initialization function
) K8 C o. d e! x create 1 load of load type L_null to P_Creation20 f/ b y2 Q) w7 w6 \; D& z
create 1 load of load type L_null to P_Creation3* f4 l* p4 @, T' h" Y
create 1 load of load type L_null to P_Creation4
0 Q, Y( E" _* X) ~7 F* x; P return true / r! u. I7 a3 ? q- S6 l% J
end; `' L. ]1 e; C) U4 F# v7 P1 x
$ q% l/ L% G1 X1 [3 D6 ibegin P_Creation2 arriving procedure( ~2 z- y: f$ S) B# F8 }
while 1=1 do
; @# _0 \& n4 R! u' Y9 W5 A. K! o7 v begin. A @: y% a3 [6 O! ?5 S& @
wait for 1 sec. c$ Q, t. N1 @& p
create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)
+ S$ @7 T T5 y. e end) ]9 Q/ V5 \" x
end
1 q4 g, r4 X) L5 w
; v* ^) J+ Q7 C, f# E! ebegin P_Creation3 arriving procedure3 N! G# s; }9 u+ b
while 1=1 do
5 X% @' ?9 M$ V2 E begin
) K* L' o% ?2 ]+ ~, a wait for 1 sec @( ^& q. j: |) y9 ?' l6 f# `
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)/ t7 K' @% [" b% }6 D; T
end
% J' @) z H/ Z9 C; _9 j$ x; [8 mend ! s% _0 B" m. V/ H7 e* H
' Z1 B, o) g, C' i7 @: X+ B+ A: d
begin P_Creation4 arriving procedure, @/ N: ?7 q+ P2 n- K
while 1=1 do) L# `9 m p$ g! [, g
begin
+ L- B8 w+ m' o5 i# D. I* @$ G wait for 1 sec; S. o3 O! Z. D r, Q5 J
create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
- D3 y& a. q8 J7 \0 }* Z end& s: _ S S( c+ S" a
end
9 D5 R4 X+ C) u; b. u7 D6 x+ \" z8 M6 p, d: n$ z5 Z. n# I
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |