|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 p' P* m0 `9 p& S
) j, A) e( C3 I5 g0 _/ r4 A6 a" L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( A/ O3 S. Y! {0 C
" A; Z7 D5 W) F! G0 d( o |
begin P_read arriving- u6 ~( T& j3 C1 ~% m& Q
while 1=1 do begin
( s+ j; [, C) M0 D4 U; ` read A_tote from "data.txt" with delimiter "\n" n+ P4 j. T: g7 B
read A_time from "data.txt" with delimiter "\n" G# g3 v G! l" C! g$ h
read A_leave from "data.txt" with delimiter "\n", u1 B& o( F; @! t' y, K
read A_picks from "data.txt" with delimiter "\n"
; T6 Z( ^: z9 ] set load type to A_tote4 }, D* e" Y- [; w1 E6 H7 a$ Y/ w; k4 w
if A_tote="tote 1" then set A_induct to 1
9 W/ c" y" T: r/ @: T' A$ l: O+ k else if A_tote="tote 2" then set A_induct to 2* Y$ x/ x0 j! y. Y' Y6 k( N1 r
else set A_induct to 3 ; C: A/ S2 g4 Z9 \/ R, u$ c+ Z, s
set A_i to 05 A, g, q& d% O
clone 1 load to P_induction6 U! b3 L* \9 C' b! r
wait for A_time sec
' m& c5 ?: e9 X* e& t" D4 j* m end7 f# L8 @* v+ j# R$ K: [
end
) e9 m- M! l3 X$ ]1 Z' R5 O
U9 J( O) J% _4 |begin P_induction arriving$ ^' S. i% j9 `6 k* ^3 Y0 U
if A_induct=1 then clone 1 load to P_pick1
6 ~# ]3 C o# Z else if A_induct=2 then clone 1 load to P_pick25 u; M8 Q* U- ^5 \3 T* _8 k" P
else clone 1 load to P_pick34 t( t& U1 m5 W" N- C6 R3 U
end
* G8 \4 @) C/ O) \$ ]) R! d
5 ]7 \5 g2 j* O3 Mbegin P_pick1 arriving& `, X$ E; X6 X2 X- @# |
set A_i to 1: T6 Q5 A* h5 z8 e9 O4 N
move into Q_induct14 R; x6 `! N/ A- W" P
move into pickaisle.induct1
0 Z- Y- |: ~, ^& T1 ]8 B while A_i<=30 do begin
- g& I: D/ Z# Z& ?* k/ D- R/ C: d travel to pickaisle.con(A_i)
) H; w. Q: z( i9 X4 E+ U1 I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 G3 [3 J8 I3 a, j# c2 r else wait for 10 sec
% x5 d* @/ N7 ] f2 q/ B$ G, s if A_i=A_leave then send to die
3 b$ Y5 S: s) Y2 N else inc A_i by 1. E) j( s) l9 I8 ?
end# B1 e0 Q: o2 v* ~1 i* k: P
end) x5 j* ?6 c. P6 g3 C+ E) G
* L) y, B4 D1 A7 J: }( Z
begin P_pick2 arriving+ I; f2 k" W3 g. N( j2 p( q# }
set A_i to 11
; d5 m, V+ p9 a1 E. Z9 T1 r move into Q_induct2
( ~# [5 O2 N- x: n. r move into pickaisle.induct2
$ V3 ^& I8 s7 r4 \ while A_i<=30 do begin
$ K, U/ h$ g! R! t5 F9 H travel to pickaisle.con(A_i)
0 L8 i. L# M2 x, o3 c7 Y, g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ I) d& y, I% K J; o0 Q" E else wait for 10 sec
" L# U9 P5 Q, e( h- Y7 R8 \/ d! E if A_i=A_leave then send to die
. V K% }) L4 m% T else inc A_i by 1: k+ r0 Z6 E$ Y( ?' m6 D2 |0 G3 S+ T
end$ [' k% M- r) B8 }- T
end
2 N4 q+ U3 d$ M5 v! h6 [6 D9 Y0 ?6 P
( Q3 z! v7 d, Z* ]. Xbegin P_pick3 arriving* R) X3 {8 f4 n# }2 b$ W/ t Z& t
set A_i to 21
9 z. j( G7 a$ B move into Q_induct3
$ Z. g* }) n9 S! ? |* P; \ move into pickaisle.induct31 ~' I Z" }2 K
while A_i<=30 do begin! d2 U. B9 c" F4 V' g
travel to pickaisle.con(A_i): n8 `. ]* A% d3 ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# |7 u& `/ ?( F
else wait for 10 sec5 w" G% t1 q3 R E' R0 m0 B" g
if A_i=A_leave then send to die
% G$ f* ]" a+ `+ L! O, A7 \- L else inc A_i by 1) e& K+ d) P# \2 x
end& W( G) X1 F8 t& Y: U
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,其它按你的 ...
|