|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' @. f. ~" y" V9 ~) V- w' S' K d7 R: k, t) 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中的数值,不知道会不会有什么不妥。
( M: _, e$ X3 R5 S. @% x E P2 x- L5 w, {. _
begin P_read arriving3 Q4 f; F8 E9 S) G% m
while 1=1 do begin
! K* t# A/ E# J0 s# r% E" c read A_tote from "data.txt" with delimiter "\n"" k% W: F9 r+ E5 s
read A_time from "data.txt" with delimiter "\n"
) [0 e9 R E. Y4 y7 B/ L read A_leave from "data.txt" with delimiter "\n"
/ _0 q6 Z+ r, N1 C2 D read A_picks from "data.txt" with delimiter "\n"
- W! m2 I% Q% }- I$ n2 @( O set load type to A_tote
; o7 G8 P! `6 g. i if A_tote="tote 1" then set A_induct to 1
; F2 T" Y: L& o7 V8 `: z: G' W else if A_tote="tote 2" then set A_induct to 2& _$ D" W' z! q! C# A9 T
else set A_induct to 3
. E' L+ i- B1 U( }3 ?7 x set A_i to 0
3 Z- O1 M2 e" I+ C+ C$ u7 X clone 1 load to P_induction) A! n8 K I3 {% o7 R' |: z
wait for A_time sec
8 _" I O# l& O0 C/ T end5 y# `* p3 A$ N+ N2 ~
end
) ^, ?* }7 `7 [6 d& Z' Q* G0 t' I' R8 r {2 n% D
begin P_induction arriving
) Z7 r) o5 Q, M& i/ f if A_induct=1 then clone 1 load to P_pick1, t# Q& b7 y0 z0 U
else if A_induct=2 then clone 1 load to P_pick2
3 c6 R. f2 a, ] v1 C9 D else clone 1 load to P_pick3+ b- H+ a1 U6 D5 W2 l/ q
end( \4 ?- U; I! z- T
4 n! J2 l( Y) Q( j* P
begin P_pick1 arriving
5 w" Z( D3 O0 F. `5 i0 U set A_i to 13 |! g8 Z! |. j5 Y
move into Q_induct15 L* s& V8 P: {4 d" O# J# E# h
move into pickaisle.induct1/ y* b; D$ |8 n6 y) m( B- h: q' [
while A_i<=30 do begin* c3 a- Z: z( n# K. j: U/ \
travel to pickaisle.con(A_i)
9 K) e4 @7 {) {1 Q8 L# h) S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- g4 w$ s4 L) l1 t) J' {: q/ h* p else wait for 10 sec$ R$ s; ~+ L7 M! f* n# h' C7 O
if A_i=A_leave then send to die
1 m8 o9 e; U$ M0 D else inc A_i by 1/ `8 R& u$ F4 |
end) t ]" N: K [; L" b) {2 ~# E
end
3 c# a1 C0 I; @$ m" d/ C. P, s4 I9 s0 {. |5 k2 b' q
begin P_pick2 arriving
: X, p$ [( ~4 c; C' A& A set A_i to 11
2 E5 Q0 {6 C/ r# l move into Q_induct2
1 v) X4 G$ E# ~ move into pickaisle.induct2
+ W9 T% e! B! w while A_i<=30 do begin
8 P* ?* o, [* ~4 I; K3 ^5 D1 k9 F" X travel to pickaisle.con(A_i)
1 s+ ]. m5 H. v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 G( j% b+ V5 c8 L# S
else wait for 10 sec0 b1 `! B0 d, N* T% m+ P
if A_i=A_leave then send to die0 g w! s/ Y- W7 m( ]
else inc A_i by 17 F4 N. D) O. t8 K1 i* B- Z
end
9 p% y! b" y8 t1 J8 Z2 F4 Zend* s/ z. z$ G, ^* o3 j" G' l J
" M/ G6 v( h2 Q4 Pbegin P_pick3 arriving
E8 n2 p) _5 R7 _/ E$ ? set A_i to 213 ^+ Q# R1 w9 h2 {5 ^. T
move into Q_induct31 M- c; j' _9 E& ^+ l6 W1 c3 ^
move into pickaisle.induct3+ d9 y+ p) O, N' Y7 s9 z
while A_i<=30 do begin
5 v& J( \% I5 D/ A- S. d travel to pickaisle.con(A_i)
7 F$ W3 ~% C; [8 ?# ]& o- u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 T7 A$ N3 E% Y9 @' T) A$ N
else wait for 10 sec
# j" o1 s9 h8 A6 }' C- Y% G5 Z if A_i=A_leave then send to die! X( a0 y- u g0 }# m" D
else inc A_i by 19 c1 R* Y, i3 k5 R
end
; n/ a% P) M/ _, V$ lend |
最佳答案
查看完整内容
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,其它按你的 ...
|