|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' ?3 r% B9 u$ T2 D- k
( [/ d' r3 o* J. B# N( |; 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中的数值,不知道会不会有什么不妥。
$ n. r: J S) ` `
0 S7 z! y+ w2 P2 S' c% Sbegin P_read arriving( u/ ~9 }9 `) h. J) e
while 1=1 do begin, h3 I5 y9 y1 C& V. X: g3 W2 [
read A_tote from "data.txt" with delimiter "\n"
( @. \5 e1 ]7 a7 R% ` read A_time from "data.txt" with delimiter "\n"
, O% A+ ?7 i R read A_leave from "data.txt" with delimiter "\n": y" ^7 H& U5 _6 U, s
read A_picks from "data.txt" with delimiter "\n"9 G/ v& X' }7 Z6 T) @, f3 G2 \
set load type to A_tote
- `8 P) h$ N3 T* p if A_tote="tote 1" then set A_induct to 1' L' Z5 F, Z$ A1 n: R
else if A_tote="tote 2" then set A_induct to 2 t& y8 I& V$ B1 Y- u) v* Y
else set A_induct to 3
3 q5 h) O! E; f( x/ ?, i& b set A_i to 04 U6 P# w3 ]# R0 K8 F
clone 1 load to P_induction& T- w/ I1 q, ^/ [ U2 m5 s
wait for A_time sec$ e9 j6 F4 [2 L
end/ }7 n8 f+ }. T4 j
end
; d: a/ h8 o5 E: i' x8 y5 t6 o) B' E6 w5 `
begin P_induction arriving1 j' }, X$ e! `8 Z R" U
if A_induct=1 then clone 1 load to P_pick19 |, V! }0 C, O+ d! X" C k
else if A_induct=2 then clone 1 load to P_pick2) r3 ^( c1 v+ y' q6 G
else clone 1 load to P_pick3) J4 n3 ~9 p, a: a+ M* i! K
end
# y4 r7 Y7 F% i/ p9 }* t4 Y$ O% U$ j4 j* Q
begin P_pick1 arriving# U$ c- V% B1 N1 ]% @5 `
set A_i to 1
/ A5 ~& g) Y, [! x# d9 P( s move into Q_induct1
: r1 C0 h; c/ D0 s7 V, H move into pickaisle.induct1
" |* o8 H- J9 V T9 M while A_i<=30 do begin% z& g) s! O8 J, J% x
travel to pickaisle.con(A_i)/ v4 A5 H" ?- a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 r _1 m) u& F+ W6 {, ^
else wait for 10 sec
* W( C: c! {) K9 I4 q$ k+ m4 j if A_i=A_leave then send to die
6 F) |9 B6 m4 z1 ~ else inc A_i by 1
3 V; V/ s, ^: |& G+ P end# t/ G+ |8 \( ~' o0 @
end, N% m4 X- D+ E! }+ e1 M' x
. P$ a4 d- J, @* o3 k# q( a, rbegin P_pick2 arriving) }0 m9 e# p! }+ T) x# }* u
set A_i to 11- ]7 ~% _+ D2 H
move into Q_induct2
+ K/ F7 r, q; d! S9 y: j; O$ z move into pickaisle.induct2
6 c- E8 l6 S) T3 V1 W& Y# h while A_i<=30 do begin/ r- U. B$ V# K8 ^* [: x
travel to pickaisle.con(A_i)# z9 h! M7 P4 N+ p ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* q3 P3 C+ z' {* {( {, V' H+ `
else wait for 10 sec
4 ?: H6 e! v. A6 v8 S( \ if A_i=A_leave then send to die
9 @' Z. ~* \% w2 I else inc A_i by 1
7 {0 S7 A9 |2 F; Z6 M end
2 W9 Q! ]( ?# L7 cend
- U9 i* }, S% x& m' l& V0 L- a7 X1 ^( w2 a3 U( y v( s) b
begin P_pick3 arriving
; m+ h! k2 n0 z1 t. {9 |. r' k# f, @ set A_i to 214 r. u. r& C2 i+ z1 B% k
move into Q_induct33 w: _: Z8 m" R9 u
move into pickaisle.induct31 ~* x) P! q& x' t' y3 ^3 ?- o
while A_i<=30 do begin
- C# U* L4 _" g6 H% ~ travel to pickaisle.con(A_i)
# `0 `0 B# w" J. b) H" b& s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 S" N7 s" r' X" [7 g6 A
else wait for 10 sec% @+ b0 m2 _* T3 w
if A_i=A_leave then send to die
! f5 Z" Y8 Q$ f, ~# F' } else inc A_i by 1
" f5 X8 q5 C4 b/ k$ R! d end
( I9 ^' q# ?, ]# B) Bend |
最佳答案
查看完整内容
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,其它按你的 ...
|