|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( u+ R+ h' _0 v; _7 f# q8 z
8 o; t9 ~$ G1 O, C) E* O+ X我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 A6 \' q5 M; ?$ f# b: _. h; i g9 w8 d' c# }
begin P_read arriving! A0 q# t8 r2 k1 T; C- G! o1 U& z
while 1=1 do begin
( f, _* D( }1 x! y. o read A_tote from "data.txt" with delimiter "\n"
3 H5 V+ q( B% u+ |' V read A_time from "data.txt" with delimiter "\n"3 z9 H8 a! L& x5 w. F/ p
read A_leave from "data.txt" with delimiter "\n"
: M& t' J7 X: z/ \ read A_picks from "data.txt" with delimiter "\n": d6 A% ^* M: q2 \
set load type to A_tote
- w. V1 U+ y+ u if A_tote="tote 1" then set A_induct to 1
. r, D- [. Y2 |# F2 I) U3 h' p else if A_tote="tote 2" then set A_induct to 21 l4 V% ?0 E* v$ d
else set A_induct to 3
9 F B3 {% ~: K" p set A_i to 0
& {% S' s- A+ B& x$ D! a8 {5 @0 p clone 1 load to P_induction
- H7 B) k: a/ M& l8 [2 ~- n- \ wait for A_time sec8 d, G' n" J$ I5 r$ C9 b
end0 n/ f+ n% k( o* V; |) O
end
' X! h+ I d* G+ }6 @% w! p, N' T
begin P_induction arriving" Y: B- @1 H( m- h! c
if A_induct=1 then clone 1 load to P_pick1
, a6 K0 r2 t# o' `7 _7 B. \ else if A_induct=2 then clone 1 load to P_pick2
2 G' r3 a1 v! U3 L* \6 t- e else clone 1 load to P_pick3, g1 i/ v! |9 J; Q# O4 Y& d) }2 `
end1 i8 C, O x+ w5 P3 j# o3 I% C4 Z: S
1 ~, e* |+ g1 m2 j1 L M3 a
begin P_pick1 arriving2 @6 `7 H; z: A+ I& s- n/ j
set A_i to 1
) r) J8 Z+ k: Z& Y move into Q_induct1, ~9 Q- E1 |& c E' p$ s
move into pickaisle.induct13 H6 ?* y" ~, y, A1 E
while A_i<=30 do begin% V+ a, t8 }3 ]8 v0 E
travel to pickaisle.con(A_i)6 U) M N b2 e* _8 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; q6 X! c% z9 ~ o
else wait for 10 sec5 _! n& s! A* k# t/ J+ }, y! x
if A_i=A_leave then send to die
4 r; K; Z2 C* |1 I; C% q5 x* { else inc A_i by 1
: P1 H) R/ i" R end
* L6 g) W" a# Yend, o& H7 l4 F u- \+ L* H" Y4 H4 K
8 e5 W5 b! F3 x, F6 ?$ I
begin P_pick2 arriving, ~. w3 h/ B0 ?* b/ ?0 Q+ D
set A_i to 11
/ e2 @, c5 ^8 i" N- |9 V& @ move into Q_induct2
. L" e' ^/ {# `6 o5 Z1 L move into pickaisle.induct2
6 W) f% t: D% _$ B while A_i<=30 do begin o$ R' x' H' ]8 A e) o
travel to pickaisle.con(A_i)( ^6 l; ?# p0 x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 O0 }7 d+ V) P+ X! y, C: O' T0 I else wait for 10 sec
" O! K$ X% V/ N; ~ if A_i=A_leave then send to die7 @5 r8 i1 }) O6 b) \8 ~0 W
else inc A_i by 1* y0 h' o: ?8 z4 ?$ c( g
end1 \5 J7 x D3 q. r% H" T# ?* K- w( J
end _. E7 S3 g1 z* X$ Q0 I
! W0 Y& l3 ]4 e+ M
begin P_pick3 arriving/ p3 G) B8 k. _, d. R
set A_i to 21
; _/ h$ W3 G, \9 O' V! G3 U7 P R move into Q_induct3# y+ q6 z8 t( Q7 q
move into pickaisle.induct3) L1 R# X1 L W0 ^2 W
while A_i<=30 do begin
& c- L2 @2 k* P6 h! @5 ^" E* i C7 a travel to pickaisle.con(A_i)
, }- ?/ A) n! n: |; e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 r' G, g, r3 T3 k else wait for 10 sec
/ j$ M" f; E# }# y. z if A_i=A_leave then send to die1 x" N+ F- C6 _, Y/ J9 Z u
else inc A_i by 1
- z: l* U6 P" P# p ~" t end9 m4 J* S: p* V9 a+ j# R1 o
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,其它按你的 ...
|