|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 F' [7 b' e" [; f5 B' n# m, |# Z2 D, R/ n4 Z. n9 Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& q! G1 t. A0 C' N. b5 p+ Z u6 C
begin P_read arriving2 X* z6 y9 e) ~: x7 {- H
while 1=1 do begin% _+ Q7 L$ U' D8 [1 Z U
read A_tote from "data.txt" with delimiter "\n"& e. |/ N, D! n. r2 |
read A_time from "data.txt" with delimiter "\n"
2 ]$ Q: r5 _4 Y8 R read A_leave from "data.txt" with delimiter "\n"9 n$ }9 z" u, g$ N( T- y9 t& _
read A_picks from "data.txt" with delimiter "\n"& ]* ] a" o8 P
set load type to A_tote
0 \+ R) O# W* m+ c" J* X if A_tote="tote 1" then set A_induct to 1
5 k6 H" c& i* C, Y9 @ else if A_tote="tote 2" then set A_induct to 2+ T6 U+ }* w) R4 J9 W
else set A_induct to 3 : [+ `' z% x+ }, o" a) l* H8 i' Y
set A_i to 0
0 h' h" M% c( p clone 1 load to P_induction
* O2 k; Y' W. w: ~9 L, E1 _/ R wait for A_time sec3 e; u, Q, ?# {8 G3 m& E
end' `3 a7 b" G" q1 k
end5 [6 f' ^% Q8 i3 l
2 Y m$ K7 x' c# N7 ubegin P_induction arriving0 s3 {( w; o- q g+ {; r
if A_induct=1 then clone 1 load to P_pick1
1 [2 B$ D* Z- r) W$ G9 S else if A_induct=2 then clone 1 load to P_pick2
3 h; K' Z5 V# _; o- {. @ else clone 1 load to P_pick3" d8 t+ G" c( B0 _* ?
end
( h# G D* h$ {& | U* G( Z3 j+ W# O7 p+ u. \9 v6 G. s
begin P_pick1 arriving
) D* Y6 ~0 {/ d) G1 l; u- n) g set A_i to 1
# `# d& m5 T [1 V6 r' t8 b) ?4 ~5 W/ [8 R& i move into Q_induct1. A+ r: u5 a/ e! e d
move into pickaisle.induct19 K5 @2 x" y r' @ p* r, i
while A_i<=30 do begin
; T# ?9 M6 C( V! E% U5 l# W travel to pickaisle.con(A_i)
/ T) G- `/ `. r6 ]* U$ `% z9 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ B" ^2 U; G4 q& A4 B, c
else wait for 10 sec
# \2 i) a* ^ s8 f# [; n: L: f if A_i=A_leave then send to die
1 I" B% M! `8 s6 \0 | else inc A_i by 1( g1 G) G$ h8 g5 N2 y( d g
end3 S% m" V( W% L( G2 O
end+ y8 S+ i _, X% P7 @: i0 W _$ P
- g* h& H6 y( T$ v. A5 Q; J8 ^7 Bbegin P_pick2 arriving V0 T7 v5 O1 W( U6 x1 S4 B
set A_i to 112 ~+ l4 `' V9 P- q, V! F
move into Q_induct28 I, S0 p% Z! r0 n# ^" ~8 S
move into pickaisle.induct2
+ g3 ^' u5 E: \& X I m while A_i<=30 do begin
! ^2 D; `8 a. h9 Y$ A" t travel to pickaisle.con(A_i)7 z8 _2 z" O$ N8 J6 l7 U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) [/ j$ C1 ~6 e: t5 N
else wait for 10 sec- g. { p7 E% h( r1 O' U$ P x& \- V# k
if A_i=A_leave then send to die8 q1 u! W9 U& c. x8 c
else inc A_i by 15 A. H- J! c/ B M7 y
end
0 E' [4 t* B4 z* Rend
" p3 H, z! T1 C( s3 P1 {# e: A. P2 b3 B( }# O
begin P_pick3 arriving% F8 X) H' ~8 J- x9 L
set A_i to 21
2 x( g' Q3 E- p move into Q_induct3
2 K$ n5 d; q0 c! y I2 F8 u, l move into pickaisle.induct3
0 V( Y8 @4 O" Q6 t8 F while A_i<=30 do begin( U* z! r! K) Y- j
travel to pickaisle.con(A_i)- a$ V7 C, d& k2 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ?; G$ [: X3 J else wait for 10 sec% J; E q0 P3 i
if A_i=A_leave then send to die; F c% k% ~* p( p# F- a
else inc A_i by 12 {: C( k* }1 t7 {( _6 t# W
end! {( G, A. m+ @5 P
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,其它按你的 ...
|