|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 P- R( H) e0 b+ K; {. j, p" b( }) C8 Z b/ S; w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。 \: X" b" X+ N+ R7 n. M
! e5 k+ \; w* c, N# _1 p8 Kbegin P_read arriving
. W1 s: `9 ~0 x, w4 i/ ?# G6 ^( j2 E0 s while 1=1 do begin
9 N+ V4 t, c: {$ n; o- A: e; P read A_tote from "data.txt" with delimiter "\n"
& {3 F4 y: l( x6 L- g. }+ | read A_time from "data.txt" with delimiter "\n"
8 t J; x% ^- j, p. W: x% u read A_leave from "data.txt" with delimiter "\n"
$ u& H% h* k4 F read A_picks from "data.txt" with delimiter "\n"4 C) u& k% S" _# L9 `) M2 L
set load type to A_tote- V3 ^# o6 D' y' h3 ~. b7 b0 t
if A_tote="tote 1" then set A_induct to 1+ k j- y) f4 x1 s4 y% E
else if A_tote="tote 2" then set A_induct to 2
2 o* ?3 N5 O: D- k( g! L o p, Y1 @ else set A_induct to 3
/ t1 A% K6 V5 W$ ?4 m# m$ _ set A_i to 0( y: h" e! ^$ z5 _: L7 r2 U
clone 1 load to P_induction
& i& J" u/ ^4 x! V: m2 L wait for A_time sec
& [" Q; J5 W& w+ d" q* X0 h end! |' O6 Y; L3 \" |
end
! S4 W& G5 f( Q% \# K8 Z0 I! N
( U# F, L9 g5 S {1 X8 N( W* ybegin P_induction arriving
2 ~& Z' S7 y5 Z9 g if A_induct=1 then clone 1 load to P_pick1; t2 ^ b w+ Y
else if A_induct=2 then clone 1 load to P_pick2+ M2 O& ?( s6 I, b; ]' q
else clone 1 load to P_pick3
$ h D: k( }: D0 kend7 s) h3 A5 n& b4 y: R$ n- i3 m
+ |2 {: E0 }- Y, H4 |begin P_pick1 arriving
& u1 Z2 t* W% a+ V3 E5 t$ r set A_i to 1
4 S* |* e7 O9 s8 q" t- l move into Q_induct1& H; ]; P) G+ x% S7 v: a$ C
move into pickaisle.induct1/ e2 t$ ~% L0 _9 ~1 P0 o/ @% m
while A_i<=30 do begin
3 S5 H+ {1 g7 f# j8 g7 T1 C travel to pickaisle.con(A_i)
* t* s; H; ]% C5 G) c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; R" Z( Y! T/ P' E. X
else wait for 10 sec
/ T5 |/ L$ M9 U1 c9 W if A_i=A_leave then send to die
; o& T: ^. u4 B! x/ ]; p+ y: o, Q else inc A_i by 1
( ^% ]/ m" R0 f3 {# [% u end3 v2 S8 u, q9 M; W; P( e
end: v B# c& p! Z* {2 E4 ^9 B$ v
5 P+ s$ S7 ~$ a0 X7 e4 g4 z& _% }begin P_pick2 arriving& h% |8 D& w& a8 w* x9 G
set A_i to 11
* L8 k, M1 _2 {7 m+ E6 U move into Q_induct2# c* \9 \* A; E; N
move into pickaisle.induct2
4 M& k4 a2 Q$ I; H2 t6 l while A_i<=30 do begin
; c( x: T4 B( }1 ?3 B travel to pickaisle.con(A_i)3 `# i) d) P. y2 \# Y5 ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: C3 ]9 I8 b7 y' R else wait for 10 sec
# o* k _5 \, V. u: B9 T if A_i=A_leave then send to die4 H/ R( }# r ]# `8 a) S7 S! z
else inc A_i by 17 P d% S- s) I+ p/ D% x
end
8 l% ^4 |/ S2 o/ ~end
6 n" A& M5 A1 C4 ~% ^3 T! I* o* l$ w$ v( t
begin P_pick3 arriving4 ^6 U, [$ c1 I1 @
set A_i to 21
% D+ H8 m ~ w8 O8 e" C6 h move into Q_induct34 J1 `+ E- ?' c1 b9 \0 X7 v! v6 x
move into pickaisle.induct3/ l0 _- m8 c- S M f. g
while A_i<=30 do begin7 D8 v9 Y) W# D
travel to pickaisle.con(A_i)9 ^! O- W' ~% j( Y! B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 f/ `/ U L$ v4 z' n
else wait for 10 sec5 a$ `1 a$ C$ G' C0 @
if A_i=A_leave then send to die
. w: K* J( D' P# l else inc A_i by 14 R/ n( ]5 l2 Y% X# e4 `! U, a
end
" H3 O5 M" C- L0 Yend |
最佳答案
查看完整内容
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,其它按你的 ...
|