|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 l2 y, S. p$ x( x* P+ I' M8 T% C2 x" z) n. B# v7 X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 h, i: W( i0 f$ d# w
7 G! V w2 t* Dbegin P_read arriving ?" m6 n+ E/ v' \; e; ~
while 1=1 do begin
0 ^5 }( k0 Y3 f% D9 ^7 b) b; j read A_tote from "data.txt" with delimiter "\n"/ M. U. W5 ]. J( \8 \2 A
read A_time from "data.txt" with delimiter "\n") C' U; ^% D: Q: z* H
read A_leave from "data.txt" with delimiter "\n"
- G' K }/ D3 \- u2 Q read A_picks from "data.txt" with delimiter "\n") U. j, p$ U( b' f% o
set load type to A_tote' e( y) ]2 W# z) [
if A_tote="tote 1" then set A_induct to 1
8 U' s/ P- H `8 R9 Q. B: Z else if A_tote="tote 2" then set A_induct to 2. b5 V5 Z4 l5 |# }9 A
else set A_induct to 3
4 f/ Z8 E9 N; d1 U4 s1 J" |; \: l G( ^ set A_i to 02 T: K$ T- L2 C* Y! @
clone 1 load to P_induction
' {; ^7 G, J; N6 y. k7 R1 U wait for A_time sec
; n( u6 F* o& g& ?9 p" g2 Q! D end6 Z0 Q0 r: l* j6 r, d3 f9 `
end* R, z9 E+ b0 W& E2 V/ e
0 g( q, c# ?( b& ], L6 lbegin P_induction arriving+ L3 P( S+ p9 f+ M4 w4 p
if A_induct=1 then clone 1 load to P_pick1+ d4 N( q) k' n2 b4 A1 F5 |
else if A_induct=2 then clone 1 load to P_pick2) r' A9 o' y6 Q% P& d0 X0 [( W
else clone 1 load to P_pick3
3 c, S% I$ V }: P' dend& N* R. e' P; ], _0 G9 @
: R- ^* {6 s9 A% z# E$ p3 r, ~/ v
begin P_pick1 arriving
) w0 I* d7 M T set A_i to 1' c' g/ M M! t8 l: z; b* ~
move into Q_induct1% M' V0 u7 l2 w7 B# f7 G
move into pickaisle.induct1 I: q7 _4 s0 f6 g0 }% F2 d
while A_i<=30 do begin/ g. m: y Z! P% ]
travel to pickaisle.con(A_i)
( Z4 H' g) I- v$ }- K, x7 _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ^' P, K; O4 c7 y else wait for 10 sec
7 d* z; n3 `+ o( l j if A_i=A_leave then send to die
& b7 b/ _; H2 Y) L% z! K else inc A_i by 1* ]" w, T! ]/ n* j6 L
end
& u3 Q' K& D6 E: Z, [; } cend
. M) w/ w& \6 S, `" k% L v' X( m$ h; W. R% t, u9 e& B
begin P_pick2 arriving
, q" k( m$ s; s7 B' e5 I set A_i to 11
, B1 z# D2 A( O% z move into Q_induct2
6 L; _6 t u; j& E move into pickaisle.induct2
' m& ?# u# G' K8 l% W while A_i<=30 do begin5 I- A' F6 j' w9 }
travel to pickaisle.con(A_i)
3 d: D; }% Q" X: E4 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 I# K9 s) o4 T; |
else wait for 10 sec. u4 r( Z( M' h {
if A_i=A_leave then send to die
. ^* ~% f. {3 I2 ]& ?) B" w else inc A_i by 1' Q1 n: }: N8 |! Q
end
! j1 w5 D$ K) g9 C! Dend5 c" u/ W0 D/ z( F" q/ \
/ y$ e( Q5 g7 ]8 |8 b% a# i
begin P_pick3 arriving! M3 W( l$ w- o4 E' `
set A_i to 21
& n: U0 l% O+ r) w! @ move into Q_induct3
" t p' C8 n* r move into pickaisle.induct3
5 T8 x8 ~& I6 A4 v5 P) L: k while A_i<=30 do begin
1 V4 k5 Y& E- q) | travel to pickaisle.con(A_i)
0 c5 ^0 f& \# O8 u$ t) i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ E1 m: z4 h1 w: w! o
else wait for 10 sec
$ u' c$ B: W" o) |; p if A_i=A_leave then send to die! b5 }: {5 `8 @: @9 H$ q+ U9 q7 I, ]
else inc A_i by 1
' Q# A/ J9 \1 A, I# B1 b# ~3 i end
1 h8 w6 W+ x4 w- W! ^end |
最佳答案
查看完整内容
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,其它按你的 ...
|