|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& W" f6 b w9 z/ N" M
6 h1 T: M2 W4 x4 Y) b# U: u我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ N7 E' z, Z( T
! n& w( Z3 U/ @
begin P_read arriving) l, y0 V7 m q7 `6 a9 D6 o3 I$ I5 f
while 1=1 do begin: c5 r7 x! F' z# O: H$ D
read A_tote from "data.txt" with delimiter "\n"
( `- I' a* Y4 `7 R- O read A_time from "data.txt" with delimiter "\n"- @; N# ~9 H8 H: Z2 V6 a
read A_leave from "data.txt" with delimiter "\n"( Q2 z- M, G* P
read A_picks from "data.txt" with delimiter "\n"3 e# G% i7 c2 ~. f, L4 S: U- s) p
set load type to A_tote
1 R9 \% w$ W) Z# ?; }6 Z if A_tote="tote 1" then set A_induct to 1 w- Y. ^1 A6 u6 W& G; y+ ?% @
else if A_tote="tote 2" then set A_induct to 2( k! e: a% l+ T' k
else set A_induct to 3 ; I* J, m ^7 Y+ W0 D& z R5 e
set A_i to 09 l$ ?( s1 k2 H+ N9 _
clone 1 load to P_induction
8 \" ~; Z- z/ q' p( J' c1 h! S wait for A_time sec7 y, J) w; G" V( c5 J: b
end
+ |6 y% |' W* R4 O# I% Mend
7 _2 q/ |( h( [2 w) l/ E
/ w* i0 R3 G; a) ^. ^begin P_induction arriving: g% R% R- i9 d0 X9 d
if A_induct=1 then clone 1 load to P_pick1- m4 J" @& l. n8 O& j
else if A_induct=2 then clone 1 load to P_pick2+ |$ L- N8 |/ u5 k1 D9 |& h
else clone 1 load to P_pick35 L% i# F) J5 N: {
end
& B( e; e2 l: I: A4 M
. d( Y: Q0 e3 _9 g- _begin P_pick1 arriving9 L' d, S8 O# K) T4 H* C
set A_i to 1& f4 U! {0 t# v. Q2 u5 W
move into Q_induct1, z/ H* M. T/ [/ k
move into pickaisle.induct1
9 L1 R5 f, R c% u: Y: s while A_i<=30 do begin
( B, O2 x" I! p4 W' W9 J1 n travel to pickaisle.con(A_i)
3 o+ d' y3 J: Z% N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! d/ x" s. z, f0 N else wait for 10 sec1 h0 h3 f: n$ V8 V( D. Z2 r
if A_i=A_leave then send to die
8 k* O O* ?8 Q @* E% U4 ~9 E) O else inc A_i by 1
% A; e9 {: J: N8 }! X6 k" S end1 |: s1 X6 V8 ~/ ]
end
3 A9 e% L" f& a
: a1 {( ^/ A, Ubegin P_pick2 arriving
* f' M6 a' x+ p/ ^9 k set A_i to 11, I" @& a/ E. I
move into Q_induct2: G( D% a. L/ d: ^; m: \
move into pickaisle.induct2
r4 C# c. D& L6 s* d% H5 L while A_i<=30 do begin
+ A+ W1 B' ~# \8 x; O+ g2 ^ travel to pickaisle.con(A_i)
E- X# r8 S: r" x+ S6 L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) u% n# [+ _% y Z4 S6 s else wait for 10 sec+ j- @# j2 {. ^, w5 `$ W# N" i# s) k, S
if A_i=A_leave then send to die
' `; p( M3 }- A else inc A_i by 1
" g. A! G2 B! G/ I end$ W6 A7 r: Z: N% d" [
end
* F2 Z( i! t0 ^6 K; J) A
5 c. P$ V) i; z% ?! J0 ybegin P_pick3 arriving
- @. I6 B' B R: z, a( Y: k set A_i to 21 k6 p8 \2 F" u! M( c& M
move into Q_induct3
3 Q) h* M+ F- @ move into pickaisle.induct3
- x! G: T( J0 ]4 x8 h+ R while A_i<=30 do begin9 c/ s' [, ~% J/ |/ f3 W! i( n
travel to pickaisle.con(A_i)
; i+ Q# z% }4 e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ?( N6 Q2 X& r! ` else wait for 10 sec0 |+ t! Q0 y$ x; }- r
if A_i=A_leave then send to die1 z) R0 h! [/ P& r4 G7 u. H+ J
else inc A_i by 1& S& R' g9 z7 y( B/ t0 e* a6 a
end. P8 R3 W8 g0 T0 r9 {9 ~$ E `
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,其它按你的 ...
|