谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);
7 ^" K( I( \% X. x/ A9 F3 kbegin model initialization function
' H0 w$ r' A4 W, f! }, s create 1 load of load type L_null to P_Creation2
) L2 z! {; `) F" h! ]0 H create 1 load of load type L_null to P_Creation3) f. {0 K% Y6 x* f
create 1 load of load type L_null to P_Creation4
1 F% \+ w. a' z return true
, F, @' n$ p3 R0 C! ?: _5 j0 Eend* Y7 q* B" G( ^6 V s
* i( L1 X( N1 v. s* N; S) o" S7 Mbegin P_Creation2 arriving procedure
- e" J! J- ], p0 U, kwhile 1=1 do
, p0 {- E0 G" Q begin
+ e& r$ M0 }0 b wait for 1 sec! e2 B/ Q/ ^, U' O# F0 i+ U4 j2 M
create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die). z0 t; Z' p+ C1 Z0 E6 X) W6 C2 t
end! ^# n! C% O! A4 i/ \4 m
end
. d+ }* p; s1 J! D" a; q0 e8 x8 t# e- z9 [
begin P_Creation3 arriving procedure0 z# I& M; G: I2 a1 A. i
while 1=1 do
& k/ j+ k7 Q) X: ~ begin
$ r, Z/ I$ b0 l" U3 }8 x wait for 1 sec# Q2 }& o; ]2 x' H+ f% F" _) w! Q% B
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)1 T! k$ g* Z9 `& o: u4 T
end
9 S2 K2 x" d6 b3 ^& J1 dend " h% V; @, q& |: {
) S' \3 M5 o- g1 c, k, u9 h% u
begin P_Creation4 arriving procedure
6 [8 J- t# `+ C) w6 X' Swhile 1=1 do3 ^7 _/ k( E5 k# q: t* C
begin# A7 w" O! v7 K6 k- [6 C
wait for 1 sec
& a V6 p3 Q& ~4 ~" x% l create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)! \1 s1 e! W" F/ |
end
9 ]' H6 I8 c) ]6 aend9 Q( Q4 W1 g$ E( V! G( C
w' g. o2 L! h) V1 p: T) e
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |