谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);! }- X" ~ \& v- ~4 P' r" A9 l
begin model initialization function6 G+ b; D: J8 }6 m3 ~
create 1 load of load type L_null to P_Creation2; K. @* R: s9 L# J
create 1 load of load type L_null to P_Creation3
; f, ?. _/ i& ^; G/ g# o create 1 load of load type L_null to P_Creation4
* R3 ^& Q4 i% b4 J( ^7 X9 f return true
& S8 E, [+ Q1 M! @end
+ C3 ?9 x1 ^' c) B, {3 K4 d* l' y' {! N; J; C7 ^
begin P_Creation2 arriving procedure
: N u3 L6 A- y7 R! e; p. L/ Mwhile 1=1 do( u- q( g4 E. i( _
begin5 d6 |) Q; T4 S; D5 V
wait for 1 sec7 B, B& [% Z& X5 u
create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)8 |, g) k P6 S& D" U7 t* |
end
- P; E- _. {$ X1 d! d8 Wend) M$ }- p: {6 f2 \ ^
3 O+ N& `6 X- O; d
begin P_Creation3 arriving procedure4 o) c4 l9 I) h( ]7 Y/ ?( r
while 1=1 do6 D& C! H( E. \
begin7 s; M5 w2 P4 p4 W- g& R
wait for 1 sec9 Z! K& E, B- w4 `
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
9 }' M; W; z3 i% m- q end
) M. X% n9 u+ w' l; O2 zend + O4 X l- K: _1 W, S7 q
" x2 { R5 ]' Bbegin P_Creation4 arriving procedure
! I ?1 P4 r5 r) v' V4 Hwhile 1=1 do
' N) s6 F& g# y$ `6 N* u7 m begin
' u, E6 X+ l# T& ]* L# U wait for 1 sec
' |& F- b+ O) k, ? create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)( q6 u. S0 r/ ~2 C
end8 B/ X d) c! W
end
# M3 B8 _; C. D7 E: H3 k8 x1 [! P$ V
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |