|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ e# R5 u8 O$ W, {" ~6 \" t# w
- D* i. P5 o5 F! P i# L# r ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! e8 u+ l& \& s# s5 T- K' q; t! p
8 n& P7 g! h$ } F6 b; @/ ?+ gbegin P_read arriving! {% ?- G5 o, B8 U8 l% X: D! K
while 1=1 do begin. P: w) }/ e% i& |/ n
read A_tote from "data.txt" with delimiter "\n"
% Q, d' S2 f) [' F7 | read A_time from "data.txt" with delimiter "\n"
/ u" P% u) G' Z" [ read A_leave from "data.txt" with delimiter "\n", n; Z/ U s A( p7 F
read A_picks from "data.txt" with delimiter "\n"
4 G/ c$ d' H/ N1 y4 `7 i8 x5 P set load type to A_tote
. g2 B, {) d' w& C- x: W& P if A_tote="tote 1" then set A_induct to 1+ G3 A; X2 m3 h8 g
else if A_tote="tote 2" then set A_induct to 2
j4 h' N0 M2 T$ \& d6 Y! w else set A_induct to 3
0 d7 C4 i5 d3 F5 I- F' u6 m3 ? set A_i to 0
* Z* \2 r2 w. \1 g4 G clone 1 load to P_induction
' K- m6 B- P" F$ @! K wait for A_time sec2 e* s/ ~8 i0 o2 z
end
6 W- X7 b/ A) |7 Pend$ r6 |" D) l* P* A6 j6 e
' `. v# J: w, x! Sbegin P_induction arriving
$ W" F1 d. n1 _# \9 z7 ]: o* N if A_induct=1 then clone 1 load to P_pick14 A# ^# d7 W! S& y( n5 I5 s; f
else if A_induct=2 then clone 1 load to P_pick26 n/ f1 ], K$ Z+ S" [) }
else clone 1 load to P_pick3
! {* g9 C B+ T7 B# c- ^; cend) G/ E9 c3 T/ l- A" H
. k# X. q/ ]/ R9 N
begin P_pick1 arriving- O8 u6 d. y$ i
set A_i to 1
1 N5 Q1 k' D" O3 W4 F move into Q_induct1
n1 Z0 C z% w move into pickaisle.induct1
+ z2 w3 |! c0 k0 p2 N7 h9 w9 ^3 p while A_i<=30 do begin
( m8 u5 ~3 }# V+ T travel to pickaisle.con(A_i)
8 \# F. Q: V5 E5 y' Z5 |& v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ]8 q$ d; z' o0 D4 B else wait for 10 sec
: z4 F" @8 [6 ?; F if A_i=A_leave then send to die
Q3 e2 _* N W f' [- L) t7 K else inc A_i by 1
4 N; a, T; P& o+ w0 T6 m; y" J: G: M end
0 T( U& a3 k/ t( ?end
# \5 }3 x) [2 a, K# @' w
, _, j7 Q& h( Z6 `begin P_pick2 arriving
2 Y6 G9 V( K8 S: w0 ] set A_i to 11; Q5 h" D9 C1 R! p1 I0 D8 [
move into Q_induct2
1 b5 P. _5 v4 p/ K move into pickaisle.induct2
, M# o0 U. W+ I, I" R5 e while A_i<=30 do begin
/ d, Y3 L5 ^' i travel to pickaisle.con(A_i)* a: A; F' c% H: F" N) C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% p0 c- x+ ]8 [3 f else wait for 10 sec
4 O8 w" x, l0 u/ T% C3 C if A_i=A_leave then send to die; u# N, F5 w/ c! o! F/ ?9 v7 g
else inc A_i by 1' f0 Z- e1 y$ _1 }0 J7 t
end/ t2 J# v6 D( [6 f$ N5 v* F$ _
end
3 X% O1 H& _4 a
4 v9 i& ]- [% {4 R& q5 xbegin P_pick3 arriving
( _1 B1 R! R: o' _ set A_i to 21
/ f. G! c; z9 l9 g move into Q_induct3( R/ T! o, O' r( W1 z
move into pickaisle.induct3' z2 R: c7 R. C7 g& }! H2 a' j
while A_i<=30 do begin0 |9 ^! {6 T" A; Z
travel to pickaisle.con(A_i). e# d p! Y- ]% X0 |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: s* J' Y3 }" n k# L, _
else wait for 10 sec' ?- j: I) O5 M1 ~
if A_i=A_leave then send to die
# w! a1 E! Z7 v b; X% ^( c& f else inc A_i by 12 M# y9 T7 ~/ {: l
end
0 o/ s! g: m% k |3 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,其它按你的 ...
|