|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' J/ c) I& B$ h2 }1 C' W! P
: z% X" r& c j, T我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" w, G& V! o G, ], d# d" h; ?3 y5 v. k1 s- z/ L) E" H4 b' U
begin P_read arriving
/ s! c& j% c8 K) J while 1=1 do begin) I, A1 h) E4 }6 V y
read A_tote from "data.txt" with delimiter "\n"
1 e/ f! E! b# c5 J. O q read A_time from "data.txt" with delimiter "\n"
8 z. K- a0 h1 q, L read A_leave from "data.txt" with delimiter "\n"2 M' Y$ H0 w7 l0 M
read A_picks from "data.txt" with delimiter "\n"
- n- F: _, U' Z5 B set load type to A_tote7 g0 e' ~! T) g2 Y9 l+ S( \
if A_tote="tote 1" then set A_induct to 15 [0 Z% f4 z" R" |
else if A_tote="tote 2" then set A_induct to 2
; m' D: |/ Q8 J/ z f8 d else set A_induct to 3 5 b; K; o% y" H. n+ _# b. i
set A_i to 0
' h( B, G3 e2 |* i7 o. n* m clone 1 load to P_induction3 v# `- Z9 ?- R8 ~; b: S7 G* b4 t
wait for A_time sec
( Z. u/ e) w" r- o9 P( A end
" ~& t" v8 h& F/ y2 kend' P0 X: K. E0 }1 g% u( f
9 X9 n3 P. R, |+ Z3 Pbegin P_induction arriving
( O. h4 l2 h1 l0 L# J if A_induct=1 then clone 1 load to P_pick1
1 e! O' f, P- k! L else if A_induct=2 then clone 1 load to P_pick2
" ]! I: L3 t8 v; A/ w% h else clone 1 load to P_pick39 [& t3 T! [# [% C
end7 E( d8 b- r. ^) S# V
; }" L. k3 x% S4 E3 N* f$ c
begin P_pick1 arriving" E( k$ P0 O$ R P/ `9 f& _
set A_i to 15 o0 g7 r" \3 x" v# N
move into Q_induct1
' V7 I7 P6 f6 a" o' `" I move into pickaisle.induct13 \& z* p+ ]* J1 u5 G$ F3 m3 e+ s
while A_i<=30 do begin- |5 V3 k) G1 z8 h5 W+ O
travel to pickaisle.con(A_i)
# r! c: o! o9 U, H3 x- f+ T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 f' w- P% y3 ?0 }5 x/ L
else wait for 10 sec
! v7 \! J! o \. a0 h- ` if A_i=A_leave then send to die8 V9 X+ ~' x" ]0 I! M
else inc A_i by 1
3 d+ e0 q! W( e) Y# s, X! b5 Y end
1 b+ D d. E8 {! @2 A5 U w# Fend
# J6 V+ M c0 ?8 t1 m5 x6 J3 C |6 r. l
begin P_pick2 arriving
+ k, b4 h0 q% I% i* l( j set A_i to 112 z: Q) P6 z' p7 w2 u/ }7 j9 L; c
move into Q_induct25 {/ g" g4 W6 F; R" y5 C/ w/ ?, E
move into pickaisle.induct2
: h" i/ Q) U2 N6 b* Y! x y5 G while A_i<=30 do begin
4 e1 p3 A7 }4 F3 A travel to pickaisle.con(A_i)
; |2 w/ i9 ^ t' C4 G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 k7 b) o5 C6 Z! ?8 f! ~6 p
else wait for 10 sec4 b# q- E8 j7 h/ Z& {# V
if A_i=A_leave then send to die+ l3 v% W2 c1 N5 H# u. z
else inc A_i by 1
. `$ r; v0 `5 ]- i end, Z5 z3 T; N" } }% e& d$ g
end* k9 u- [" }% t1 ]7 {4 g4 X
u, F4 J2 D; A0 ] O, l/ K
begin P_pick3 arriving
% t9 s! G. ~$ C8 L# L set A_i to 211 M2 }# i- W/ K# x8 x
move into Q_induct3
6 w, Z$ R% I7 N move into pickaisle.induct3
2 |! S7 _8 e( h. V0 o while A_i<=30 do begin" U+ m$ ~) k" v1 y M. k
travel to pickaisle.con(A_i)/ q8 `7 R0 J& o3 z4 Y- \7 x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" X, s+ g7 m q, @3 \! A8 M4 B/ [
else wait for 10 sec [9 O1 x8 o% w" `
if A_i=A_leave then send to die! d0 N8 V! h$ ]% i
else inc A_i by 1
. n/ [0 J1 t6 f- b. F- K end5 O9 R' a# X: F+ e8 ]* X
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,其它按你的 ...
|