|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# E' N( U0 ?* v& y9 _
1 s6 C- |- d8 k# s2 I, 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中的数值,不知道会不会有什么不妥。
3 X* w9 t: F; b2 c2 a
, L+ F2 g$ V0 Ebegin P_read arriving
, c4 U6 {' x& w9 ` while 1=1 do begin" j5 R: [; _ j6 \
read A_tote from "data.txt" with delimiter "\n"
& b& u7 L9 _ e/ ?) | read A_time from "data.txt" with delimiter "\n"1 ~+ t! B/ V. z& }# t, G
read A_leave from "data.txt" with delimiter "\n"
- F1 ?( ]5 T; J) U read A_picks from "data.txt" with delimiter "\n"
0 }' o j& s$ k, W set load type to A_tote
7 g9 ?2 Y) [: Y( F( E if A_tote="tote 1" then set A_induct to 1
7 } m5 [$ j3 H: L else if A_tote="tote 2" then set A_induct to 2" b: K: W& ?) H7 u' r; H3 r- Y
else set A_induct to 3
" t5 j. V% h* I) m) ? set A_i to 0
6 q6 z$ c! [( I# f3 r clone 1 load to P_induction7 Z# G4 B$ a1 y2 D& a7 r- ~0 \
wait for A_time sec' n0 V7 Y2 l' E5 q
end
' H6 h, l* W: A2 f* c. vend
- j# q) c" N: j) Y2 r# X; ^" R8 k6 G. @
begin P_induction arriving# \. u* v+ P+ S$ e) @, a( E0 C I
if A_induct=1 then clone 1 load to P_pick1
; G: y. Z; P( z4 G Z8 P; o1 s2 e9 a else if A_induct=2 then clone 1 load to P_pick2" {5 ]! i% O x. a
else clone 1 load to P_pick3
1 F- h: ^ z' `end$ ~ {3 Q% I( Q8 u( \: }
3 n+ ?# Z" T2 P# s# ~" G/ `
begin P_pick1 arriving
3 Q# M( h6 v5 k set A_i to 1! X8 X6 w2 ?" [/ x) n
move into Q_induct13 _9 k0 j+ I9 |. S% U
move into pickaisle.induct1 Z; N* y% i) y: d
while A_i<=30 do begin: W, \& z# M4 ~ f4 y
travel to pickaisle.con(A_i), B) [2 W/ M+ i0 m: }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 l5 A g, u( e- l9 e1 a else wait for 10 sec! h' I8 k+ G: ^. x9 B
if A_i=A_leave then send to die
; P: F0 }# B4 ^0 l* }; X else inc A_i by 19 [, x$ ~1 ^- a0 h" V! j6 }
end
+ U* m1 O4 X8 ?+ ] f% Mend& s+ N& @) \; Y( M; H; K, d
+ J( \/ v: p: t- y7 C
begin P_pick2 arriving7 V/ L8 @; B7 O4 d
set A_i to 11$ g% A V! u$ K9 |, [7 {
move into Q_induct2+ F* `: S1 p% y: m
move into pickaisle.induct20 ~& C; ]- h" A: m5 E
while A_i<=30 do begin
/ W: Y7 [: ~( R) j travel to pickaisle.con(A_i)6 j/ @4 a/ A* n9 _2 w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, R/ p: W' ?5 i% I else wait for 10 sec
. j6 _- e* k0 \# ?* ~2 J! n+ ] if A_i=A_leave then send to die
2 t0 a- u' v/ ^* t y6 o3 M+ ?' s else inc A_i by 1
( W8 i0 w3 S. S3 z. I9 W* J end
/ m$ o, r+ W+ _% w/ s# Fend2 O# Y% F" F: d7 t! s
0 e+ i+ G8 R6 Gbegin P_pick3 arriving
# S' A" M9 N6 f1 M/ \$ e set A_i to 215 e+ t1 J6 H/ o2 I# V
move into Q_induct31 q" x7 H' ~$ [5 H. J, @' ^7 r) V
move into pickaisle.induct3
3 c9 k. V; w5 \, I, ^ while A_i<=30 do begin
+ B$ A! G3 C" V6 K: _6 i. ? travel to pickaisle.con(A_i)$ E/ g( k5 i2 h$ U& Z% X$ _6 g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ p7 k, N( T1 Z. Y0 F
else wait for 10 sec
8 Q! A- m6 |9 |. I1 ^1 k! \' d if A_i=A_leave then send to die
, Z& o7 i0 V' o" ?$ Z8 | else inc A_i by 1
* o4 E! E: @7 v& S end
. j7 Q8 ]4 i! K3 e( s6 r1 _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,其它按你的 ...
|