|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 t3 j' q: r M5 a
# g6 h1 T5 y- a7 P: Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 z: C: I9 [. f9 v, R! D
3 i) Q$ R/ q5 nbegin P_read arriving
( `/ d1 B/ U3 q; k _1 J' {& l while 1=1 do begin/ |2 S2 N% |, F) v* I, Z
read A_tote from "data.txt" with delimiter "\n"
0 [% v; |: N; Y1 d8 M5 P, P+ y6 e read A_time from "data.txt" with delimiter "\n"
% ~# |* e, o3 a+ ]1 z read A_leave from "data.txt" with delimiter "\n") a8 ?7 E4 ]8 b3 @% d" D! a
read A_picks from "data.txt" with delimiter "\n"
! r$ t/ l* O' e: E+ { set load type to A_tote
5 g6 g0 i1 J- e if A_tote="tote 1" then set A_induct to 1
b; K: e/ ?7 x else if A_tote="tote 2" then set A_induct to 2
/ |# [* A% }' {% D0 g# h: O else set A_induct to 3
! c) R' j7 q2 i% F: ^; ~ set A_i to 0
; Z, A ^" L0 c/ j% f2 F a clone 1 load to P_induction
. Y: z3 w# M% ~0 \ wait for A_time sec
' `, h- d* P1 h' o. d# U" K3 V end
0 m- K* o8 d- b6 [. q3 ]end0 l8 C$ |. o9 T0 v5 o1 A
5 c4 u! W: p% l: A! O) Lbegin P_induction arriving
1 G# N0 {' E" t" u$ P( P if A_induct=1 then clone 1 load to P_pick1
8 A6 l: i; ]: B+ `" g else if A_induct=2 then clone 1 load to P_pick2
# ~- r9 v7 O6 ?0 h# F, d& e i else clone 1 load to P_pick3
5 N4 q& [" \3 _+ G' U+ S+ l3 fend7 o8 D6 b# q9 p2 b! {" y& p4 g
& G7 U' P! S5 v9 C' M9 q8 h
begin P_pick1 arriving
" g! a- u" t2 v6 J3 k- k; z set A_i to 1
) Y I% Q7 g5 U) K( \5 J3 d+ o move into Q_induct1
) D8 E7 ^. P2 I0 ~' H) O3 a: h' q move into pickaisle.induct1
& R6 K5 q5 p0 p* `5 b while A_i<=30 do begin
! C6 p& d6 B0 P+ Q6 L6 K1 e& B travel to pickaisle.con(A_i)
/ I, b" Y# L1 s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( C$ @) I: o: [7 y. R8 y else wait for 10 sec
: H% ?. C8 o7 {) C) v if A_i=A_leave then send to die
# _9 e- O! I @) ?5 E, q; d Q else inc A_i by 1, ~% w6 Z+ b' w
end/ A3 l, {# Y" z2 E
end
J6 Y2 }2 q1 E6 z& u! E: O4 j& v" W6 @0 h! d* y2 s* @
begin P_pick2 arriving1 r& | W% P0 \
set A_i to 11* ^, \3 E) E" R% G1 m
move into Q_induct2
/ e7 w# h' y }7 t. x+ Z' _3 a% V move into pickaisle.induct2
. r# t( S7 o! O& W& u( s6 l while A_i<=30 do begin
5 q* c, {5 W* Z6 }4 I: y travel to pickaisle.con(A_i)8 s0 O; h. s! M1 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( Z4 W+ Z0 S3 C( t- j+ C0 O
else wait for 10 sec9 A6 O2 c# r3 D1 x3 q
if A_i=A_leave then send to die& l- g |7 b) b5 h6 E6 W
else inc A_i by 1
* Q- d1 E' @ i# j" Q end
" m# y. [2 `- Pend. l& u% }) u. s7 `: c
* F( X5 D4 T, p5 F) q) F" ~begin P_pick3 arriving
* W+ S2 M, H5 D- r, M( g set A_i to 210 b% m& J% d. @' W+ h: }
move into Q_induct3
! ~. h j. u$ S. |% ^ move into pickaisle.induct30 w ^7 a8 k6 w& Z9 I
while A_i<=30 do begin* a% \8 I8 m+ w) `& e% T
travel to pickaisle.con(A_i)# Z# Z- f, Z6 c- |9 y9 w6 I# r* G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 ]8 y4 F' X7 o; I; x$ s else wait for 10 sec- I6 @2 z% Z9 i6 A: {* l
if A_i=A_leave then send to die) l0 T( y( ]' \0 g2 |, f" w
else inc A_i by 11 ^5 L8 K" [. }! i, m5 ~
end
3 q- z6 I7 D9 fend |
最佳答案
查看完整内容
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,其它按你的 ...
|