谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);7 x7 D$ V: V4 J- m# \9 @* [1 `
begin model initialization function
, Q8 P, @' \$ B: ^& O' K create 1 load of load type L_null to P_Creation2
% {$ w- Y5 j6 [( }8 u6 M create 1 load of load type L_null to P_Creation3
2 e( r8 o {+ y4 d o0 p$ ^- q, t6 e create 1 load of load type L_null to P_Creation4
' p2 @: p, Z1 ` return true
) T3 V# z6 q( }/ Z( Tend
4 ?! D: D8 W+ S9 x& }1 n2 l6 b v# X
begin P_Creation2 arriving procedure
+ m/ o. o' I* c% B4 z. F9 N, o6 c* Swhile 1=1 do
; w+ X: _) [+ r; F begin
7 V8 {* q$ V+ @ wait for 1 sec
1 o$ ?( G$ y4 A* R9 Q$ C create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)+ W; a' u/ k' I3 i0 \
end
+ I4 }( T& y' M4 @end* f. q3 n, h- t2 L$ d3 ?& ~
$ N% G" i5 H& d) @- X$ p: `6 |begin P_Creation3 arriving procedure5 u& d b& D& P/ a
while 1=1 do0 L& c4 }, x( R( S0 y, w
begin
i' S2 I' l" \1 E# c wait for 1 sec+ \# c" [; |2 }) C/ G5 j% e
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
3 s3 z$ ~5 j+ t, s7 G& i end
$ z- P! J: E6 \* O k% I0 F) send
2 {3 n' f: i! Y7 V3 i
: K- r$ X; j4 \- m% gbegin P_Creation4 arriving procedure
* k, Q' c% ?: A1 Zwhile 1=1 do. F5 H- _0 X" G) D b
begin
7 @5 x% D" R2 v wait for 1 sec
! g4 e' }/ P* k6 { create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
9 ?" E% K& h. O2 h9 D! u# [ end/ e- Y0 @1 f7 O. j
end# P2 p- w4 N0 M
$ C/ F' d, }# t+ w/ v9 f* i但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |