|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 ?, Z% a# l& b9 I
+ Y+ q: g* `+ b# i. F我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! _% d+ e6 s% ?" q3 t) N
6 C0 T7 a; v5 V* T( wbegin P_read arriving
, S g; T" i4 m while 1=1 do begin' U5 b: f& W9 c
read A_tote from "data.txt" with delimiter "\n"
; M: ]5 |% ? I2 o4 V- p, E read A_time from "data.txt" with delimiter "\n"
( I" ]8 |( D5 Q, ^ read A_leave from "data.txt" with delimiter "\n"
. Z8 q. q" @/ n. P6 V) \ read A_picks from "data.txt" with delimiter "\n"4 ^- e7 x x6 H5 z. b, X* S
set load type to A_tote3 [" M( \: x% K5 A9 C
if A_tote="tote 1" then set A_induct to 1
0 T( y2 r; n2 y% I else if A_tote="tote 2" then set A_induct to 2
1 t" O8 ~: v3 i else set A_induct to 3 : R4 ]/ w; p" \: N3 a5 c1 v: y- G
set A_i to 0( Q k/ M9 f# w [2 U5 O) r3 _, O# G: X
clone 1 load to P_induction# j6 N9 F$ R0 j
wait for A_time sec4 N2 [9 G/ t* | g, O& f1 S
end! c7 `1 u. d$ e0 n: G
end
! Q: |7 ?' H) u7 H6 w& e- H1 W
" P" O1 e8 W/ i2 D- c0 f; ^6 f) wbegin P_induction arriving
6 r$ O9 o' ^5 C2 G' K' h. I if A_induct=1 then clone 1 load to P_pick1
2 k# d- N% W7 b5 R1 p& t9 F0 P else if A_induct=2 then clone 1 load to P_pick2- S! e& p" ]8 F* a. I
else clone 1 load to P_pick3
- \( T% b( f* ]9 I0 J9 aend( |! N: |& b( b* o
, k: ^8 W( \- ebegin P_pick1 arriving
}) n3 Y" ~% `# s: n& _ set A_i to 1
5 `1 ~ s- V+ w) E6 U7 s move into Q_induct1
6 ]! n r$ d' K( Y2 v move into pickaisle.induct1 n" e; ^- _ ]5 M' G
while A_i<=30 do begin
5 t7 R7 k+ F0 } travel to pickaisle.con(A_i)
6 W: h9 C0 R8 {; ]8 }/ x+ K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 |+ }# Z8 D p/ o6 I1 s# ?
else wait for 10 sec
6 [8 T* j, \" A1 J( g if A_i=A_leave then send to die
S: b( P8 N# s6 z0 w/ `0 { else inc A_i by 1
% c0 x& V; {; G$ q9 M end& {) n6 u* C# @
end0 v5 T3 S* Q1 x) k, b
|7 v& g+ O/ a5 \/ l! s) A" {begin P_pick2 arriving2 J3 I& D& H( k/ k5 u
set A_i to 114 v9 }( X+ s- i' }' i8 m1 m3 Q( Y
move into Q_induct2! A+ q+ B" E0 i/ B% O
move into pickaisle.induct28 S# z4 i* [4 b- [- l- Q% V
while A_i<=30 do begin
( C2 Y9 Z& \' ` travel to pickaisle.con(A_i)
* I# Q- ~6 z. H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 w y: S! f* C$ y7 C
else wait for 10 sec
: d# S w* ~& k8 ]8 M6 W7 r) c if A_i=A_leave then send to die# ~* f% U7 }. q8 b& `
else inc A_i by 1
4 |1 F0 B! j6 o. V) N. N1 C end
4 m" f4 f& A3 a9 x4 ^+ Bend: d3 b7 p; q7 K
; Y, p/ P* u, e# V4 n* B0 |. `
begin P_pick3 arriving6 c2 Z( q% s* B
set A_i to 21, }2 e' i+ ]5 r, _+ w2 b
move into Q_induct3, l8 c2 N$ I( k2 E
move into pickaisle.induct3. q* e6 S2 {, v I5 ?! u
while A_i<=30 do begin
9 C$ X6 Q6 u# j travel to pickaisle.con(A_i)5 e7 o3 ]$ t7 \& q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, M2 I$ Q X1 G$ m0 t4 p; n
else wait for 10 sec
, J# n- s- F: v/ E( u; p if A_i=A_leave then send to die
! q: n$ }- W2 ] else inc A_i by 1
+ y; K# k }5 T0 P" p end1 H9 o3 {$ O& A$ `7 X& 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,其它按你的 ...
|