谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);0 ]; P: }% p- B, x0 [
begin model initialization function
0 O9 N2 r* d i1 t create 1 load of load type L_null to P_Creation2, z9 X4 h1 Q6 n- g, T
create 1 load of load type L_null to P_Creation3
3 r G1 {& z" r- s9 @ create 1 load of load type L_null to P_Creation4
7 Y1 {; r9 B. I return true * M1 N9 I/ v5 x& G2 ?/ w& m) d
end
6 c3 o& ~6 ` a" E7 e: }0 n/ o; ]3 | Y$ e. G5 z- `- W- l8 ^
begin P_Creation2 arriving procedure
" p/ N5 b# r5 ]+ K3 _9 lwhile 1=1 do* ~- L8 t% @3 {
begin5 a f% k8 {6 r
wait for 1 sec/ P8 O4 `0 X9 B2 U
create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)
+ y8 \2 a: z) f end/ [/ R. {% \* ]
end8 F' O" r! ~& ]4 j1 |$ z9 F
0 G. z; r" q2 H1 p3 I
begin P_Creation3 arriving procedure4 W* X8 h4 ~' V5 @3 q& P
while 1=1 do( Z- k7 b% B( O# l8 ]1 H
begin
- @* I4 \; }( }6 ? wait for 1 sec" \0 |) x, E2 d
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)( a- j. Z: P4 M# [
end
$ x+ J1 x5 a, P7 A% P- R! \end 7 B0 Z8 n3 B5 O7 a' N
, I: h/ _) U) \! E6 `begin P_Creation4 arriving procedure2 I/ e' K# D7 U0 D, x
while 1=1 do
# i0 D) b# D! f9 j3 d begin$ z# k* S% S/ J7 F" q
wait for 1 sec3 o% A5 i, X, k4 p/ W
create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
F5 K: B7 O/ n3 O9 J( ^ end5 d9 O7 _7 Z1 H( ^3 ]6 ~
end
4 t1 e2 }- {9 a% S, S4 U1 a" o/ D' P# {1 f( Z/ A2 i
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |