|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" P1 |# R% z5 r) ~2 x' o
1 `2 } {8 H P: r" k$ a我的问题是,在每个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中的数值,不知道会不会有什么不妥。, j- D# x |; O$ L% F" L D# O
3 b- C/ N3 U7 Q4 D. b% S' I$ K7 ]" cbegin P_read arriving; ^& ~% r1 |) T5 M
while 1=1 do begin
7 }+ O) _8 ~$ c( Y, b! f read A_tote from "data.txt" with delimiter "\n"
: l2 Z8 k+ t U4 d1 U6 c8 F read A_time from "data.txt" with delimiter "\n"
- ~+ `- Q& ]3 ?, e read A_leave from "data.txt" with delimiter "\n"
: i4 ]( ?! o: z read A_picks from "data.txt" with delimiter "\n"% n) Z3 b; V% R9 G# o
set load type to A_tote
" ~' p4 r: Y: ]: F if A_tote="tote 1" then set A_induct to 1$ e g* V* L, ?+ q3 A1 `
else if A_tote="tote 2" then set A_induct to 2
% U: t0 Z1 \4 P2 v3 i else set A_induct to 3 * U5 A$ a8 l ?8 H4 C+ W
set A_i to 0! ?; z1 Y8 C" J8 b* ~5 Q6 z
clone 1 load to P_induction( K# I' e; F3 W2 H9 V
wait for A_time sec
2 C' n8 \) p* Q2 N end
: y9 W. M6 D* P! F: pend5 J9 O' Y% s4 r, k+ ^
, q4 }. @1 m0 F* H
begin P_induction arriving
- k. J2 a3 F" I5 c: E4 E. U1 [ if A_induct=1 then clone 1 load to P_pick1
b( Y" x% Q, s" m else if A_induct=2 then clone 1 load to P_pick2+ b/ A4 h( e2 X& o2 Z
else clone 1 load to P_pick3: w# ^. L- |; Y- [# B
end
2 o7 C- d6 w5 b; n5 { r+ s
& T# H+ t: ?! N) ]begin P_pick1 arriving
; v' T K! `" @! n* ?: g set A_i to 1
4 ?6 a \* B* Z# k9 M+ q4 U" i move into Q_induct1
0 u8 y8 h; ]2 n4 b/ p move into pickaisle.induct1. a( a# ?2 E1 y- m
while A_i<=30 do begin+ j9 G0 Z# a. Y% @; r
travel to pickaisle.con(A_i): n/ m7 H3 u. Z6 K5 }: ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
r2 e1 _& z" U$ @$ S else wait for 10 sec
6 m, v9 @5 z0 _6 E- ?' N4 l if A_i=A_leave then send to die
9 a+ H7 K; u/ J- R8 T% r! e else inc A_i by 1& E I& N/ Z- H5 V- g/ q2 {$ g4 L
end) q: E/ i) m" w. d# [/ L7 `# N$ Y
end: R/ B- K$ | D0 m2 Q V: Q3 C
0 I/ S: z1 P% l0 xbegin P_pick2 arriving( i4 O& h1 ~$ M z0 `4 A. w
set A_i to 11
& @8 `. r A! a move into Q_induct2
3 |4 w- ^( R+ a move into pickaisle.induct2) y- E. s$ Z1 O$ \) Z) T
while A_i<=30 do begin
/ N$ b# d9 c8 J$ Y& } travel to pickaisle.con(A_i)
7 y3 P" M* i, w( j9 _, Z6 X, R$ B+ X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 `: d5 T( V& ~8 j else wait for 10 sec
3 b" J; ~# M5 N if A_i=A_leave then send to die
0 ~) b) l* O" ~& I. s, B else inc A_i by 1% y M& P8 I5 h+ U$ r! b, V
end
- I, W, G3 a( j/ h' Jend6 f5 m+ E1 v* {! A
4 N j8 O5 f; lbegin P_pick3 arriving( |+ E6 Y& B9 ]- X1 E6 w6 e+ ?2 s! {
set A_i to 21
5 ^ E& W6 \ z3 c3 F move into Q_induct3. P2 N8 b/ ~' m$ I
move into pickaisle.induct3
$ F% e" N- R; G2 t* r& a- b5 G8 d% u while A_i<=30 do begin
* e! J$ c4 z0 D H/ O- @ travel to pickaisle.con(A_i)
3 d" H$ R d$ b1 C' O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
h) Y8 @. I( P" _' H% V else wait for 10 sec
9 g# P! v- C# m' C if A_i=A_leave then send to die$ g, e' X# X2 h1 W8 D
else inc A_i by 16 Y. M7 D# ^2 U% P
end5 m. k4 s; e0 f! p
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,其它按你的 ...
|