|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ R! a! |: `2 x" @* K
; l9 X% ]0 Z7 d6 a! E C6 q4 q
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。( A+ E# p2 S: B1 n0 n
1 J/ D0 m) }% Ebegin P_read arriving: O& V1 b: t4 [$ Y, g
while 1=1 do begin) h# ?. \$ N7 d
read A_tote from "data.txt" with delimiter "\n"4 E/ \: v7 C. n+ F3 O" r; ?
read A_time from "data.txt" with delimiter "\n"! d0 f- X* r$ c* u! Y
read A_leave from "data.txt" with delimiter "\n"
& Z- U& M* @* i9 t% b3 i read A_picks from "data.txt" with delimiter "\n"; G- K4 m0 I# H* E
set load type to A_tote
' U9 M k3 E6 {! `! t3 e0 |4 H if A_tote="tote 1" then set A_induct to 1
% D. _0 H( y% b9 E2 w5 W/ w2 b else if A_tote="tote 2" then set A_induct to 2
( L4 l7 x s- U else set A_induct to 3
1 o( b3 F3 ^7 k& D5 o set A_i to 0
, ?0 ^6 I5 Q8 c clone 1 load to P_induction8 h# S' v5 L P5 p* \0 W
wait for A_time sec
: } t& v+ ]8 R end3 ^7 j' x: ^$ X; y) J' i
end& Y7 O( D* Q7 T6 P7 q
5 `: o; s/ s8 Z- J# _begin P_induction arriving( l! D2 W" H7 |; q3 I
if A_induct=1 then clone 1 load to P_pick1
4 q3 ^+ R; y, W* D- d3 D& I" }8 R else if A_induct=2 then clone 1 load to P_pick2 z* E# N$ E" s/ H& p2 F
else clone 1 load to P_pick32 [: e5 b3 U7 e8 W% Z
end
5 G4 y5 H* @& I) h4 N6 Z5 S1 R: G5 \, R- z7 U3 n
begin P_pick1 arriving
0 Y9 C5 [# F. d- v" O# o' u set A_i to 13 @7 R5 ~& b5 J1 H3 [0 Z, r
move into Q_induct1
- R2 S: |/ |' O7 D( O% o- q9 w move into pickaisle.induct13 D; A9 m* U6 O D% K8 a* B9 [
while A_i<=30 do begin! D6 E2 m4 o5 R0 R# y3 j( P
travel to pickaisle.con(A_i)7 w( |5 u9 T) Y" {$ c/ A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, p) W i7 b, g; [8 K# w, r else wait for 10 sec
5 m4 S' z! Y; S: B! h9 R if A_i=A_leave then send to die
4 x4 f: ~+ |# @5 U" |4 X else inc A_i by 1* c1 g u" i! f
end
/ E8 N1 Y8 E0 h5 send7 V0 o! d2 b. M3 T
2 y: O2 R4 p; e- u( w2 J, f
begin P_pick2 arriving1 }- c/ A( l7 ~4 N6 n) w
set A_i to 11
' d, D" a; B% V. s2 k move into Q_induct2$ R- r$ E8 ^; i" K3 o4 H
move into pickaisle.induct2
8 l d, x/ b' p8 J. j" s" V& _ while A_i<=30 do begin! I( a5 [1 [4 w* K Q
travel to pickaisle.con(A_i)8 S/ q1 O8 Q3 T& z* L0 ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 w. O" y( v2 @$ ~& h+ U- [# D else wait for 10 sec8 T3 ~. Z8 a0 J- l
if A_i=A_leave then send to die2 I0 G: D. \6 x8 w2 }
else inc A_i by 1
* @! \1 l/ h0 X" _ B& P3 D end
$ m3 Q8 L# x- G! x* N+ Y- o6 X: fend2 j) ^ M7 o0 u# B+ |. x. Y( [* G
5 ~: J. V6 c4 b7 j
begin P_pick3 arriving9 j* d _1 J( N5 K S7 Q
set A_i to 21
l. k" X' v* l0 { move into Q_induct3
+ ]6 H+ G( P5 K4 c move into pickaisle.induct3
5 I7 L% X U! |6 o while A_i<=30 do begin
" T( W- e4 b2 S) u( W" { travel to pickaisle.con(A_i)+ C3 p! N* c7 q( e: y8 i) Z/ C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; z* h C2 ?3 w else wait for 10 sec
9 y2 Z" P( z0 [4 h7 C/ E+ O- e6 o# s if A_i=A_leave then send to die
+ Y6 S |$ B# W2 J else inc A_i by 1
( W' a4 I2 { ^. @/ s" J4 Q6 k end
) R# q% P5 J* h- aend |
最佳答案
查看完整内容
pickaisle.induct1/2/3是个什么东东?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
|