|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( N" Y3 j9 d. ^4 E# e7 e
) N# a$ }$ Y9 a K$ `) @3 @我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* q7 J/ r- ]# e* q2 T
j$ @7 D+ P) ~5 x+ r3 C' o# Fbegin P_read arriving
1 o& C9 T4 f+ F7 Z t6 f while 1=1 do begin, F$ \. \! W+ g! l# ]
read A_tote from "data.txt" with delimiter "\n"
3 ~# O5 p0 w+ b7 y- }/ B read A_time from "data.txt" with delimiter "\n"# }) T1 ?: b! a* B* T8 H
read A_leave from "data.txt" with delimiter "\n"3 }- W9 L) I' h* l. [ j0 l
read A_picks from "data.txt" with delimiter "\n"
) X. q: z7 y& K' Y0 i! V' z set load type to A_tote; \% J8 a' @* \$ l7 k7 S
if A_tote="tote 1" then set A_induct to 1
: c: e4 s. a; D else if A_tote="tote 2" then set A_induct to 2
6 D; p+ k0 J% |! W else set A_induct to 3 9 U7 K8 Y5 d# ?
set A_i to 0' T. b- ~: l/ z) I; L5 x& Q) h# v
clone 1 load to P_induction
/ v0 \' ] h$ t4 ^6 A) K! K wait for A_time sec q' |+ a" R8 u! i8 A- m
end
e7 q, r/ U& J) M, J Q5 aend0 K; v6 B8 G+ J; f* w; p0 |
7 V; q4 k. t1 M+ U5 sbegin P_induction arriving# L6 c/ }& u$ X5 g% a O+ N
if A_induct=1 then clone 1 load to P_pick1
$ {& F* R+ z* t else if A_induct=2 then clone 1 load to P_pick2
. L5 s1 z/ W1 M& U else clone 1 load to P_pick3
/ \, R& @0 }/ f1 n8 L$ t+ p7 iend5 e) ]# t/ ?, n; Y
' ~! S% ?. p6 F/ Tbegin P_pick1 arriving
3 v |! C+ V3 E0 k set A_i to 1
' _" A/ G- s2 J/ | G/ B+ D- D move into Q_induct1; K7 ~: j0 T- I9 p- _, ?
move into pickaisle.induct1: F% @$ ^. a. y1 B/ e% k
while A_i<=30 do begin
$ N6 z9 ?9 o! G travel to pickaisle.con(A_i)
8 s6 w2 c% U- F9 s9 v# Z1 e& M1 n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% X% ^+ y5 [" D4 L5 ]' P+ W7 [( G else wait for 10 sec
; U. h8 ?5 n: G' F5 O# t if A_i=A_leave then send to die
& V# Q) o7 {6 E8 N7 l else inc A_i by 1 Z% N) {* e5 ^4 Q
end
7 a/ M9 u' y: f6 n# N7 gend5 u) i. I( q- @6 E7 ]- T/ @
( x+ G# A( F) f7 A% W/ |begin P_pick2 arriving
1 g/ P) O6 K9 S1 z set A_i to 11
( F4 j# h0 a) _; p) y move into Q_induct2
) {, {: }, \# X# ?) R! j& V+ s move into pickaisle.induct2+ I8 g0 s: @9 m+ _- r- G1 F1 J
while A_i<=30 do begin6 F2 \6 K0 K; L! ]
travel to pickaisle.con(A_i)
: [" |) b9 f6 i, j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ n5 {7 y& d$ V H8 N
else wait for 10 sec
8 L p$ A3 N& E2 z if A_i=A_leave then send to die
) \1 x ^5 E' x& Q% y else inc A_i by 1- D. T+ w- h9 H, y& M, A7 S
end
+ ~) \2 X9 k) ^+ tend' b7 g7 @0 @% Z3 y3 s$ J- Q
$ O! F" r# N- V- x5 y$ abegin P_pick3 arriving* m( q6 v: j) |9 }
set A_i to 21
6 H2 }0 b' z4 l5 Y) B& N move into Q_induct3
& g$ u: W0 A- @" X move into pickaisle.induct3
" ?' E( J( S" I l while A_i<=30 do begin
{5 [, _6 t9 r* {7 K+ ~. o travel to pickaisle.con(A_i)
s2 y& N( |$ ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 x2 q. @) a' K+ O) o- D: K else wait for 10 sec; q5 |8 d1 q: y7 y. |" [5 J+ P1 R! P
if A_i=A_leave then send to die
6 h4 ^. d5 z+ }4 \2 x, c D else inc A_i by 1! V' z& j! [# `7 L* a
end0 u7 [! d% N, B i
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,其它按你的 ...
|