|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ s0 G& Y! ?8 X3 T
" a, `* E6 n# [: t/ A- I& ?
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; K7 J# m. W8 c$ P+ v" |' I4 y
$ c( b o* Z! V; s. Lbegin P_read arriving
- D) \$ }- c; K8 k while 1=1 do begin
& V6 I' I+ d0 j& b0 R read A_tote from "data.txt" with delimiter "\n"
! ^5 E, g9 |7 ~4 x0 k: J9 f9 P) X read A_time from "data.txt" with delimiter "\n"
4 B& k" y. ~% H read A_leave from "data.txt" with delimiter "\n"
/ R* a8 s6 x1 ~+ r- K" a: q read A_picks from "data.txt" with delimiter "\n": N# V5 D' \9 j6 a# Q3 d) [! n
set load type to A_tote" u& H) s* D) Y5 H7 y2 P* u
if A_tote="tote 1" then set A_induct to 1+ c* b, @/ B! I; x% z
else if A_tote="tote 2" then set A_induct to 26 N4 Q3 ~1 `0 P; A
else set A_induct to 3
( ^: F7 Z4 Q3 B. W% X5 P( ^ set A_i to 0
- p/ S$ b2 y0 c) U6 }: M clone 1 load to P_induction7 k# r* R+ s+ O9 j/ d" T1 U
wait for A_time sec
; |/ o/ ~# L6 C) P end
' x1 O6 c# k4 b# ~+ N( qend8 ^* d) [0 q/ {& h# e
0 u* z9 l8 H) E) Gbegin P_induction arriving
9 o. S' f' \6 e if A_induct=1 then clone 1 load to P_pick1" d u: Z* `% S5 j' T! C" t8 R) d
else if A_induct=2 then clone 1 load to P_pick2
. k. \8 ?2 D& s/ F: l0 b else clone 1 load to P_pick3! }6 O2 x1 z* c4 ?( c
end
% n! h% M( d# w: G5 ~
2 @2 O# p! S( N9 j0 u: qbegin P_pick1 arriving
( D' v' z# H3 P0 T' y set A_i to 1( M, S2 b# P# q
move into Q_induct1
# o9 m+ Q6 a0 ^$ Q! l! ^ c8 E$ ? move into pickaisle.induct1( s3 i5 ?9 [( k7 a- s& h
while A_i<=30 do begin
9 b4 ~: u9 {, S0 H: d* y* R travel to pickaisle.con(A_i)
6 e. B6 c3 s( Z j5 \) u: |; H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 u4 H4 h5 o+ t
else wait for 10 sec' |0 N' C! T+ O' A+ c- P
if A_i=A_leave then send to die3 W. E% R' N+ L. f3 W0 ~) s& T% [
else inc A_i by 1) H6 @4 q* k. U9 \; h( X
end
3 a \/ R0 E) I- t# g9 S& lend, e% [) R! \. i/ ~
6 G9 E9 `8 |) ]: z5 h; p
begin P_pick2 arriving* M* F/ k+ k; G
set A_i to 11" s" g; \7 F1 p: V8 g
move into Q_induct2
' v" S5 Q( F$ M( E1 _; j) _ move into pickaisle.induct2% U: z! X% w5 l* I
while A_i<=30 do begin ?( c A' R! Y' R! P) O$ M. B }
travel to pickaisle.con(A_i)0 f/ I- b) }) S* B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( n3 @4 L" x* G4 g7 W+ e
else wait for 10 sec
O) v+ i" R4 h" e/ C$ Y7 ^# [; P if A_i=A_leave then send to die
) t7 P5 B( J- h, T( { else inc A_i by 1
" c9 K/ o& E' |2 Y& \ end2 Q: y, R( b U8 @# R; d
end/ L1 |% T; A( W
, X) f: m$ U" O2 D& P: c
begin P_pick3 arriving8 Q; T. d9 A: }) n x
set A_i to 21& x$ {) k4 v, u! s" n" s3 q
move into Q_induct3& A) N' u% y1 V" y* v/ [
move into pickaisle.induct3- ~$ U- `6 Y1 ]- L3 }/ S* p7 \
while A_i<=30 do begin: U3 R- O5 t6 e' G$ ?1 S" H5 o
travel to pickaisle.con(A_i)+ j. a" Y1 v! ?) t+ c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) ]; h( g& u, a% O else wait for 10 sec
5 K0 O5 Z9 Z! [( O! C3 { if A_i=A_leave then send to die
: ^& [! V, W5 P0 G' H" E) R, @ else inc A_i by 1% Z) M: i! s" p; `2 W/ i7 k- d
end
/ {2 x' c* M( V. l6 xend |
最佳答案
查看完整内容
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,其它按你的 ...
|