|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 N/ Q% F0 B/ D4 m9 C: u" B
3 k% R) E9 e, W& b8 K2 ^我的问题是,在每个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中的数值,不知道会不会有什么不妥。, J* n; M6 V/ e8 _5 Y1 s
; r7 C0 ^8 W8 t$ k. b' v
begin P_read arriving
8 o7 J0 b( \; O3 U) R. x7 _ while 1=1 do begin9 P+ U9 m$ o2 x6 X
read A_tote from "data.txt" with delimiter "\n"
1 i: k' R& @( } j5 Z" N read A_time from "data.txt" with delimiter "\n"; t/ D4 a3 |: }( O5 w( j
read A_leave from "data.txt" with delimiter "\n"4 D5 h; k4 Q6 @# t& J
read A_picks from "data.txt" with delimiter "\n"
P1 r9 v y6 B9 j+ w# \ set load type to A_tote
, ?2 ^ b2 y' D: c: ^6 Z if A_tote="tote 1" then set A_induct to 1, m5 q9 f& ^$ F2 Q$ w
else if A_tote="tote 2" then set A_induct to 2. e$ c5 I; q# n5 t7 ~* E& w
else set A_induct to 3
- ^! U9 A1 i f- q set A_i to 0" n$ F( ?# X, F0 d% B
clone 1 load to P_induction3 w! R7 W9 h" S+ v2 P
wait for A_time sec
C. ~5 D# N6 a* w end
* [ ~2 f, [4 W4 v* n1 |9 ^1 lend
2 I+ G+ k; J- Q7 G) j. N$ Z4 ~! H0 n& e6 f, e
begin P_induction arriving
4 e7 ?$ } I6 O3 @7 c' d7 D, U if A_induct=1 then clone 1 load to P_pick1, n1 i1 B1 a3 n7 `- R" N% G2 \
else if A_induct=2 then clone 1 load to P_pick2
$ e, w% K+ B( B, H3 _$ x5 z else clone 1 load to P_pick3
9 o4 P8 Z4 x1 Wend
9 @' {! s5 ^' U: _% t" n/ a, g# r4 @' U& i
begin P_pick1 arriving# b' a1 V/ v: ^& w4 T
set A_i to 15 Z1 T/ Q. H0 p: D5 C6 O
move into Q_induct1
0 z; z' C% |9 @, [- |' Q: N move into pickaisle.induct1
+ T( J: Z$ ?( s# D0 e while A_i<=30 do begin
/ J; S4 M4 R) D/ Q9 r. R travel to pickaisle.con(A_i)
5 ^6 ]/ X. `% O4 _ y; w6 ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% A, Q! ]1 N1 F8 E, Y9 s- z6 w v
else wait for 10 sec( p- j0 b( V! k6 k7 Q( ]! `
if A_i=A_leave then send to die. m3 s) r) A$ C6 Z
else inc A_i by 13 V; h2 ~; q& Y- w5 _6 b& R
end' ^8 D* o" \0 c5 {1 n
end
2 _. g! F6 ]/ S1 T
1 b/ }- X; D) S7 w9 V. t0 g$ kbegin P_pick2 arriving9 K! F% ~% L) ~
set A_i to 11( z* t$ S6 X/ p9 D5 C' c. z) T
move into Q_induct2
3 l. x n6 u: t# I' b/ B4 H7 [ move into pickaisle.induct24 S$ r) Z( f, R- u$ \) R5 b
while A_i<=30 do begin
* Q$ }3 b/ _, [; c2 w travel to pickaisle.con(A_i), N% I% u; Y% U: u5 R1 Z2 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% J& \4 G) E% S/ [8 H
else wait for 10 sec
6 i# K" f3 z; H H7 A9 X( U- m# C if A_i=A_leave then send to die0 x$ f+ L, \+ V3 i( u
else inc A_i by 1 S( ?3 _& p+ ^3 C; h
end
2 N. Q# b0 t% M$ n7 A# Rend& P1 R9 W9 q/ \
1 ?% ]/ `6 }$ d; x( e, \6 g3 ibegin P_pick3 arriving6 j4 B0 ]$ _1 s5 X& ~0 {$ o
set A_i to 21
. ^/ K$ \" p$ u( n4 I, b6 | move into Q_induct3
5 R* ]8 v9 T- K6 m# c+ S' G move into pickaisle.induct3
% Q( O0 d V8 N( `1 |6 T) X" P0 y while A_i<=30 do begin; B; p! Z" w' P; D% ^, }
travel to pickaisle.con(A_i)
+ Y9 S2 a% [5 U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, j, g# }) [8 L* l/ Z/ { else wait for 10 sec
; Q5 X# } e" y; v if A_i=A_leave then send to die
! t6 Q6 f$ L" s4 c* R' G2 z4 q' s else inc A_i by 1& ]- G2 s8 X( J" |. \# u7 _
end
1 o; N" [4 { r7 \5 rend |
最佳答案
查看完整内容
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,其它按你的 ...
|