|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. \. o! K& Q2 J0 }4 B" x" D) L
" I, q. M3 `& O* K( ^% m我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 O( c w8 X7 a O% J1 f) L2 H2 l: I+ Q4 b2 m
begin P_read arriving* |$ K/ k$ ^) J6 M$ Y3 b8 A
while 1=1 do begin) T5 J- ~9 R( J1 j
read A_tote from "data.txt" with delimiter "\n"% R4 D* V+ y" a, s* ?
read A_time from "data.txt" with delimiter "\n"
. I& F" }1 x! w& u. l, U& E% R read A_leave from "data.txt" with delimiter "\n"
1 S* ~* |1 T; P read A_picks from "data.txt" with delimiter "\n"; ?. E2 c# ]# o; T2 O# @
set load type to A_tote
( Q: B. ^/ O e$ `+ ^ if A_tote="tote 1" then set A_induct to 1: c* X; V& }% {; q, T/ J r& {
else if A_tote="tote 2" then set A_induct to 2
. }( v0 t/ z. X. W& W else set A_induct to 3 + i3 z. R' x$ R3 l! Q
set A_i to 0( \3 ^" }( w3 V! \$ U) @6 f( d) b7 t
clone 1 load to P_induction
# Q+ J) R) o4 D! u: T: g wait for A_time sec* e2 L+ J. A/ b- ^5 h* B J
end2 F1 ~8 n; ~" q t
end( |% X) n% A! F# J0 p$ u& x3 ?2 K
! z2 o" W) I) e# s2 P) Q" \) zbegin P_induction arriving
# u. Y: b. x. \: s T' ^ if A_induct=1 then clone 1 load to P_pick17 @8 ?; c5 r4 ^
else if A_induct=2 then clone 1 load to P_pick2* X, B8 u; F+ g# L6 R
else clone 1 load to P_pick3
$ l$ V6 m1 J8 p3 `end$ a# q; c$ k8 ^, Z9 [* E
8 x( G: J: C4 L& C3 Q3 Tbegin P_pick1 arriving' L# ?2 X: n* Y& V: _
set A_i to 1
) c, k: b7 ?8 b! W/ x8 Q( |( ~ move into Q_induct1
! F5 }( ^4 u0 P: |4 F move into pickaisle.induct1) y! R1 `+ `% |4 i2 f
while A_i<=30 do begin* F6 L' C1 H" m2 v/ W8 V) a( a, K
travel to pickaisle.con(A_i)$ M6 y+ n* U2 R& ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ a" @+ U& z, l3 y ?6 w else wait for 10 sec
% p& B3 L' B3 y6 K: E if A_i=A_leave then send to die0 E1 @1 K) |" R+ j; C8 N
else inc A_i by 1
0 L' y0 j( u8 S& A7 I) e end* ]8 W/ J5 \7 i* `. W' J
end+ c- M) P" Y) r6 }- d
G. ~: f) O [3 y) u
begin P_pick2 arriving
* X6 S8 L5 x8 j" q. E set A_i to 114 ^2 ^: |- Q3 p
move into Q_induct22 Q0 ]. f& Y# K2 e3 p( q
move into pickaisle.induct2; K$ R8 `$ O! H) m1 K( g5 x% B# e& {
while A_i<=30 do begin* L, z# Y0 Z* _; Q5 p$ B
travel to pickaisle.con(A_i)
3 t t# P% }' Q7 m5 b6 R/ J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& p7 k5 b# H0 Z else wait for 10 sec7 _! P2 f6 n# Y* P" b u
if A_i=A_leave then send to die
8 e5 o f/ s. v. K3 s else inc A_i by 1& i+ t5 {7 ~3 y' f+ O
end
1 A1 N4 r& I7 h% ~" Q& Xend6 W+ d T. `" Y4 E/ F; s# V
# a1 E# O% X' Z: ybegin P_pick3 arriving
2 A: ? `+ W' `2 s set A_i to 21
9 o" ^8 |8 U; s! ]' p3 ^ move into Q_induct3
8 Z% w; _" V) z move into pickaisle.induct3
% }+ t1 h, l- B% j$ B( f8 [% B+ n; F$ o while A_i<=30 do begin* b3 h8 H/ S. ^1 v
travel to pickaisle.con(A_i)
1 M Z- z3 H3 P/ q: j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 P$ i# _' H6 z; F; ^: ~& k
else wait for 10 sec
9 X# w9 D7 c: h/ T r if A_i=A_leave then send to die
1 y% Y% v+ ]9 P, z( j else inc A_i by 1/ f3 u, g( D5 F9 j e4 [
end# r6 _5 u$ }2 ]/ I# Z9 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,其它按你的 ...
|