谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
% Y4 q! ]4 w! e) f1 c% ]begin model initialization function
T# u; Z5 W- J+ ~( s M: o create 1 load of load type L_null to P_Creation2, M: z8 p8 p" [% ?5 d
create 1 load of load type L_null to P_Creation3
; Z! @/ ^( ?' L* _: d create 1 load of load type L_null to P_Creation4
$ r2 W( q" S$ l' H return true 7 J) w! h& t5 I, \4 I" {4 Z- m
end; t2 t3 \3 E! @0 w/ S
* F4 O) l: |3 V1 E, |begin P_Creation2 arriving procedure
4 d, s3 ~, z! b, qwhile 1=1 do* o# _1 [. M; }( [. Y. b @
begin0 U3 C, ]8 O& H& R
wait for 1 sec% r" H- c7 r0 }! |
create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)
2 Z0 `) i) e. j; z! v3 }3 @; U. { end: v. }3 u- w! ~/ G7 p5 b
end0 ]- }" l2 K/ k$ ~: y, N, B
& v: v _, U. h
begin P_Creation3 arriving procedure+ ?4 Q! a# D- q' c1 z& y
while 1=1 do. H/ l$ ^0 p2 B# ~8 k3 P
begin
' S7 \" r4 O% @1 V* e5 @ wait for 1 sec+ b$ \9 U# p; m' f) h
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
( Y1 G8 a9 X8 G% e end
% R) R3 S5 m) J" H! {3 A2 }end
6 J( G& K% g9 _
" \( Y E2 Z7 Y* d6 v* F$ u6 {begin P_Creation4 arriving procedure: M$ g% P3 B2 A. b2 }: W
while 1=1 do6 S9 {5 a6 r: K
begin
% s. | Y" N1 W. b3 S* m wait for 1 sec
0 G1 V8 s) G- c+ c. U5 j8 O5 h create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)2 W P; N+ [, C! B
end# i" I: |% B' [9 x& K
end
3 w/ M) v; g4 E* s7 x
/ s7 h9 Y4 h1 Z" i) q* p# ]; k9 {但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |