|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) z5 b% `! v7 ]0 X q1 ~! ]
$ ~0 d8 L+ S T+ G/ 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中的数值,不知道会不会有什么不妥。
5 ] W" T n# g6 s1 \" \: f1 O _ T! y( g- u$ q$ \
begin P_read arriving; R8 L3 G1 C' K
while 1=1 do begin( b$ B5 {" A, i- I# j9 C
read A_tote from "data.txt" with delimiter "\n"+ u; W4 R) s4 D! r
read A_time from "data.txt" with delimiter "\n"
" w& e3 y5 _2 }9 ~* O read A_leave from "data.txt" with delimiter "\n"1 Y! T) ~4 n0 h# ] h
read A_picks from "data.txt" with delimiter "\n"
9 n, ?% Z+ e' j" ^ set load type to A_tote
w/ V! q$ V l, H# v5 d% Z$ S if A_tote="tote 1" then set A_induct to 19 K; ~1 M- |& D
else if A_tote="tote 2" then set A_induct to 26 n; g- ?" V9 D
else set A_induct to 3
6 e' [9 w4 s! q( Z% Y& H set A_i to 02 A) Q; ~& p* C) b6 d( Q2 t
clone 1 load to P_induction
' o% B- U; d2 e% i7 \9 R3 ] wait for A_time sec8 V9 {' k7 K' |9 l# ^9 Y
end" F X5 z4 U5 Q
end7 r4 X* e" w* I3 _2 C
' P3 r8 M0 X. a7 |- B# jbegin P_induction arriving0 U* r. \) k; q1 Y
if A_induct=1 then clone 1 load to P_pick1
, \' Z u' k# L/ h2 O3 K else if A_induct=2 then clone 1 load to P_pick2
) a+ |% j% t# B# b! H4 ~6 M7 D1 h# t else clone 1 load to P_pick3# f5 L, Q) P5 p1 I2 m* e. z
end0 r! r9 R' ?* v" s5 ?
# G# V1 f' g r- W% G M; U
begin P_pick1 arriving! j/ z/ X6 t; Q( u% ^' ~
set A_i to 1" [: c# O& N% p0 Q) F: |: u
move into Q_induct1
! n7 A" G. m) J+ G7 ~. I; E move into pickaisle.induct1
+ B/ L% } x) i2 K' ` while A_i<=30 do begin
" W, ~2 h: b' X b8 x* o1 p travel to pickaisle.con(A_i)
& x# ?9 T5 P9 h* X: G' |) | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 u7 r2 N4 ]; y4 s/ W else wait for 10 sec
5 c, v( R3 J, B* q4 P if A_i=A_leave then send to die [/ R! H% ^6 y0 I
else inc A_i by 1 \0 d, \. P% [7 r6 K0 ^) q
end. O V0 v% D" S, g' C
end
6 b, _8 h7 N" S) Z: J% k7 F# n n5 T( \" P, D
begin P_pick2 arriving" F: w. v. i7 k: V {4 \
set A_i to 119 x8 U( ]: ]6 {+ C; y4 t
move into Q_induct2- H+ F7 s) }& Y2 m
move into pickaisle.induct2
* H6 m, a- p1 ?) R) m" A4 c& ?! w while A_i<=30 do begin
' U9 F7 U7 n% S travel to pickaisle.con(A_i)+ T( [8 m1 d. o4 O7 ~! |: F$ l! i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: m0 ?4 Z+ L' j- t5 C
else wait for 10 sec
! ^$ P0 P) n% p9 B: m7 Y% e if A_i=A_leave then send to die
" v' O3 ?/ d2 O& i% e else inc A_i by 1, F( n2 \6 c S
end7 X& s1 y2 v- c$ P
end
# X2 P1 w* L, I/ l9 \, q! y+ C! A) K( o* `) Q
begin P_pick3 arriving
' }& \6 O+ O# C0 q' ?, @2 Z set A_i to 21
6 N8 \6 ^' ~ R2 v& j8 F move into Q_induct3
* \! Y- l0 k) `/ `1 @# K move into pickaisle.induct30 O0 O" g/ H" E, t/ B% v
while A_i<=30 do begin
; `9 ]$ U! u6 t1 L% u) J; e travel to pickaisle.con(A_i); S! P! q. x* R j# A3 F* D( p I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ^7 f' E# Q) C! U3 I
else wait for 10 sec
0 ]4 i6 h. A8 i if A_i=A_leave then send to die
9 w! \9 {1 j2 J, f else inc A_i by 1
T$ o1 `7 z" F end
# S- Z* a: p' a0 m; Zend |
最佳答案
查看完整内容
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,其它按你的 ...
|