|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( m0 i& Y. a2 a ^. P; d8 l
+ b5 ^: P% t) s我的问题是,在每个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 L* W0 S# u; l d& F+ \1 D
7 G L4 ]0 j- j* ^/ abegin P_read arriving
8 o9 {2 {# L. d* A! @! L while 1=1 do begin! b1 O1 |9 |& O1 Q5 i$ B
read A_tote from "data.txt" with delimiter "\n"/ {0 A1 y; \- h4 E
read A_time from "data.txt" with delimiter "\n"
" q; r$ l# p5 b5 I" z1 ^% ? read A_leave from "data.txt" with delimiter "\n"1 ~; s9 Y9 z5 k$ z7 C0 U
read A_picks from "data.txt" with delimiter "\n"
/ K; p' f' I2 s- c2 I5 c1 R, ]; u set load type to A_tote( u3 j1 c; H- h: Q# v5 v2 C" q
if A_tote="tote 1" then set A_induct to 1! V, |$ }& ?8 f0 P! Y* h4 ~
else if A_tote="tote 2" then set A_induct to 2
9 z) Z, S1 ~+ T else set A_induct to 3
8 S% X% t, q+ R' D0 ^7 ^ set A_i to 06 a. s* M' W2 C- k& d
clone 1 load to P_induction# _9 N/ m' n1 B, t% d3 U
wait for A_time sec
3 ]) u, ?! n& i8 S1 V end8 D- f/ }' Z. q$ q' q
end
1 y" x: N# f ^1 G) y% f% u. a& m( f
begin P_induction arriving
, ]# l( a1 n7 E3 O+ K0 }& C if A_induct=1 then clone 1 load to P_pick1
- F5 J, U7 m: Y" g! k8 b else if A_induct=2 then clone 1 load to P_pick28 }" h r, [! w
else clone 1 load to P_pick34 i' g5 C$ q; T) Z4 N7 U2 F% g
end
& ]- Q: X4 o1 J
. h! _6 G5 n5 obegin P_pick1 arriving7 A* D( I q/ i: h) M
set A_i to 10 e- o4 I' ]3 @5 q1 P8 r
move into Q_induct1) G( X; {" @: v: b0 a
move into pickaisle.induct1
+ n' r) W7 i/ G. |3 ?, f1 e while A_i<=30 do begin
* _$ Z- r( |$ b9 z. o8 j9 ~ travel to pickaisle.con(A_i)2 u4 N8 d, i6 b$ [' u, M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& ]# {. @: t2 C! I
else wait for 10 sec
) J+ f' A# q5 a" y8 {* x6 j. o if A_i=A_leave then send to die# ~, N2 ~% _/ m: R& E' Y; x
else inc A_i by 1
, N, N8 Z5 B; p, K0 E; h& o% d; A$ J end
: ]$ G8 s; j+ U. Yend6 n2 _* I3 O: X2 ? e5 V
0 u" \- _ j) n5 P' D9 X# ^& p
begin P_pick2 arriving
- R, v+ k/ G3 Y/ }) l: n* { L+ D set A_i to 11/ c9 j. b9 `- \5 R
move into Q_induct2
; N4 M& t4 @4 I2 ?% O1 B move into pickaisle.induct2
" e* j9 S' W% ~" J& U9 T while A_i<=30 do begin# @* R; C. r: c' [: S1 F
travel to pickaisle.con(A_i)2 U1 a2 Z5 `! w7 p! Y0 y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 ^/ W! H6 v( {2 ?
else wait for 10 sec
& X! M, X0 O2 U$ I7 D& A if A_i=A_leave then send to die
6 k/ @; ^6 ?: g7 w else inc A_i by 1
% B8 A T2 ?, \) z$ |" K end
. ]) \; p3 a# z2 R, P! Oend8 l8 h. g+ H, b( g
" |4 b' p8 F2 Y2 {begin P_pick3 arriving
; T+ u f7 q( I: ^: S+ m$ x set A_i to 21# n* `: } ~+ |1 J h9 S! g
move into Q_induct3, D) Y+ X9 g+ I' X( M
move into pickaisle.induct3) p- |2 G+ s* `, o1 j3 F
while A_i<=30 do begin" a6 C! i6 _9 @- C6 r$ a. g
travel to pickaisle.con(A_i)/ N' V: v4 Y$ A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ?! t( }2 j3 | else wait for 10 sec' J8 i b0 v9 n0 u5 v$ f! A( v" p2 J
if A_i=A_leave then send to die+ d5 s8 s* f6 ~( c. V5 N
else inc A_i by 1
6 l. G) C* ^* g6 V& b% [# |: W end' h% X' r1 |# f& M' P
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,其它按你的 ...
|