|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# g+ w2 Y, a* j8 C& W y
D6 h: D7 c, l& N, i我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ ^! o9 I( E5 ?$ \# m, q
: G [ }+ T0 ~' P# f8 m) |begin P_read arriving) d. i0 C2 f! C* h: l7 [/ n5 y
while 1=1 do begin, x: `$ I6 V* `+ w
read A_tote from "data.txt" with delimiter "\n"$ |. o, \6 A0 A j
read A_time from "data.txt" with delimiter "\n"& X, N8 _% d( W7 @
read A_leave from "data.txt" with delimiter "\n"
; `! n: C$ T6 f2 k% Z! f3 P! n* Q read A_picks from "data.txt" with delimiter "\n", D/ {' _. i. ]& G+ ]& G
set load type to A_tote# ]: Q( k q: [6 p2 [, m* U7 ?; x
if A_tote="tote 1" then set A_induct to 1+ Q, o2 D" g' g k- {3 s
else if A_tote="tote 2" then set A_induct to 2
% b) k0 M6 l# ~$ P I+ k else set A_induct to 3 9 i5 |/ ^7 ]$ p3 @+ f
set A_i to 0& G) s1 w) K& g$ k7 v$ }5 P
clone 1 load to P_induction* s. }$ ~; |5 _: \9 w6 H
wait for A_time sec
$ ?9 J- X- n% _( { end
; \. D: {# r& |2 \4 j0 ^end/ `4 i: v* k2 k; [
c- i8 c0 U: t3 [. S$ `. r: t
begin P_induction arriving
2 s/ j0 E9 T/ z6 p+ `1 ~2 L if A_induct=1 then clone 1 load to P_pick1
' I% B4 v& w; J' e# ~ else if A_induct=2 then clone 1 load to P_pick2
+ A6 M1 E0 A- P9 Z, d# W else clone 1 load to P_pick3- [: P1 B, s- m8 E
end5 E4 W- ?: a1 K3 q! Z2 g
' {/ P. e/ {1 a6 `) o; L. gbegin P_pick1 arriving A+ u- n9 }( C7 u2 W q' x, s. d
set A_i to 1
4 S. {; w! ]1 |" M move into Q_induct1" p8 d: `8 O7 _+ M- z, [) l& |& I
move into pickaisle.induct1
1 Z* h# o& l4 i while A_i<=30 do begin
4 R5 u$ P; H2 a travel to pickaisle.con(A_i)/ H2 Y O# l, {! j5 x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& `7 |, P9 J/ h
else wait for 10 sec
9 c3 M1 p' u& z, c& m if A_i=A_leave then send to die
, F" }- p2 X! y6 M0 m6 R, L else inc A_i by 1
4 |2 x6 S* Y; s7 ]& G end
( {" Z+ p' j7 B% c5 [9 Z( Wend
5 m7 Y, m# I: A4 Y$ H% f) F x2 C5 w8 Y$ }" o1 J! ?: _0 c
begin P_pick2 arriving
+ ^; c0 T/ q! ~, F8 N set A_i to 11! J( A) Q2 x, U' a: x
move into Q_induct29 _2 ~2 `1 `6 h' `7 b3 L1 u$ j1 Q
move into pickaisle.induct2
2 l$ t: Y* W& Y' \8 n& \3 K while A_i<=30 do begin
# I; O4 L$ c* p0 [/ V. E/ T! t travel to pickaisle.con(A_i)
, ?$ }: y0 r2 _! {$ M3 F6 B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* y* f4 O5 R- _2 a! _/ H2 {. u
else wait for 10 sec2 z( N/ Q9 w7 D& j
if A_i=A_leave then send to die
4 ?* V* {5 X' n else inc A_i by 1/ q/ W4 i0 C) G3 M5 j
end
2 c) v$ {, h- t7 f) K. n8 }8 w! Nend$ e& Z# s7 Q6 N2 R3 Q9 t- ~
% h" f$ u" v5 o( V8 \
begin P_pick3 arriving( l! [* ?# I4 l r! j+ f9 O
set A_i to 21
# s' \2 {6 b* E+ O2 R% l; q1 | move into Q_induct3
3 J* D4 D7 i; `" b' E move into pickaisle.induct3& L9 W) w/ j% r5 r; ]+ u
while A_i<=30 do begin, k! S, N7 `6 w& y7 z% E) b
travel to pickaisle.con(A_i)
0 {" P* T; @, O& a" m) ]- h0 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; K# V% H$ `; w$ P
else wait for 10 sec* `9 j) ~/ w0 L9 T* n6 M' @; B4 u
if A_i=A_leave then send to die
+ J, B6 s" K" u' t' z! @2 S4 S7 x1 w. I else inc A_i by 1
2 u$ d% w# R, r2 B5 W+ W' _# | end
2 k9 _) H7 o+ h5 k J$ m7 Tend |
最佳答案
查看完整内容
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,其它按你的 ...
|