|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 v0 u# H0 i d4 y1 j/ d& R
8 k7 Q5 v' ]' B- U. F N/ v. o' e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) c; S3 u; g3 ?! u! ~$ X' F9 w
8 d+ ? m8 Q# h9 i+ q3 S% t5 \" lbegin P_read arriving
; w. A8 C* M5 t! p while 1=1 do begin7 w' b, U$ Y: a4 l
read A_tote from "data.txt" with delimiter "\n"
3 b: l9 V. z" h read A_time from "data.txt" with delimiter "\n"
5 E6 w) F! J, T7 H read A_leave from "data.txt" with delimiter "\n"
8 G7 i+ n4 G% g0 T' ?" j. I9 r read A_picks from "data.txt" with delimiter "\n"
) g! W0 l5 P4 F! z5 ~4 h set load type to A_tote
: J% ? @" @5 |7 q if A_tote="tote 1" then set A_induct to 1
# d; i0 ~0 w' N' {- V0 M else if A_tote="tote 2" then set A_induct to 2
- b7 t" x7 `: c+ d) j else set A_induct to 3
$ `) \% h; d+ e4 |+ R6 G4 H8 r set A_i to 0
0 ^* D7 S2 R' p; o4 s6 a8 _ clone 1 load to P_induction% X+ P' d3 `, k7 [/ }/ G7 s
wait for A_time sec7 J8 ~! X2 c( U* ~
end) H& q9 @! u3 @! P- J" J
end; D" g; K1 b; X3 F
4 }+ [3 m' n/ t. D! e0 g6 @
begin P_induction arriving
2 D, F* C( S3 n# C8 f9 n if A_induct=1 then clone 1 load to P_pick1. v7 k2 j7 X% P; z4 f( A( o$ X
else if A_induct=2 then clone 1 load to P_pick2
0 d7 Q& b. Z' z, W+ ~% \4 j7 l else clone 1 load to P_pick3
6 S- @3 A) ?; |: D7 Y/ {8 s @end
3 d0 R; S4 N$ y& e$ {) s7 ]1 {: b
3 I- g( Q# S% ^8 kbegin P_pick1 arriving# m: `" c5 |% ~: J T8 [3 N
set A_i to 19 U3 t: o5 }. M: \, ~
move into Q_induct1
8 ^' [7 F+ f6 g; y& a move into pickaisle.induct1
% u7 B, h4 W% n* N1 G; N" {1 Z while A_i<=30 do begin* }* \2 u- Q! w0 F7 o9 [# o7 ~# s
travel to pickaisle.con(A_i)
) Z* @4 N+ I/ v! e Q; q) ?) H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 ]/ e9 r3 q% \! i1 q! M5 h! p) F else wait for 10 sec
1 W- r% s4 [% ?. | if A_i=A_leave then send to die) h! i" ]+ p8 R _
else inc A_i by 1
7 U! ~: M8 g" N6 H2 n7 D end! `9 d# ~4 K: N( G
end- d% x; [: _! X/ h# z& Q c$ ~
/ g7 Q0 }$ ?9 o! ~# R% ]8 Abegin P_pick2 arriving
" k3 U+ U8 i; q set A_i to 11
- U/ ~+ w. I) q2 ]) e move into Q_induct2
6 A; t/ K9 ?" Y7 V move into pickaisle.induct24 @' W; y$ o' h( L% {! M
while A_i<=30 do begin# d1 J& I: S8 s2 l Y) q: {' o
travel to pickaisle.con(A_i)
) d. M! _0 g: X) X# A) b* ?) s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
o$ ~& l. Y" L* x5 c else wait for 10 sec
. l" c* r3 S5 h( d; i6 G0 e' P if A_i=A_leave then send to die
+ ]: A4 l: h5 Z6 }5 g else inc A_i by 1
' \( X; H9 _6 U% v$ i& C' B1 q/ j" L end( s3 i* z5 m3 [5 E/ n" K5 z/ r/ l
end
# j, j# n B: k
8 Q& @$ {$ `" ]- j% _begin P_pick3 arriving
3 o) d S9 _- x set A_i to 21
$ p6 w, A H6 g. \8 t+ P ? move into Q_induct3
2 H3 _ p# t1 z7 t+ B move into pickaisle.induct3; M2 a6 L [2 ? Q9 _$ k# D
while A_i<=30 do begin7 W& W6 V3 ]+ |0 u3 T- K# G4 X
travel to pickaisle.con(A_i)
/ e/ f) J3 _3 j1 p' E7 A* P1 e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ m/ d" @( {+ S( s
else wait for 10 sec
0 ^( _, {. w, t7 ^ if A_i=A_leave then send to die
" `% ^9 L- P3 h7 ~ }) T7 } else inc A_i by 1( q+ J6 Z5 L/ p4 U! H8 y
end( D( c$ m |+ ]6 I! y
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,其它按你的 ...
|