pickaisle.induct1/2/3是个什么东东?, F' h' { z: v" }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ C6 l' @$ U2 W1 e& x2 v6 i7 \
! n, A" G& i# f, S2 M! ]4 [
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 y" c; }8 m/ b# M" A1 ~. o
/ [2 H4 L' Y8 M1 I7 G1 d% p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# U3 Z/ @. n) D4 v3 k% B( A' s- r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% V- k( j( z- S. V5 O! r9 {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct; ?+ @; o, ~1 n. c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 u' J+ V# p4 k& ?begin P_induction arriving5 U6 _$ K7 T* G9 |# R6 C
clone 1 load to P_pick(A_induct)3 p/ [, k9 P6 {' u% [( y4 z+ N+ V
end最大的系- m4 s$ B. ]; ]" ` y7 f
, M N( [0 p3 h, Y5 ?begin P_pick arriving
1 v3 n: v- U* ~1 n- e set A_i to procindex * 10 + 1
j# w, o3 p+ D# f. v. ]( h move into Q_induct(procindex)/ \: M* G: s+ w, f. |6 g, q# H
move into pickaisle.induct(procindex)
, C4 o4 d: B/ J; f* Q$ ? /*check the type of pickaisle.induct(i), for your last problem.*/ s/ p8 A$ i8 v
* a3 S; H' Q l# I7 e
while A_i<=30 do begin; H! F; R& e9 F* \" I, z o
travel to pickaisle.con(A_i)
( j1 g4 Y/ E. W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 F* x3 W0 [1 T( F- n else wait for 10 sec
7 T9 y# b/ Q$ x- c if A_i=A_leave then send to die
- W7 b3 [, z O else inc A_i by 1
" t6 U1 O/ T! [8 D end6 T" g: O B$ x4 }. ?' B
end
# @4 i0 E9 W, F& A
O1 t8 b9 B9 o k其中的procindex为整形,代表当前process的序号。
- a& ^7 J% ?2 `4 a6 |station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。 |