|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& b1 d" X! c; [( b) e
+ C3 q( {, f' V0 j1 g我的问题是,在每个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中的数值,不知道会不会有什么不妥。! Z$ Q2 T) q1 s) G
2 P$ g' e- a6 w- m* i7 n
begin P_read arriving0 g3 g8 K `+ Q3 X) e7 Z0 k: J( e) p
while 1=1 do begin
% c1 ^% p% |% u* D, O3 `# T read A_tote from "data.txt" with delimiter "\n"2 `7 g$ d8 x3 B3 N2 B6 i o
read A_time from "data.txt" with delimiter "\n"( E" C) U- U$ X2 T/ r
read A_leave from "data.txt" with delimiter "\n"& B |0 v# ?( B' g1 V7 c& B' W# o' r
read A_picks from "data.txt" with delimiter "\n"
% A% w1 H" ]9 X5 N" r) g4 o set load type to A_tote- [! f& m$ L. V2 D8 a9 T
if A_tote="tote 1" then set A_induct to 18 Q; F( \" B+ B! t' W- O
else if A_tote="tote 2" then set A_induct to 2
. S; M& I2 N3 ^ O1 ~( p else set A_induct to 3 ! w' q" ^ _+ l! C' h
set A_i to 05 ]5 e7 u* O. G' }" p* w1 e
clone 1 load to P_induction% S) i6 B; {# r
wait for A_time sec% Y9 ]( G3 y+ j9 l9 B6 D
end
# A% H4 d o9 v$ x/ \end
) [' W. h Q3 _+ C8 n. ~ k, }8 L' \5 |: L
begin P_induction arriving3 _2 K& r& u5 m
if A_induct=1 then clone 1 load to P_pick1: P; q3 y' U( S; j
else if A_induct=2 then clone 1 load to P_pick2
; B' P A9 i6 h9 N3 k else clone 1 load to P_pick3
2 k7 p( }: E: l1 y0 ~- y1 n5 `end
0 W- Y1 ~' y: Z0 [6 p- |0 o9 |0 `4 R4 I2 }- G& p
begin P_pick1 arriving/ p3 j6 ^, r, V6 q, ?/ H
set A_i to 1: i8 w* |- e) i$ P) x n: J
move into Q_induct1
1 }; B, n8 c- d, N( G: Q/ ` move into pickaisle.induct1/ D* r4 V1 c& s$ ^
while A_i<=30 do begin$ t+ U) S) c7 |
travel to pickaisle.con(A_i)( v' K& O u" U* S) E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! m6 i. M$ k* ^4 p& d else wait for 10 sec
% Y3 q$ M s! \ if A_i=A_leave then send to die" U% o8 ]5 v+ z& H& U& X
else inc A_i by 1
, |. Q: M, r2 R end+ J/ h" A+ G, B
end
1 B: x1 `3 L' U3 ?# R% }. t6 U* Y
begin P_pick2 arriving& R J& n: U& n1 ]: D
set A_i to 11& T/ a! m* D) [# |
move into Q_induct2; s/ g- [" Y! ]4 x
move into pickaisle.induct2( a* g5 M- [" m) o
while A_i<=30 do begin6 [: I! U+ ~3 e- A
travel to pickaisle.con(A_i): Y3 G/ E& l! O5 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) t) K' X* T# ]2 E
else wait for 10 sec$ `( ?4 D, N: Z! _
if A_i=A_leave then send to die x) S8 @ ^3 M. Y! w. @
else inc A_i by 1
! s7 }4 X$ Q: ~ end
! @* n1 V, U' G. |; Hend
# V/ [ E2 w; s' S6 K3 v8 _, c5 a& x# P. f" { x, D5 I9 K
begin P_pick3 arriving
3 p6 G, s1 P$ H5 x, E set A_i to 21
. v( M# t) j1 {$ V move into Q_induct3! N$ t, {, p+ u% s
move into pickaisle.induct30 Z% H4 a. D7 l0 ?8 u7 E. H. |* r
while A_i<=30 do begin
9 x" M( l/ R; c4 O+ ] travel to pickaisle.con(A_i)
1 n7 U( |5 u/ C4 a% o; E" r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 K# b9 G% [4 B( q$ C7 J( o
else wait for 10 sec
, `) U1 q% o9 d* D if A_i=A_leave then send to die: x! X9 n4 A; s7 s" c4 N0 J8 F) M
else inc A_i by 1
+ l# w% f1 I' P end
5 x4 n9 ~1 L9 O) P6 o6 Z4 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,其它按你的 ...
|