|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# F5 `& [0 h( J' J
. c# s9 i7 z8 O- P* }. F: L l我的问题是,在每个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中的数值,不知道会不会有什么不妥。! d6 T, t1 q4 S/ J8 C6 T
' S2 l9 B- q& t C4 e3 a/ P$ Ebegin P_read arriving: o2 ]; E2 O; k0 t
while 1=1 do begin2 V! V N8 z2 v! @5 Q
read A_tote from "data.txt" with delimiter "\n"
. {& d( r5 p+ G4 F read A_time from "data.txt" with delimiter "\n"
0 _6 f& Y, V6 a' w% r8 X0 y6 L read A_leave from "data.txt" with delimiter "\n"1 D& ~+ c( ^$ ?' A; q* i O q
read A_picks from "data.txt" with delimiter "\n"
: u: P9 J f+ u2 D" u7 F set load type to A_tote
5 `5 `/ X2 u+ V" G8 D# f if A_tote="tote 1" then set A_induct to 1
+ K* Z& \& f5 H8 O8 B else if A_tote="tote 2" then set A_induct to 2 y, s0 {. u; U' k ]1 X7 W$ S9 Y
else set A_induct to 3 : \' n- {" l9 L; I# X4 `6 v
set A_i to 0
" c. t3 \& n4 n clone 1 load to P_induction! q6 v5 o5 @( a& e* M" J- ~
wait for A_time sec. T. U) p+ k3 |! K1 G
end
y E+ W5 I& b$ \1 ?" _1 Iend
- k$ |# n( O5 m, r1 t% @8 H
% U$ y) H h' f2 O/ {0 E% y, M2 ]begin P_induction arriving
! A: I9 G! b2 ]: a' U' _ if A_induct=1 then clone 1 load to P_pick1
. X. G. h2 `/ v" t else if A_induct=2 then clone 1 load to P_pick2
2 S* T$ k5 r% H else clone 1 load to P_pick34 U" h& e- P0 d* Q0 V
end
$ @3 X6 @/ b! `: y9 C4 m1 q5 D2 i7 R5 X- K2 {+ ^
begin P_pick1 arriving2 E$ J6 g8 I8 p [
set A_i to 1$ B! W6 K8 t! i6 ?/ A/ V
move into Q_induct1- S m+ ?# G2 w& a3 L" g B/ w. C
move into pickaisle.induct1' a7 i5 R: L: u, H" r
while A_i<=30 do begin
7 t1 S2 N1 \: t+ d3 b" q travel to pickaisle.con(A_i). M, W! f& `2 O7 D! M9 T$ v6 ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ G" ~1 C9 X* ?' I; R else wait for 10 sec
9 O, P3 K- e. R7 F6 V, x if A_i=A_leave then send to die
$ B" g: v# y6 p4 P4 I else inc A_i by 19 K( b+ S) S5 ~
end
N8 ^: g6 b& V1 y9 z' }end5 P1 ~! C$ I" P6 T1 x
- p1 a9 v: G% y: V. @
begin P_pick2 arriving+ G$ f/ x- c9 m2 W3 Y
set A_i to 11$ p. b9 K7 K6 e
move into Q_induct2
, m p3 f: d4 E z9 d0 M move into pickaisle.induct26 c1 [9 }/ k: E, u+ Q9 x+ Z, X
while A_i<=30 do begin) U7 `/ p% C7 y" Q
travel to pickaisle.con(A_i)- \0 {3 l N" U( j) X! J. g w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) j5 m, A) U0 w J6 O" t8 _ else wait for 10 sec3 w4 F [3 A0 u- X' @# o H
if A_i=A_leave then send to die Y0 Z& [& Z3 b: q+ V: Y
else inc A_i by 1
/ x* t T6 C+ Z0 N# _ end0 g5 \' Z, X2 A" c6 U
end; b) Z+ E7 c# H, u2 c& q) ?4 C3 E
9 c" G7 Q' I5 ]$ f, Zbegin P_pick3 arriving
! V% X; e3 x* H0 |3 r4 s2 u set A_i to 21
6 h; v" }7 R( M. M6 i4 X8 t- a move into Q_induct3
& B& H2 M) J2 ?# O* n: r; w. X- D move into pickaisle.induct3
1 F; B. r0 m- I% l. P2 |- ]6 B8 y while A_i<=30 do begin
% B r1 X9 p7 `' V0 t |" ^' b travel to pickaisle.con(A_i): t# l4 g8 ~8 t" w# Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% {: \# l8 g* l. D7 h# R
else wait for 10 sec3 Z& Z- q* v+ M1 g6 f
if A_i=A_leave then send to die
7 w( o" y2 ?, M% G+ }2 m! j# i* Z else inc A_i by 1, c0 a% H" E8 l4 A: g* P6 c6 l
end) ^6 v8 {% I0 F3 A/ z4 A
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,其它按你的 ...
|