|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 P6 B/ B: J$ {8 B
% y% B+ c! U9 y- N- @我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 q9 K' a9 r+ s$ Y
" N8 b# R% o6 gbegin P_read arriving2 p, y- l5 @: E6 s9 Q3 A
while 1=1 do begin# q# m4 H2 c$ N0 Q9 n
read A_tote from "data.txt" with delimiter "\n"
3 P6 ?; k+ N4 B6 v: i3 E3 w/ f read A_time from "data.txt" with delimiter "\n"
% u+ r+ S# `4 x/ ^2 u" ? read A_leave from "data.txt" with delimiter "\n"& K5 R* b& A0 Y; B
read A_picks from "data.txt" with delimiter "\n"
W9 z4 D4 y) E. A. ~: A set load type to A_tote) P6 Y. S; U3 \" h l! C
if A_tote="tote 1" then set A_induct to 1
4 F1 {3 d- M( p# u8 H% a else if A_tote="tote 2" then set A_induct to 2) m. t7 k/ c! t; I1 X* O
else set A_induct to 3 ( P! p; H% f' F3 T
set A_i to 0% s ~5 K6 z8 o8 O
clone 1 load to P_induction
8 v6 [7 N( t; C wait for A_time sec
3 I, Q. l- P, j- Y3 r0 A end
+ t6 R) ?( q3 k& Pend
: P( D R* j1 ]" e; J3 \3 N+ C1 q1 \- J' m' q6 V
begin P_induction arriving
3 n$ j/ S: L4 @( d" q2 g' J if A_induct=1 then clone 1 load to P_pick1. l2 m/ @9 E y a, {
else if A_induct=2 then clone 1 load to P_pick2
- N5 G+ W/ p* q, c else clone 1 load to P_pick3
5 L: y% n8 W1 I2 V. g! ]6 Send
& `, B8 y2 F5 e1 ?$ Y3 I' L$ q
begin P_pick1 arriving
1 e& C" v8 H/ R# p set A_i to 1
% ~ t% }3 A2 D* B: T* U move into Q_induct1
+ z2 C8 s$ Q3 Z+ y5 G# u move into pickaisle.induct1
2 {; s4 h5 B# p+ l8 r# b" [ while A_i<=30 do begin7 _0 x: m2 a+ S" O
travel to pickaisle.con(A_i)
# Y4 ?: I, e" |" e+ m8 r6 h% u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 A% b2 P( O o! ] else wait for 10 sec
) \ D8 y* M# s8 t, ^ if A_i=A_leave then send to die
4 e/ f* z: W* y9 Y else inc A_i by 1
# |# m1 ` U, r end
I2 @" M7 F7 qend
, n* l- F: H c; h4 ~' q7 w( X$ H# {# a) E# n5 A% X
begin P_pick2 arriving( ^; t/ M( D% Z* m
set A_i to 11# L0 F0 f( e- d. p2 u% b
move into Q_induct2% a5 M1 M! @, P+ J0 G
move into pickaisle.induct2
4 b8 S7 g* c6 y h# ` M2 o' b while A_i<=30 do begin% b1 i/ |4 o8 i: ?
travel to pickaisle.con(A_i)
+ d" N7 B) D6 L7 B1 f6 u6 Q) P% B/ k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* \( \1 p5 Z" ?. ] else wait for 10 sec
# ~2 I1 ]* Q& H( ^2 D* r0 a7 g if A_i=A_leave then send to die% V1 W8 Z' G# q! s: E
else inc A_i by 12 b) [; ~4 q6 C* F- M+ P
end0 n8 Z! p+ g: s4 u: {+ j( ^
end
3 c; C3 \; B8 J0 i7 H7 B5 l- r0 r% s( B& i: R) {* S7 B& a
begin P_pick3 arriving/ ]! Y' `/ ~1 o. j& X" R
set A_i to 21
5 \+ I3 `9 X2 k/ p move into Q_induct3& r+ I8 h, L2 ?; x
move into pickaisle.induct3
/ X- B+ ~( ^, Y+ w: p1 t! P" |$ C, l/ K while A_i<=30 do begin
1 G7 [& G7 M5 B- S+ p travel to pickaisle.con(A_i) r; ~) {: i* F' C+ O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 G' m; i! T8 B* \7 K; D9 U
else wait for 10 sec5 Z( S+ g) r% e5 ^+ F
if A_i=A_leave then send to die H' g. p @7 J: w% c4 _# I8 s
else inc A_i by 1
) D! T- T3 N6 E1 R end& m a( N) v9 m
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,其它按你的 ...
|