|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! f4 C+ \) _5 d- p/ d9 v4 _3 R
% k7 J+ Y- E8 y4 U/ 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中的数值,不知道会不会有什么不妥。9 b, H' M& U8 s; Z W& M
. R ?) D2 E; `7 R1 C8 N% e
begin P_read arriving
& A$ O0 p6 y4 z# B: r ^ while 1=1 do begin+ V( X! k+ V: G1 A( E! B
read A_tote from "data.txt" with delimiter "\n", E% z z% s/ f+ F
read A_time from "data.txt" with delimiter "\n"* f6 e& t% _# h5 J' G$ _
read A_leave from "data.txt" with delimiter "\n"
9 f% |9 O# u+ H) y; ` read A_picks from "data.txt" with delimiter "\n"
7 h( W$ I9 g& l6 x0 {! `9 ? set load type to A_tote" e; O# ]! U) ~; v' t
if A_tote="tote 1" then set A_induct to 1
3 \4 h) h+ j( l else if A_tote="tote 2" then set A_induct to 2
& @) k& h; d# H$ X- H else set A_induct to 3
4 C- n4 T; T; K! |# D M set A_i to 0
) S1 q J% K4 E% i6 k clone 1 load to P_induction$ r7 a5 W- g) o6 K& \: o
wait for A_time sec
8 O5 ?2 b5 S3 a; o9 [5 ~ end4 ]! `( x. T! y. j
end( C; `) r k {: A) P- B
' Z# j- h" u X# k b
begin P_induction arriving2 s5 g! m( p, B1 u6 S0 f& i
if A_induct=1 then clone 1 load to P_pick1
' I: M9 a. [" V+ X: r8 T, S( K0 e else if A_induct=2 then clone 1 load to P_pick2* w' D+ b6 k! M0 a& Y
else clone 1 load to P_pick3+ q/ }1 R8 m; q+ v7 p, s
end
$ Q, R2 |% L& |+ _
8 W2 g' ?5 r9 Z' E3 s& Ebegin P_pick1 arriving/ ^$ j) ~/ m3 E; h5 }0 }( }" j. t: B
set A_i to 1/ [ p3 {! I7 k/ Q8 u* S1 z( v6 T: Q
move into Q_induct1
. Q' w; M, D2 q5 y move into pickaisle.induct1
# T4 _" `+ s2 r' s' f while A_i<=30 do begin
3 f& C M! X/ o) A7 f; Y6 ] travel to pickaisle.con(A_i)# T, | ?# b9 z8 B' t! F' ?" b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! `2 N, X1 m6 V else wait for 10 sec
' I. ~4 K7 |, z L5 ? if A_i=A_leave then send to die1 z) N1 A& J, t$ {
else inc A_i by 14 l4 b, b' D; A5 q8 h
end
6 N6 B a8 b" I4 y# }end0 r% B$ ]6 b" f2 R/ ^, y* S
3 n( y+ \. m* L9 Y: t0 U
begin P_pick2 arriving3 P' J) R8 b& B- Y
set A_i to 115 {6 ]) U, N( h- c2 Y+ z
move into Q_induct2
! j! L, \% {$ ` move into pickaisle.induct2( l8 L( i, E* B2 x0 d4 x8 k5 y
while A_i<=30 do begin
' `2 `4 H8 H6 N1 w travel to pickaisle.con(A_i)
% u; `0 B" a* `$ D% f: c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( V( R" a* B: P7 s
else wait for 10 sec$ _: J- I! D& P" l% D. v
if A_i=A_leave then send to die
/ G/ S% E& A# f x9 ? else inc A_i by 1
3 M" T" K' n* j( | end
: w' E5 r9 o, Q/ K p( _end
; _7 M0 j, B0 ^. x4 |! W7 m# B
* m- E) e/ M6 r$ [3 S% Jbegin P_pick3 arriving
) J* h4 D- o$ a! G, j9 ~# j set A_i to 21
- {- e" e6 y: H. f* A5 n0 Q move into Q_induct3
3 N& ?% `8 Y- g9 j; ] move into pickaisle.induct3' u+ V n& \& a) i
while A_i<=30 do begin' m* V$ i& u/ j) W! M
travel to pickaisle.con(A_i)
/ R# W6 Y8 P& i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ l% E( B7 \" a' t I9 w9 D5 W( w else wait for 10 sec% z9 I# [' z& U0 J- n" s1 k/ |, W
if A_i=A_leave then send to die9 i+ d- s$ u' \9 ^5 M; @
else inc A_i by 1
; p3 Y: u0 q; L, [1 Q end0 }7 }$ w% C. |7 a6 S* P" _( _0 _4 Q
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,其它按你的 ...
|