|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 M3 O2 s3 w- Z( J# u C% A) G( I, v8 r X* B, d. K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 R5 l1 T- C( ?
5 b4 |9 X$ m7 x [9 Z9 ]: N
begin P_read arriving% B8 B; Q4 g: u3 h& p; O) [! e& D
while 1=1 do begin
: v0 d' C9 M/ A* ~- O0 w1 N+ P read A_tote from "data.txt" with delimiter "\n"
9 m9 d( K$ F% T8 U read A_time from "data.txt" with delimiter "\n"
1 u* {1 {6 o8 q) h) c+ R( h7 S read A_leave from "data.txt" with delimiter "\n"4 s! _" b- _0 X4 m# K# P
read A_picks from "data.txt" with delimiter "\n"+ K) E. d; P% T0 t% Q
set load type to A_tote
6 t, ~$ W* U6 ]: w) q( ^: k$ G if A_tote="tote 1" then set A_induct to 1
1 u9 {1 t% Y9 y9 |' ]. k else if A_tote="tote 2" then set A_induct to 2
' }7 J0 {% p H O$ a else set A_induct to 3 * l. _! y# x+ D
set A_i to 05 M: S. c6 O+ n/ L- k# W
clone 1 load to P_induction
) b P9 a" h' d% W% v( I; E8 Z' H wait for A_time sec
9 M9 \$ P8 v3 R$ q7 q! Y; T end
: P% e6 I( v" S$ [end
" L8 u! p3 G; i" `% ^
5 ]0 |0 ]& J3 y* ibegin P_induction arriving4 ^: S, k+ }/ V* k8 B7 w- ]
if A_induct=1 then clone 1 load to P_pick13 `: o9 r) M+ `. R% [* y
else if A_induct=2 then clone 1 load to P_pick2! z: R% s3 r7 ?% x0 f, I" T. O. A
else clone 1 load to P_pick3& C* `1 l2 {( j0 Q) R# f' Y* J% q
end
0 P) r- M; a3 ~' g" ^2 b, l3 K
$ i( g! t- B& R$ ?( C5 L1 D4 i; xbegin P_pick1 arriving
! B8 y" M/ z9 j5 q7 _( O9 y8 G set A_i to 17 C3 T3 {. E. ]0 B: X# U
move into Q_induct1
5 U. R3 }7 g- P move into pickaisle.induct1% l- U( H' |$ O* {0 @1 X6 [ i0 h" s
while A_i<=30 do begin
( I/ t, v3 a/ U- T travel to pickaisle.con(A_i)
6 B0 \ |, \# W; r; H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 R& W, E8 ~7 P+ A else wait for 10 sec
6 \! M3 C0 X8 y. {6 L5 ~4 }. Z if A_i=A_leave then send to die$ o, l( s+ h& s1 L- h% E- h
else inc A_i by 1
" S* Y" T3 M$ i: `# G. J b end4 J& o; [5 k, P/ t* {( z
end1 e( X2 J1 y/ w) F# N% i
7 @( p8 ^& P6 P) Z
begin P_pick2 arriving) F: h: _7 u* Q; A
set A_i to 11
. i; s# l0 e$ Q: ~( c move into Q_induct20 M8 i) s: R5 r* R- c2 {# N
move into pickaisle.induct21 X' X* Z; u0 D. \
while A_i<=30 do begin; M8 Q' ^- K4 M3 C$ }
travel to pickaisle.con(A_i)# w# W% q4 p; W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) O9 ^5 B2 Z$ y" v0 H" l
else wait for 10 sec
( z# k, K* U! m if A_i=A_leave then send to die- b+ E' w3 p6 y0 }" i
else inc A_i by 1* `; P5 m& h& u7 A" _- W- I
end1 |5 r. Y# @! A3 b) P) f
end
% ]0 ] @/ Q- @/ f. t. @9 x' N1 F! A5 g, w# ]5 I, Y- h7 C+ A
begin P_pick3 arriving
1 }) \, K# x" B set A_i to 21
3 h* q; c3 M, h move into Q_induct3
$ A# O7 x. ^& E9 b r/ | move into pickaisle.induct3) d1 n. o/ U/ }3 `+ F( D
while A_i<=30 do begin
5 }4 p7 W$ L" p! g travel to pickaisle.con(A_i)
; S6 E: }" z3 `# Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# b# U# O; a: Y) j5 t else wait for 10 sec
* R" W/ A* c( @6 ?' k if A_i=A_leave then send to die5 F8 i9 Q1 P1 X. a" t2 ~9 s$ S
else inc A_i by 1
% F# L/ C1 R$ X! c2 b7 c j! y end# }. ?- a# ?# P, l9 q0 S% A
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,其它按你的 ...
|