|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 _: u* N5 a8 o4 X9 a2 U
. R$ y3 p8 v' t" Y6 p, J& T我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 ?) w6 \! G* p( w
* t% Z2 Y3 k+ I1 z% @- r
begin P_read arriving6 p) H1 T( M* K! V
while 1=1 do begin1 E+ C1 d8 M0 D, W
read A_tote from "data.txt" with delimiter "\n"
8 p) h; w. J) `( r2 e0 p read A_time from "data.txt" with delimiter "\n"# G1 k) `' F. q5 E a
read A_leave from "data.txt" with delimiter "\n"8 m/ _. \5 V1 _, P
read A_picks from "data.txt" with delimiter "\n"
& `$ I' v9 b1 _+ |6 ]6 T( X set load type to A_tote# ^& Q* ]$ A5 g7 q, _8 ~; L
if A_tote="tote 1" then set A_induct to 12 v! O. r: H w, M0 ]- Y' g3 W9 Y
else if A_tote="tote 2" then set A_induct to 2
1 P* B7 }! ?" q else set A_induct to 3
( Q0 \7 B5 I. o+ C set A_i to 0/ Y& Y3 N8 l5 O D6 C) W, l
clone 1 load to P_induction
8 z6 _* h e# G5 N$ [ wait for A_time sec1 o/ C# L! t( R
end
# f+ o, I% K; lend2 ~( g7 i2 f( P0 J% I4 q
4 Z2 M! F3 i: ^begin P_induction arriving3 ] U' w, O% Q# h- e$ l, Y R
if A_induct=1 then clone 1 load to P_pick1
6 I* u, X2 [& B7 X9 J: N else if A_induct=2 then clone 1 load to P_pick2; l/ {1 J3 r# H- h, ` @
else clone 1 load to P_pick3
4 [! L7 r8 d8 Z' g2 t( P6 F7 wend: M& a( e( l3 W% N6 T: B
. c5 e" {0 L% @0 S; K# H4 Gbegin P_pick1 arriving' |3 \6 \: }0 K$ P
set A_i to 1
4 \4 t i0 i/ z& Z" d move into Q_induct1
9 k* D* U) Q$ J6 t9 [5 X move into pickaisle.induct1
1 d3 k8 }( L1 q' z. e while A_i<=30 do begin
) X& a! o% p+ o) {' i% r+ Z travel to pickaisle.con(A_i)3 H. d: v/ E: `' A3 H! b3 K7 Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. J9 J9 q) S# X$ `6 P) s) m
else wait for 10 sec) S: a7 ^% J- ?+ Y
if A_i=A_leave then send to die
! v( ~1 b" ]3 P else inc A_i by 1
: L' `/ `1 ^8 m# u end
, {7 Z8 }+ |4 j: I) a# Yend: a1 ~& J. |( b
1 k X0 ]0 e. c- W1 t( i N
begin P_pick2 arriving
" m" Q& n8 T) J. m1 X, v n7 Q$ | set A_i to 11. e/ `) Y* U y% K
move into Q_induct2
. Y: W5 T; N6 m* S" l8 O: _ s0 g9 } move into pickaisle.induct2* f5 ?3 ~+ U# ~4 b8 \" V
while A_i<=30 do begin/ y9 u# q7 W4 `' G |0 F, u
travel to pickaisle.con(A_i)
; t* s! V; q7 ^/ a% S0 ~; r+ b5 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
b# a& W$ y0 f else wait for 10 sec+ G/ G' q; n. \( X) `6 d
if A_i=A_leave then send to die
* a, W% ]9 I+ F% `! k, l5 [ else inc A_i by 1$ N/ [; y! [- G
end
; G# T) }8 I; R8 w0 M' Eend
& e( {( r# s3 n% W+ P$ f6 T' m; [' F. `, I* a# O
begin P_pick3 arriving
8 T C) i: k* r5 t4 ~% J set A_i to 21
2 M$ F. T3 C r6 s) l( E0 e2 D move into Q_induct3
3 n+ _4 e2 K9 C# z move into pickaisle.induct35 B" W; q; b7 v6 I3 n/ I- l6 C
while A_i<=30 do begin
* C- M, d8 j- v& v travel to pickaisle.con(A_i)2 N( S9 ~7 M& B+ t# u5 S* O2 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 u y# h' P( a. S2 b5 O& M4 d4 k. S
else wait for 10 sec6 |% i" T$ h7 L6 A% Z* n2 W& H9 ]; |' ?4 e
if A_i=A_leave then send to die6 h7 i$ E% s( h$ z' U% @
else inc A_i by 1 I8 C: v6 n5 c7 k) R d! g
end4 n. U [- g# g5 V! d
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,其它按你的 ...
|