|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, {% E$ X/ B4 Z9 g& q$ i7 Z# S/ C) U0 z5 Z* j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. g9 G: v/ n. j. Y& t0 J, t- C4 G8 t
; ^4 p" d9 G: J" |2 x% {- ] zbegin P_read arriving
% A: I7 d# H! f, V while 1=1 do begin
0 S7 P$ X7 s: Z! ^ read A_tote from "data.txt" with delimiter "\n"
3 L: x" M, X* W$ r$ i read A_time from "data.txt" with delimiter "\n"0 c% r5 I3 V, G+ u+ F2 e
read A_leave from "data.txt" with delimiter "\n"
2 p0 g3 T) A. a4 O, X. L. K9 E read A_picks from "data.txt" with delimiter "\n"# P0 m5 v q+ i$ _
set load type to A_tote
# e7 S7 e- O2 o$ E! i' W- H2 W6 u if A_tote="tote 1" then set A_induct to 1
" J$ d- e( t$ z else if A_tote="tote 2" then set A_induct to 2
3 E) _/ l' h9 ?' Y* k else set A_induct to 3
* @5 w% Q. P6 P5 b9 e) h set A_i to 0
! e; x- I6 l/ u+ ? clone 1 load to P_induction" H1 G+ r* D. y
wait for A_time sec% Y0 r; Z( Z r: a% |/ r
end' M; \9 o# S; M# X4 {7 x9 ~$ z
end
: Z5 i1 |' [/ ]# B" b
; d1 S( @1 {5 X% [* [3 qbegin P_induction arriving
% a/ V1 n5 s3 L$ { if A_induct=1 then clone 1 load to P_pick1
: X) `; J% T$ C1 `( W9 G4 R& z else if A_induct=2 then clone 1 load to P_pick2
9 b. U' F; S- C5 ` V else clone 1 load to P_pick3
# C4 z0 y+ T2 ^- V$ q" Yend( z: B, d- T0 A/ k0 b* j
2 [3 L: x, |& u7 R( j) Z: lbegin P_pick1 arriving0 Z v1 l5 ~2 o) U* d% {- t5 s
set A_i to 1% l1 {# a0 o* e( d
move into Q_induct10 S/ N# f4 {# M( z3 N4 p0 p
move into pickaisle.induct1
, B$ g6 W* b7 u' N6 w4 F2 L) u while A_i<=30 do begin
1 s: K3 M7 D/ t6 E0 E travel to pickaisle.con(A_i)( E+ `8 Q8 |4 W5 g1 \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 @' [ l7 H* b else wait for 10 sec
% q6 Q, H R7 Y3 I# ~ if A_i=A_leave then send to die
2 O/ ?; x$ c: Q/ g$ l& D9 I else inc A_i by 1# }4 x: j+ y2 h6 ?5 G
end8 ^( c# Y' ^. ^" q. O
end
( {8 N, W) I3 @1 x) G
" @. \& `: ]& s. Q8 H1 y* A) R$ Ybegin P_pick2 arriving
7 k4 c$ S8 e4 d set A_i to 116 J5 X S/ r) l0 z
move into Q_induct2
5 ?( Y: r' X# U/ G/ \& K+ ?9 Q3 X8 G8 R move into pickaisle.induct2
+ {$ G& ^ y/ B/ ~2 _5 W) M while A_i<=30 do begin2 ^7 ?5 n. v4 o
travel to pickaisle.con(A_i)) D! a' t @# z3 v, {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 A, A8 N) q' y
else wait for 10 sec
0 @* L E, T: j. ~ m5 l0 E if A_i=A_leave then send to die
7 J: A# [8 d3 U: b8 Z else inc A_i by 1
6 Z5 d$ F2 i3 A I6 E! q end( ?! K+ Q( i/ @% r/ S4 M2 j- a* A
end9 S8 B* f/ M' G0 K3 E
5 e1 B: w P7 lbegin P_pick3 arriving W- e* ^5 N9 S
set A_i to 21
. z' K# r. z0 p0 X4 y, ]2 X move into Q_induct36 z% d7 ]" e* e$ W% ]/ k3 s
move into pickaisle.induct3
- T, L \! s5 S) O while A_i<=30 do begin
5 F1 e2 C2 _5 e# D( V X travel to pickaisle.con(A_i)- `3 G- d2 e7 P2 R, w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! U, j3 G# ^ Z0 h) q# Y6 ~ else wait for 10 sec" V2 p1 M+ Y1 {* c6 N
if A_i=A_leave then send to die5 H' a+ }7 _! c( j6 Y, I: z" @
else inc A_i by 1
: |! O8 l' N' h5 ^. s end
% a5 }) }! C& I* Zend |
最佳答案
查看完整内容
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,其它按你的 ...
|