|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* A" X0 W" y( I5 J& h
- u3 C& |! \# c* X; n9 B我的问题是,在每个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中的数值,不知道会不会有什么不妥。& G, R6 h& o0 m
! e" w1 B- o; W% ^1 @/ ebegin P_read arriving. e, p7 ~+ O+ L
while 1=1 do begin
7 e& Z; |2 [7 S$ j read A_tote from "data.txt" with delimiter "\n"
3 Q: r- l6 N6 U$ M read A_time from "data.txt" with delimiter "\n"
, Z5 f/ O/ L" o, V( U read A_leave from "data.txt" with delimiter "\n"4 S$ W c: M7 W. @
read A_picks from "data.txt" with delimiter "\n"
. g% ^2 X, |; L/ J5 _2 a( j set load type to A_tote9 H" }% q* C u; C4 [: u, |6 u
if A_tote="tote 1" then set A_induct to 1( g- G6 }" z3 E5 Y1 T" ~( X
else if A_tote="tote 2" then set A_induct to 2$ H$ n: F0 x( P9 \1 E4 F
else set A_induct to 3
) }; i7 ~( j6 { set A_i to 0: Y) h9 H# z$ T# G* E8 W6 W" H
clone 1 load to P_induction, | \( N5 t4 ?% x7 t/ w4 o0 i
wait for A_time sec
1 [ g; p) J& O" b/ g end
0 `' u! M2 q/ vend
1 P5 t( L A. F
2 |8 ^+ T3 T% t$ [: `" pbegin P_induction arriving- x9 {! X5 J: v8 a3 e
if A_induct=1 then clone 1 load to P_pick1
' P! w# f; g: C2 ~; _ else if A_induct=2 then clone 1 load to P_pick2 U/ z1 o, G2 x& q- [" E9 s! _% e
else clone 1 load to P_pick3
/ T3 N$ y, h. q8 W, ]% zend
* P2 A& T8 `( i% T. W( }2 L- r. ~' [9 b+ e$ f
begin P_pick1 arriving. ^" o9 P- i0 {) L4 M
set A_i to 1) `: p$ {" m6 Y- H* T: O" Q
move into Q_induct1
, M! C U; i7 R8 @' v move into pickaisle.induct1
2 |3 J5 J0 v% K2 V3 w while A_i<=30 do begin
3 c5 h1 l* }5 ~ K5 H travel to pickaisle.con(A_i). B# f: O3 }- u: [1 M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 ?3 Y6 W+ e: n/ ~5 Y/ Z else wait for 10 sec
_5 \! M' J' A5 V8 d" s if A_i=A_leave then send to die
1 l9 ^% _( j+ E* x+ F! b) O3 V else inc A_i by 1
# ?; T( w: ^- `8 _ end
0 l# s' |* _: t. e1 l3 q6 Nend: P4 M4 ]$ Z* n# h/ @
" t$ c b# {9 M2 N h4 r2 rbegin P_pick2 arriving
2 @' w1 _! T$ [& B set A_i to 11
* }! Y- H' F! _* q move into Q_induct2
/ w0 W5 g L n6 g0 @ c move into pickaisle.induct2
4 {8 m( V/ h$ ?, k, `1 Y while A_i<=30 do begin$ v. S# K: W. c6 b5 _ _3 n7 k
travel to pickaisle.con(A_i)* L; u, x! D, {. V; W) s* J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 I; ~0 l) `$ ], M3 M3 w
else wait for 10 sec+ ?& R; b' Q; S1 o5 i% ^
if A_i=A_leave then send to die! I+ ^; ]! i9 L; J$ u
else inc A_i by 1% S2 E- b( Q9 \3 d) b+ u7 Y( R/ ?' i% V
end
' s; l+ f) g2 M, S3 x6 r" Gend
, F7 }, z; j1 @0 A4 N& n( I$ L `2 T; i* Y% V
begin P_pick3 arriving
/ `" a& t% c" q2 }! x" i2 T set A_i to 21
/ N9 _0 Q2 _# F6 V' U! N3 a) h* f* C move into Q_induct3
R. D% h2 X! t' ]( D/ \ move into pickaisle.induct3
/ v: P) h8 x. V+ v! a. R- q4 t- M while A_i<=30 do begin
& M0 m7 T. s0 z1 a; [9 ~# q travel to pickaisle.con(A_i)( x: V: Y, Z- U8 i+ |# v* s9 W2 e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ G# \2 z1 ?. X& E8 H9 v2 F
else wait for 10 sec
' r" z7 f7 S$ Q2 _ if A_i=A_leave then send to die+ ^) ?' j# ^/ n
else inc A_i by 1
3 h! ^" s6 D1 H4 x# s& C, @( U; E" s end
' D" |4 B! R$ u+ i2 f+ ]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,其它按你的 ...
|