|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# {5 e1 Z% e7 [+ z6 P" }6 \9 r" R* {8 Q) m% H9 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" i, f( ^0 O2 N
6 s: h, t8 q( N+ r$ i) Ebegin P_read arriving! y# f0 i6 j/ i. Q0 x& ]
while 1=1 do begin$ K$ w9 D/ e# S! G( x! v6 e
read A_tote from "data.txt" with delimiter "\n"- a; a- q+ O! N! z5 L
read A_time from "data.txt" with delimiter "\n"$ P j1 o6 Z0 b S) O& |! l3 S
read A_leave from "data.txt" with delimiter "\n"
; \8 x* a9 X) L h+ A! O6 a8 B read A_picks from "data.txt" with delimiter "\n"
0 C/ h r& D/ c1 M# q, Q" g' I" I set load type to A_tote
2 a, y% b" d. M! r4 E if A_tote="tote 1" then set A_induct to 1
4 E' @/ Z* m3 a- N9 d else if A_tote="tote 2" then set A_induct to 26 V7 H) m& Z( L2 H6 X
else set A_induct to 3
( b; x; C8 j7 |. A# M4 ?' F set A_i to 0+ S1 B% A' C) f, Y
clone 1 load to P_induction
' p" J4 b" k( C: n wait for A_time sec# Q2 e, j: d. b
end
3 v3 C! V5 F t Iend8 t i# Z' W$ Q( J* ^
( C y- z; ?4 T! [ Rbegin P_induction arriving
) R. v( Q$ }5 C if A_induct=1 then clone 1 load to P_pick1$ `& X- H. j7 t* U4 S: [
else if A_induct=2 then clone 1 load to P_pick2
1 `& M1 w! {2 U. Z4 |: \9 ]1 @ else clone 1 load to P_pick3
$ i2 `; j8 @: y. f- Q- ?# Iend
/ Q7 J7 N! H3 Y; L S4 d
( ?8 N# b$ I. g5 m. Y1 x) Jbegin P_pick1 arriving
" ]* G8 N; O- t set A_i to 16 O. Y- k, Y K; z; C0 b: C
move into Q_induct1
# K8 R3 j0 p1 } move into pickaisle.induct1
# Y& A' \$ p5 X while A_i<=30 do begin. X' S8 e2 O( k5 N/ O x: R8 `6 x
travel to pickaisle.con(A_i)
5 h5 i |, c3 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 {0 z% z% ?% i7 {# c v4 j
else wait for 10 sec6 x+ h% ^6 h7 y8 L8 z; @: o
if A_i=A_leave then send to die* n3 w; T1 W' A/ J# z
else inc A_i by 1
, H5 V6 Z2 E- x7 U, K: V8 i end
% u9 c+ ~ O# K$ d/ ^0 Aend
8 h+ F+ P: f) w7 G, u, }) a, n5 |# B- E
begin P_pick2 arriving- A- x# u. T" p S* H
set A_i to 11
3 x$ [" E2 O% f/ ?: z' U move into Q_induct2/ [/ P& v) x# I1 G
move into pickaisle.induct21 Z) M1 e9 G+ I3 C/ g1 y1 r: P
while A_i<=30 do begin' s- Y- Y# x$ e+ v1 R7 n
travel to pickaisle.con(A_i)! }, w+ }2 A; N& v9 Z6 T6 s9 Q8 s6 A K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
i6 \7 Q* c& n4 D) f! n else wait for 10 sec
4 }4 T3 E/ Q5 p. x I$ d if A_i=A_leave then send to die
l8 W4 F3 X6 z else inc A_i by 1- d& j! Y4 T& C l5 G- s$ b, O
end0 [# }" G8 Y" E" ?
end0 a% X1 N# U1 R2 F( _6 w
2 G: [2 {6 R* p4 t, @% R& Gbegin P_pick3 arriving4 D6 n% z4 N- D' G! K( J
set A_i to 21" P+ R0 S ~7 X9 S; x
move into Q_induct3
4 E/ r. A& A; ] move into pickaisle.induct3
0 F: g$ @' w% |1 w% h1 v4 {2 K- i, Z while A_i<=30 do begin" t' y% ~$ J- _5 f) m
travel to pickaisle.con(A_i)( o4 i% Q6 `4 X2 l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ D, a( ~* o: b6 U8 _/ i else wait for 10 sec
1 p$ ]# l2 ]/ y* R6 X" `; O if A_i=A_leave then send to die
3 }$ h+ c% K# i* Z else inc A_i by 1
E; F- s8 K: p- ^9 G# ] end! {; \$ c( F" _0 @8 G; R
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,其它按你的 ...
|