|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 I+ k/ m* `* j, Z4 O% x% _) X/ T7 m% 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中的数值,不知道会不会有什么不妥。
' C, a3 B7 |' @; z& U$ {# B) a
- g6 _! o& ^6 E% Hbegin P_read arriving: ?! f% m8 R. d$ ?" Q' p: A" D
while 1=1 do begin: B( Q& g" s5 a+ N( t/ H! M& N
read A_tote from "data.txt" with delimiter "\n", o' Y4 O; B& v; `# _6 V# \
read A_time from "data.txt" with delimiter "\n"! Z* Q: {8 V m5 Y
read A_leave from "data.txt" with delimiter "\n"
1 {! j2 f; A% ^6 I read A_picks from "data.txt" with delimiter "\n"
0 K( b* D$ F( G6 V* C% {5 ? set load type to A_tote1 D" @3 b/ ]. w2 G! \8 ~+ |$ k
if A_tote="tote 1" then set A_induct to 1
! X7 K5 j9 o2 Q, | else if A_tote="tote 2" then set A_induct to 2
7 A4 e9 V3 [3 C' _" z/ T else set A_induct to 3 }; S7 H, } w' {7 i2 I
set A_i to 0
! E- X0 Y- p5 B" F clone 1 load to P_induction
6 \( H7 {% q+ f5 `$ R+ x wait for A_time sec
6 X) H* a8 g4 N0 n; L+ a! o7 q/ R/ ?/ E end
; i. k( d( l. V6 iend
6 E! M8 C5 j! S5 F9 |3 U$ R8 O1 X6 |! E/ @
begin P_induction arriving% f* }$ S9 K& W, B& k" s& |
if A_induct=1 then clone 1 load to P_pick1
& S4 U+ ?/ W7 m1 l+ h7 ? else if A_induct=2 then clone 1 load to P_pick2$ S: _( Q. A* I2 Q) W
else clone 1 load to P_pick3& z; l$ L3 I) L) s1 Z* g
end
6 ]4 U6 \2 a6 Q% o& C& J
# Y+ r9 ? T1 ^7 D5 }3 p) Obegin P_pick1 arriving
0 O5 R% W6 N) x* Z' q, C: ?0 E% O- C set A_i to 1& R# v3 Q- ]+ `
move into Q_induct1
& n, C* A* r* h2 K move into pickaisle.induct17 W6 P' J0 v! a
while A_i<=30 do begin
4 M0 A5 g& j+ Z# H- o+ ^! T. \ travel to pickaisle.con(A_i)
, V5 L! B Q. y" p% I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 A7 T9 u) t* T& u$ u Y1 e+ o: z else wait for 10 sec- ~% H' N$ h. G! m
if A_i=A_leave then send to die& o9 Y F; v* @" _( ]; O# p
else inc A_i by 1
3 s Z$ x, |3 Y3 G4 a end
- K5 q4 L3 P" Y* Y- B6 z! U }7 w: pend
* E2 G# S. p3 P9 u. X. M8 J
8 d7 x5 `$ ~# p. @begin P_pick2 arriving* F/ |1 |, p* [+ B8 \4 w& u
set A_i to 11/ g6 K J7 m1 A" r6 y2 B6 s
move into Q_induct2
8 {" s* `% H* U/ t" b% }3 ? move into pickaisle.induct20 c2 R7 n5 Q, b
while A_i<=30 do begin
4 @3 O$ V- ~2 ?' {1 C! a! a travel to pickaisle.con(A_i). U; W' F, {! C) d3 i4 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% c, S3 R* p {1 [$ F# H* @
else wait for 10 sec, X* u- p/ o: @! V; F
if A_i=A_leave then send to die/ y6 K3 y: P% I+ p+ u/ }+ C
else inc A_i by 1. {. E, q! ^$ r
end
% M( M. h% ?: _! Oend- } ^( g/ R( q$ y" ]1 J0 i( M' e
0 u: o4 l J* m
begin P_pick3 arriving
) X0 w8 N3 D' S# [, O. b set A_i to 21
* ^4 v3 M1 v7 B+ p! B7 R move into Q_induct3
: p6 A' n" f+ I move into pickaisle.induct38 v$ ]3 d) m. L& E) o8 I; N
while A_i<=30 do begin
1 x# M4 T* ?2 L8 D/ S6 {4 ?5 t travel to pickaisle.con(A_i)- ^# H, s; x# y8 n4 t2 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 f& w' n5 H, V5 K T/ ~
else wait for 10 sec/ A E5 [+ e0 N3 |* h% @ ]. A
if A_i=A_leave then send to die' A# ]* s, h' O
else inc A_i by 1
6 c: n$ D2 |5 C% ] end
" u4 X- E' Y$ N) z! uend |
最佳答案
查看完整内容
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,其它按你的 ...
|