|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# ?. `- W& N; u o4 o
+ h1 w$ D; F! T& t$ y8 R我的问题是,在每个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 N: S, g5 }8 l% ~9 ^" _$ N5 N. d
/ F. M! B% J/ A0 `1 X, cbegin P_read arriving/ u$ q' B- H4 k6 i: X$ |6 e
while 1=1 do begin
3 C# `) ~8 n2 t& O read A_tote from "data.txt" with delimiter "\n"
! k/ \$ ]! x) L& t read A_time from "data.txt" with delimiter "\n"$ u# w3 E" `; e6 a) O
read A_leave from "data.txt" with delimiter "\n"
# o! p" q$ F4 Q N }, D read A_picks from "data.txt" with delimiter "\n"
- {0 C% a1 H- I. F4 X/ } set load type to A_tote1 \2 L/ N8 p7 m9 d2 N1 A2 a
if A_tote="tote 1" then set A_induct to 1
# X4 h6 y1 i- _+ \" |4 c1 I- v0 O else if A_tote="tote 2" then set A_induct to 21 x a+ c' J0 t F0 z' o& B
else set A_induct to 3 # [" x m& d9 Y# d( f
set A_i to 0/ R( F$ v. j! w* Q# ?) Y
clone 1 load to P_induction
0 N6 z0 E: F$ L) K, `" S wait for A_time sec
; A, }& y/ S7 l end5 y- S, X1 o3 q. P/ Y
end
/ D& ]; ~+ P: H# d( c
8 l- Q+ b* e8 _/ w3 Dbegin P_induction arriving3 E3 ?/ m% G! n$ ^7 u
if A_induct=1 then clone 1 load to P_pick1
, t- H1 C9 u) | else if A_induct=2 then clone 1 load to P_pick2
7 a; c- S6 L8 a: n0 }* L else clone 1 load to P_pick3
- z$ J5 f W7 S' _; fend( T9 @* a! _. b7 X% H% J& [
, `3 ]) @$ Q- @+ p" t* \begin P_pick1 arriving+ z. b+ R! Z: K5 X$ x' Y6 s$ s) ?3 M
set A_i to 1
. C- }5 c- D3 K# X( | move into Q_induct1
7 }1 j% m6 p, |% Y( d* G2 f move into pickaisle.induct1, T3 P; e9 C! Y4 h
while A_i<=30 do begin2 W8 Z b) o# _: T! L2 w& }: q* h$ R1 }
travel to pickaisle.con(A_i)4 t# F2 ~0 V$ O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! n' K2 A- D7 R. v m& u
else wait for 10 sec
7 v% |, o g; o3 Z if A_i=A_leave then send to die6 U h! l3 Q0 W. B
else inc A_i by 1
9 e1 T5 a/ `) Z" v end
: Q; p$ K/ d( {+ pend
- I" n, z t- G1 p" `0 _( u5 S
4 ^- @' t: p- h& \' t" ~, vbegin P_pick2 arriving! `& L& a7 r# |( R( R8 A( K- m
set A_i to 11+ o) b% U4 W, @: ^& S9 y9 Y" t
move into Q_induct2
: ^4 m# q/ i# Y2 a move into pickaisle.induct2
( c; _( e4 g( F while A_i<=30 do begin" M) O1 }% b! _
travel to pickaisle.con(A_i)0 X5 e% y3 c7 x f2 r0 f# ` l1 N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ^, d1 Y$ j# g' y
else wait for 10 sec
) t& e* E6 T% j7 A if A_i=A_leave then send to die9 I" _( G: \0 h* ]- w/ _9 J
else inc A_i by 1
" ~9 H9 X& U# U" k3 V end
* p, j& m, Q+ N; e/ \/ l1 cend
2 [3 I! H, K, [- i9 I$ Z1 e( u
1 _& T: \ B. e7 C/ Fbegin P_pick3 arriving
" N6 s: z0 V; K( K set A_i to 21+ Z4 X% N) K4 l* }/ z G' B" ~
move into Q_induct3
) s- \" F3 i; Q; C move into pickaisle.induct3) S. Z1 W0 z7 @& r
while A_i<=30 do begin
w! n3 t% J' T9 b$ M# a. C travel to pickaisle.con(A_i)
3 R! S3 L: ^7 G& z9 N* K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" G2 _1 Q8 s# y) } F0 I7 D
else wait for 10 sec$ R# P8 h3 C& ^+ o" O# {
if A_i=A_leave then send to die/ F% a8 j. _1 f) a. [6 v$ r8 G1 `
else inc A_i by 1" `: H1 J& B; W2 a& @/ M
end
2 R( s$ ^: r, z3 }/ c6 w* q6 l# e* W& Fend |
最佳答案
查看完整内容
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,其它按你的 ...
|