|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 M2 l3 {$ a" M6 P0 D; B
4 _0 c* r$ c+ `3 Y8 {我的问题是,在每个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中的数值,不知道会不会有什么不妥。- k7 w9 w7 y) ^" h; N
+ Y$ v( G( z. g; D2 vbegin P_read arriving* \& x# U& R- x. y) C M
while 1=1 do begin
! z: s$ N; ^. c( R( ~+ C8 } read A_tote from "data.txt" with delimiter "\n"
8 R7 H }; ]6 u7 U2 u% l read A_time from "data.txt" with delimiter "\n"1 G: U( ^7 w3 a
read A_leave from "data.txt" with delimiter "\n"/ p. k' B8 A6 _
read A_picks from "data.txt" with delimiter "\n"4 ^* X( d! \' h/ b/ A+ Y7 @
set load type to A_tote3 ^0 y5 a; e5 w; r( |0 P# y9 w
if A_tote="tote 1" then set A_induct to 1
2 S0 v) K2 G/ _, O F else if A_tote="tote 2" then set A_induct to 2. M4 ]$ F( |6 c: j# v0 `
else set A_induct to 3
1 n! Q c( G; [+ S" z1 O1 g set A_i to 0
% o7 C- ?; L; N/ |% W$ Z clone 1 load to P_induction2 L _6 x8 Q" A+ c
wait for A_time sec
, w- V, z4 g0 h end) p2 [/ i0 N. ~( }- _7 _
end
; M1 v2 h' W" y; G4 `, f) ]9 U. A( K1 V
begin P_induction arriving
' D$ {7 K/ x8 g) Q/ [5 ^7 g9 r3 Q if A_induct=1 then clone 1 load to P_pick1% D' R1 [1 o. H9 g7 g
else if A_induct=2 then clone 1 load to P_pick2
* d! Z2 d+ _( Y0 x( B$ l, B else clone 1 load to P_pick3
0 p+ M w" l" L5 M2 w* c, H. `1 pend
9 I: W9 _$ K$ e/ S$ _+ j4 S% q5 T2 w) S# ? b
begin P_pick1 arriving
( U$ G0 A% T; a+ \" v! F set A_i to 1
6 f& V9 S' \6 z! a* A& D9 e$ y move into Q_induct1
8 V& \2 i% Z+ I: a0 a3 R move into pickaisle.induct19 f4 t' l9 F; ]
while A_i<=30 do begin) Q; M- O7 M# T, W
travel to pickaisle.con(A_i)2 t! H7 C% s. \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- Y o' r' ]4 J2 H else wait for 10 sec0 @# T' S! C) U: @
if A_i=A_leave then send to die4 c( i1 R) S. S M' |1 W" q& w
else inc A_i by 1/ z0 K% w: b- S w0 x& `% }
end
; S5 g+ \2 r5 B. m4 s3 Bend# l) Z. B2 l4 Y# t' R5 V6 Y
& I, s' Z- j/ K7 U7 l4 J' vbegin P_pick2 arriving. A0 B+ r4 F! l6 B6 r
set A_i to 11( `9 G# f, V& c8 I: m
move into Q_induct2
% U) a0 p7 b/ Y# X move into pickaisle.induct2* r2 c. q1 X& t0 n
while A_i<=30 do begin
# M. _5 M1 M& ~: k travel to pickaisle.con(A_i), N( o4 U4 e& Z% v) _/ e. \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
O3 `8 L# l- c3 f) {- o else wait for 10 sec" z. ~1 z! `. j, Z2 {& f5 ?1 K w7 k
if A_i=A_leave then send to die
9 z* O; J( h6 ?8 X else inc A_i by 1
$ H4 Q) E1 k: E0 f/ h end% S* H1 D1 [; B9 p1 x
end
8 y. [5 t, A: E% [6 @' h+ U3 @1 ?
. b) `1 d1 Q' S' [+ {begin P_pick3 arriving
% [8 P- b ~1 @+ l$ a set A_i to 21" n3 L+ ]1 j; b
move into Q_induct3& F; l; B. F8 f5 U
move into pickaisle.induct35 P* G( D% O' U3 `( l4 ?
while A_i<=30 do begin
+ j# u8 C: s6 z1 Y! I$ ^4 T2 H) s travel to pickaisle.con(A_i)
) s) N: {3 O, Y* {5 V& f9 m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 t; v* ]9 J Q9 ^5 l1 Q% N
else wait for 10 sec
5 e% V2 T2 t2 g if A_i=A_leave then send to die
1 S( ?% }2 \6 {. i) V else inc A_i by 1$ l9 |( |" L8 A6 j" @
end
& a0 J/ U" d% a3 Q8 Z# send |
最佳答案
查看完整内容
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,其它按你的 ...
|