|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 v) O5 F5 n4 S; G) [' s) x
* s: p- q5 h" ?1 V+ Q$ 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中的数值,不知道会不会有什么不妥。
/ ^. `$ f3 D4 ]
+ P+ j, x+ b' m- H( t, M u, cbegin P_read arriving
3 G5 s, [* e( m+ O( p3 E while 1=1 do begin+ }. K, `4 `* k3 \+ w" f N( d
read A_tote from "data.txt" with delimiter "\n"
8 q' d, y& Y- t- c2 R read A_time from "data.txt" with delimiter "\n"
/ J9 t+ G' g5 c5 Y6 a read A_leave from "data.txt" with delimiter "\n"
. E; E, z7 e' l5 n( g read A_picks from "data.txt" with delimiter "\n"5 n0 ~5 K( a- w8 }, P8 R
set load type to A_tote, a+ @+ ~( D% ~0 ?9 y6 u3 w
if A_tote="tote 1" then set A_induct to 1* E3 N0 L# j1 k: i& [) S
else if A_tote="tote 2" then set A_induct to 22 p/ K& p1 v" I! }
else set A_induct to 3
- E, t" N. G( W2 V8 I/ [! V set A_i to 0
6 ~4 l; C _' M8 w* U4 H- H5 A+ D clone 1 load to P_induction
- P( R( u+ L( I9 v6 g) t wait for A_time sec% n" @' r$ \" f6 O$ P8 A9 j
end* _$ _- [8 u$ B; A
end! q) @ M- D* C! K' T
/ I1 c* ^) _4 l0 Ybegin P_induction arriving
( |9 S" D* n% h5 e) F0 C6 M if A_induct=1 then clone 1 load to P_pick1) j$ D/ z1 K; h% d& }% a8 f
else if A_induct=2 then clone 1 load to P_pick2
! ^% Y; {3 a# n, |( q4 A2 @ else clone 1 load to P_pick3
. o/ `# g# ~2 J# N- v* Kend7 q/ \. B- t' n( m2 n
$ q( j$ o6 C2 m/ U. H9 c; M5 X2 U, r
begin P_pick1 arriving& a- `5 i- D( `
set A_i to 1
* S: i4 S2 l* i/ t/ J move into Q_induct1
3 {, U& y/ U- r6 @ move into pickaisle.induct1
* E) g" j: a' K8 e% F3 t( y- X5 C2 ~ G while A_i<=30 do begin& [' j. b6 T. R# k: A7 F- ~
travel to pickaisle.con(A_i). n. F1 W+ ?; P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 T. t- `, q( K/ o0 d' u/ f t7 L* m
else wait for 10 sec! d) ], ], ]$ j+ J/ Y$ |. a& ^
if A_i=A_leave then send to die2 W- T2 F& Z! w. V: S
else inc A_i by 1. _) o3 N3 j1 v$ @0 q- Q
end
# c$ H) e; V# G( Z8 Aend2 ~6 y' }( {) i& r8 Y7 `
+ f ^0 m! D) u0 c" X) U" pbegin P_pick2 arriving6 v& Q( N; r2 [; A6 t4 C
set A_i to 11
" j, |3 v" D/ T6 L8 }( t. u# U3 A move into Q_induct2 S$ z6 Z* X# G6 _9 X8 Z# E& [& {( l
move into pickaisle.induct2
' Z0 l; w: J1 I4 r while A_i<=30 do begin! e- ] c8 {& o4 h* B
travel to pickaisle.con(A_i)
& u, h7 d \% h1 c# J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- c, B5 w% n0 p e E4 g* J, [3 c" O
else wait for 10 sec
% E' J8 X# n6 X2 l' V5 G% o& m) J if A_i=A_leave then send to die5 R: f5 x# X( j( C' c
else inc A_i by 1' V K/ e3 u. v3 A! }: E
end" Y+ \# s8 `! x6 Y4 P/ W
end
l+ y$ v2 m- _0 }! X& r1 F) _: g' w7 Q) \- s( L1 ]) x) Y; f' v
begin P_pick3 arriving" i: Y) W. y5 q* O" Z. T/ t
set A_i to 21
+ v) v: i) w# q0 r; p1 X! | move into Q_induct3 r" }7 @; C0 f7 n
move into pickaisle.induct37 x0 z7 }$ | U9 Q5 O0 t! F
while A_i<=30 do begin
" W2 u2 n/ G6 [' z) w" D q travel to pickaisle.con(A_i)
7 R' l9 S9 X7 k' C, i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( X& E0 \; [( M$ m4 k else wait for 10 sec# x/ m# w w9 @* V
if A_i=A_leave then send to die; K; ?( S. ^: o# S5 c7 p2 ^* N
else inc A_i by 1/ v* `2 L; J' Z2 [
end; E7 Z6 J( L+ |
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,其它按你的 ...
|