|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 ~7 x& G4 j# F. ~
( q# [1 ~% B7 l ?6 _1 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中的数值,不知道会不会有什么不妥。+ _7 X' r1 |" ^6 n5 h* Z
1 n9 Q. R* k- X& ], i
begin P_read arriving
% f/ j- [9 @+ B5 `" I, ]9 {5 T while 1=1 do begin% @8 f/ @+ f/ |* u0 F
read A_tote from "data.txt" with delimiter "\n"
" i. w% U$ ?0 i3 O5 X- J read A_time from "data.txt" with delimiter "\n"
& r* u3 q# e9 D2 _; _, | read A_leave from "data.txt" with delimiter "\n"7 A f! N/ Q! C! E- O( b% U
read A_picks from "data.txt" with delimiter "\n"( N+ `4 X8 W6 K$ f" k3 L9 E- `1 s; W
set load type to A_tote+ Q# j+ K- I3 w0 Q
if A_tote="tote 1" then set A_induct to 1
, u4 E! w* `3 D* ?' Z9 i2 Q+ a/ r else if A_tote="tote 2" then set A_induct to 2! Z* m4 w3 t' d- K8 n$ ? B
else set A_induct to 3
+ Q1 N: n0 l( o5 O4 g4 J set A_i to 0
% c- i9 l8 F( a" l# F clone 1 load to P_induction5 [. N$ ], [+ n& I
wait for A_time sec
6 _% e6 k) ^& G( x. v0 k/ Q- [0 t end0 H( d, Y$ q' S
end- u, N' R# g7 `7 F& M2 [
9 h! J* V3 a& C* O6 abegin P_induction arriving, ~: N8 a* l7 S* c6 W8 U
if A_induct=1 then clone 1 load to P_pick14 ?) g0 a% ]8 ?! n a4 S) C w
else if A_induct=2 then clone 1 load to P_pick2
) y- d" u' L+ ]: M' c6 r else clone 1 load to P_pick3. |- H# w! W7 k3 b, r
end, @$ U& p, }$ F2 t! T$ e
8 r: t6 X, H* C, G1 {2 m% Tbegin P_pick1 arriving5 J, J* n# ?, f) R& h; F* V. W
set A_i to 1
& H& ^% B/ |$ ~9 ^ move into Q_induct1) k( Z& V& j0 N! I2 o, [
move into pickaisle.induct1
" t" L2 H1 Z0 c( l# L while A_i<=30 do begin
. s, x2 ^: ^# s1 `: @ travel to pickaisle.con(A_i)( H/ P2 b7 h4 J$ n6 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 k, S( |& _5 s6 m. E' D else wait for 10 sec
/ H$ w* p2 P7 d7 m7 l% h& M if A_i=A_leave then send to die* q4 X8 e- x4 g
else inc A_i by 1
& L- y9 M4 R7 \- L- E end! d* ~) I, _ e" z
end
$ V9 M. u5 V" M
% b$ J, v( S& j }& x, lbegin P_pick2 arriving
* `2 m7 x, t7 {& |' W) C, _, v set A_i to 11. I" A' C4 g: Z& O. L0 {
move into Q_induct2
! u# |# {& M4 \1 M3 _ move into pickaisle.induct2
1 T5 t1 i' {$ ^2 |/ h: B while A_i<=30 do begin, u" u, V; C' {
travel to pickaisle.con(A_i)
3 W# A2 m* \; k9 w7 f% d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 A9 I0 c& @* W. `( Y1 J8 Z4 n else wait for 10 sec
3 w! s- Z( E8 H- J$ u if A_i=A_leave then send to die- }$ G/ B' n! r# \
else inc A_i by 18 _ U' A6 D, a; M
end
3 \+ u3 y& q$ Bend
( P3 H4 {; \2 d' [7 V( {* E3 t* x" u8 M5 D1 w
begin P_pick3 arriving" @9 ~' l8 [# b; \
set A_i to 21- Y& E$ s; Y+ j7 l2 W
move into Q_induct3
4 u' G* n+ q2 i5 o1 F move into pickaisle.induct3( R$ k9 C' H& H. Q9 X
while A_i<=30 do begin
: M$ W l* b4 k: Z( V, d travel to pickaisle.con(A_i)1 A5 d+ y0 m) s9 f! J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( Z& A/ Y I) n+ a; s! l
else wait for 10 sec
" C$ p+ u' I H; D if A_i=A_leave then send to die* r+ t9 s( a4 B3 r Q
else inc A_i by 1# p( G" r( v* S" z0 `
end
+ u7 @ M$ s: zend |
最佳答案
查看完整内容
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,其它按你的 ...
|