谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);; n* ?# u! B) L: G* E
begin model initialization function
# M. N7 f1 n, [5 B" M6 F create 1 load of load type L_null to P_Creation2
2 u O" P$ q2 V: d! y create 1 load of load type L_null to P_Creation32 @! K7 R' k8 ]5 p' K2 C7 k% B
create 1 load of load type L_null to P_Creation44 B4 x& ~+ h3 C$ V; z# ?+ K
return true : | f: x1 z( [- z# F: Q
end( P3 ]7 }5 t4 {, o
% s* w, I5 z( D k4 {: {9 Dbegin P_Creation2 arriving procedure5 f# V- r8 x% B G0 }! b
while 1=1 do* A4 R) P. \2 \" O
begin
I, t! }* e+ j/ v: E5 M( A wait for 1 sec6 k1 b4 I/ A6 w! S; D$ X
create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)
* Q0 @, b8 ]: Y* o, N# }: a end0 ?% {8 w! G) w2 b9 Y4 V. i
end
4 L6 \9 J& \8 v! K2 x
. a$ Z3 f* Y) D w# ~. l9 T; T2 mbegin P_Creation3 arriving procedure
$ a7 O$ \ b- ?4 Mwhile 1=1 do
5 M2 x7 }/ _% Y7 `0 F% { begin- G% y, z% ]. f( A8 S
wait for 1 sec
+ `; Q+ I; W+ L" J8 K# r3 N create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
v4 r9 ~" q" |7 \# H" r" S3 w end
, t6 `# V( Y( a5 p4 j/ U8 D) P/ Yend
" E" m3 D) Q$ [: W: F% P1 j. v: p) ]0 v' {
begin P_Creation4 arriving procedure
/ w! s# R% N: E- L. n" pwhile 1=1 do
/ \; U/ z" o" v! v8 [6 } begin; D' {$ M# B w0 P* _1 B$ p) h6 Q
wait for 1 sec3 e3 C0 ?+ g2 ^1 W( g
create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
1 }' X" |9 k# B9 S* t; } end2 p! {, J8 M: t) N5 Z
end
9 m- @& e- Z, }. a& F
{* q- \" l6 C; s- a, s% k- ?但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |