|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% |& t% g# k! j" R3 Z, t( t3 g
p. M3 t& D2 X* Z# L7 p" p& {- a& {我的问题是,在每个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中的数值,不知道会不会有什么不妥。
n$ e. M7 ^' V( Z& {& T9 N* r# q9 s" U( P% r; i
begin P_read arriving8 ]1 [3 n7 c' r/ D7 X
while 1=1 do begin) v% m6 M2 m6 }
read A_tote from "data.txt" with delimiter "\n"
8 S# E" w* F) F read A_time from "data.txt" with delimiter "\n"/ @% [- ^% J, H+ L: B
read A_leave from "data.txt" with delimiter "\n"$ O( s; V- x5 p' F1 f
read A_picks from "data.txt" with delimiter "\n"3 W0 H6 d2 X) \9 f
set load type to A_tote, o/ L& b) r" ]# T4 P
if A_tote="tote 1" then set A_induct to 1
8 x5 n0 K( z% A! Y3 u' b else if A_tote="tote 2" then set A_induct to 24 R' H* h( y: T1 v# y. L0 i+ H
else set A_induct to 3
; Z( u! ~ e, Z2 O1 E8 d# D set A_i to 0( {1 M8 g& a; O* g' ?- a! L
clone 1 load to P_induction
4 A. D7 s. J, n& X wait for A_time sec
- a" F% `( a: ? end
4 T7 I S5 x# i3 \; Y: Tend
* J4 N- g" L" s1 r- b4 y ]5 ~6 j. C) j" W& p: Z
begin P_induction arriving3 B* R1 r1 ^3 g- _ j# N
if A_induct=1 then clone 1 load to P_pick1
* s& E& h8 z! ]$ |+ s8 Y else if A_induct=2 then clone 1 load to P_pick2
. s& m5 b7 ?+ M. a! | else clone 1 load to P_pick3# |& o+ I: i, S5 `4 I
end4 V+ W& ]8 C: Z- |8 U
; W8 X" {- p/ u* s4 q9 S! g
begin P_pick1 arriving
" H" I* q/ _* s3 F8 \! I' \ set A_i to 1% ]) {- @0 r" C/ O( {& k0 F5 }; ~
move into Q_induct1& d% V# S& ?! b: a. O/ c
move into pickaisle.induct1
5 ]9 \, U2 w* I2 g while A_i<=30 do begin
1 n, l$ K: _: m: c+ I2 N travel to pickaisle.con(A_i)) y4 i- r3 g3 N/ R3 Y) |0 B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- d8 e+ A- b1 w w, N
else wait for 10 sec4 }) S0 z3 I; x4 @7 I
if A_i=A_leave then send to die7 A" y, p" U) {# y
else inc A_i by 12 f& ~6 ~$ A- k
end
* u% u! k: k1 Y) M) Z% Nend
! Z. x# i0 V1 B4 l1 D' E. I9 T: k( b3 ~: A
begin P_pick2 arriving
$ \% Q- L1 ?7 C3 a set A_i to 11
" L' G4 V8 `, h" _ move into Q_induct2
; n8 s, V3 m. m* q3 ?; i2 v" U move into pickaisle.induct2/ r: @, w% U7 R. Q+ k# @: i, s
while A_i<=30 do begin" B/ I$ g1 G7 t; Q
travel to pickaisle.con(A_i)( O# w, r3 S9 `3 [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. |* l- j/ B! b; |* k- R else wait for 10 sec. q# H, \" `9 [6 i: I/ E( y7 g
if A_i=A_leave then send to die$ O/ V" a f4 ]& Z& y
else inc A_i by 1- M) j8 g$ S k" W% ?
end( R; n( _8 D0 q: A9 h. s- x
end
+ p, }* u- C1 G" }" z% B5 D7 d/ ^. S" T& |
begin P_pick3 arriving
: w6 `) I- c: ~6 `" w set A_i to 210 P$ y# X2 Y5 n
move into Q_induct3
# u# t: a6 j" q( `5 @' s move into pickaisle.induct3& [& R" l; ]9 C9 J# h) |' Q/ r
while A_i<=30 do begin# j4 ?( Z" ?- Z4 n! Q/ J% e. O( F. W
travel to pickaisle.con(A_i). K" l3 K3 S" V1 ]8 F! T0 h7 G% I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 E' e; ]6 W9 b; z, a6 `+ j4 ] else wait for 10 sec/ g4 i4 l6 t/ n# k; S* b
if A_i=A_leave then send to die' {. A, \, W& B
else inc A_i by 1' p, S7 Q8 P( e# R# k
end
$ v) \0 {6 K { ~: e+ ]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,其它按你的 ...
|