|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 D3 k" c" `4 M( H; _
( D1 w* x$ g' x- r& D; O8 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中的数值,不知道会不会有什么不妥。
" \, T! ? c( u4 C3 `' w7 Y+ [
) J& i4 G/ [8 i4 X& Zbegin P_read arriving# a9 t, }, Y% i w& z: g
while 1=1 do begin" ~( M) N# e4 R! f! ?
read A_tote from "data.txt" with delimiter "\n"
" ^& a) _! @7 v read A_time from "data.txt" with delimiter "\n"& e' x$ g6 T. a/ f& i2 ]
read A_leave from "data.txt" with delimiter "\n"9 q& y( ?7 |$ G6 [# u, U) p% W
read A_picks from "data.txt" with delimiter "\n"3 L% d7 e! Z% x1 n5 J$ n: {
set load type to A_tote
2 @0 n1 {2 ]/ L. B$ t& p if A_tote="tote 1" then set A_induct to 1
7 ~+ A' K3 I) v else if A_tote="tote 2" then set A_induct to 2) Y/ _2 O# F+ {( \: I9 y
else set A_induct to 3 ! _/ V$ d2 _( a8 o% }5 `
set A_i to 06 a5 @8 x( [& }; Z# ^5 Y
clone 1 load to P_induction. U- I/ i( J7 U' u m( G. z
wait for A_time sec9 j) O, ~: H& `7 \! T7 y8 e7 a
end# E7 ?7 ~; k H- h
end
% I1 e; x1 Q' V/ |4 I3 b0 C
9 x. c. S. I+ T7 Gbegin P_induction arriving9 w# K% M8 c. O1 A2 @
if A_induct=1 then clone 1 load to P_pick17 D, u* |; a: k G0 p4 q$ y
else if A_induct=2 then clone 1 load to P_pick23 K1 {& b9 Q! ^9 v0 i
else clone 1 load to P_pick3
D' a1 e! w; S5 Y# |4 w( Dend5 [$ z0 v! ?& y7 x) i
, ~' B6 h" }* t) nbegin P_pick1 arriving
% ~8 k$ ]9 n5 L7 X: Q) _ set A_i to 12 ]/ p3 S& @8 b) q- U( M
move into Q_induct1' ^) C, L- @/ Y8 _9 u/ e# H
move into pickaisle.induct1, J) X! |& R8 s0 g! f
while A_i<=30 do begin
: O% b; j1 J! N* \; l# ` travel to pickaisle.con(A_i)) `( j e, }4 |( w* [4 t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) K% L% x# Y4 q9 o* b else wait for 10 sec
5 X# }; g/ f8 w e" z if A_i=A_leave then send to die
8 Q6 m6 w* V8 W else inc A_i by 1
2 r4 Z+ C- G% W# ]6 d* K% @ end
1 Y' Z$ C% [& b5 Pend9 Y) `8 [) F, m: Z+ [8 v. I
6 r% {8 N7 |7 G# bbegin P_pick2 arriving
: I9 U$ H& }1 ~* @3 M- C set A_i to 11
+ H3 r. M/ l! N5 \+ r. Q( [0 ~4 N T0 L6 h move into Q_induct25 X. U3 u! c; _7 [! l; O" x/ n
move into pickaisle.induct2; {1 k( H% Y8 |' I M6 r5 M
while A_i<=30 do begin
9 y; v0 S" k) B5 l. c' L( c travel to pickaisle.con(A_i)
$ m( g' v; J( Q% M1 O; s+ m& c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 Y( |0 ~7 E) p& i ]# r( N else wait for 10 sec j6 F( K3 j O3 U0 {4 o6 t; K3 x
if A_i=A_leave then send to die
/ C f) g" q! R( S6 k; A else inc A_i by 1" K# I7 R" f" K1 Y7 U5 U
end
- N, n; Q. Z8 fend* e9 g) m7 M8 [; o
! Z$ V: H' j5 k4 i1 T' K
begin P_pick3 arriving
! q/ X' \ m9 A: { set A_i to 21 N1 u2 c6 |# @
move into Q_induct3
1 G) B2 {2 b5 y% b" z- G) i% A0 c7 @ move into pickaisle.induct3
& P7 P% n& F& c0 o7 Z, J while A_i<=30 do begin" ?* o- p$ \% B/ T1 C
travel to pickaisle.con(A_i)
5 X4 P) }% S' J8 W' |0 @1 k. ]' }: g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 e+ H$ \' ^4 Z, A( J else wait for 10 sec
. F* {$ g6 j9 z( k0 [9 D! c if A_i=A_leave then send to die
$ D4 E% H4 i1 b! [. M else inc A_i by 1
9 I2 x/ c3 \( B end
8 F+ V/ Q9 ?, G2 H# I8 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,其它按你的 ...
|