|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. j3 C1 q- q& F7 P& m6 ?/ S0 s$ q+ Y; W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 R3 _: Y6 d( g% e
! Y2 s9 H! p4 K$ L, Gbegin P_read arriving' ^/ k. d; v! o3 R) @
while 1=1 do begin! O3 i+ o# P/ x2 a6 f/ H
read A_tote from "data.txt" with delimiter "\n"
# V5 f1 K; c& r( p3 K read A_time from "data.txt" with delimiter "\n", c3 ~8 N# `$ ~3 F9 A
read A_leave from "data.txt" with delimiter "\n"
2 K- G6 ~* |: U$ L' S read A_picks from "data.txt" with delimiter "\n", S& Y3 W+ T/ A3 L
set load type to A_tote
* J- Z: ]% u$ [+ i( {3 A. t" D8 x1 ~ if A_tote="tote 1" then set A_induct to 1
7 l) ~$ g+ a* ?4 _ else if A_tote="tote 2" then set A_induct to 2
7 K2 c* x3 \# @3 c3 o4 p) |9 q$ ~ else set A_induct to 3
7 U1 Y* v# R/ Q! O8 a2 h6 t set A_i to 0
1 ?6 R% z1 S- ]' F clone 1 load to P_induction
* r n/ }( R7 }+ a, W. _ wait for A_time sec& J# L& d9 g, T
end
( O8 {5 E- ^ i$ h# l" c8 {end
8 q5 h! N, A5 W7 B
6 _: m( \, t& ]/ F$ zbegin P_induction arriving& S0 S. _* l; \5 ]4 R) b) S8 Z* r
if A_induct=1 then clone 1 load to P_pick1/ C. s& |: x: s6 O7 P8 u
else if A_induct=2 then clone 1 load to P_pick2
3 N- G: [, _. \$ G- A' K. S' ~ else clone 1 load to P_pick3
) @2 x; G6 S# i2 [4 I2 H; G" Wend
6 Y( G# l* R+ d2 c C+ Q
8 w5 Y( r( p6 p2 n1 Wbegin P_pick1 arriving
& O H* z4 k7 S. }6 P- e: L: C- N2 z set A_i to 1
+ h" o# c1 A2 p1 ^) _& e1 m move into Q_induct12 j3 a# f3 s! l! F
move into pickaisle.induct1
0 ]; }1 h+ A* C& ] while A_i<=30 do begin
. Q n( X) i& {8 B* f travel to pickaisle.con(A_i)5 t! n; g/ c& \4 s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 l, P6 k+ A0 u% w4 A) k else wait for 10 sec
4 t( M& \/ ]5 Q1 }( k9 { x if A_i=A_leave then send to die
" [/ @5 A( p7 b, S5 |& ^, p N# Q else inc A_i by 1
3 T% V8 j! W0 N1 Y end) h* m( J M! q, S7 W O; Y5 }
end
. |3 V+ B a: K' \2 |5 H( o) k6 ?- u
1 }, ~9 W* D% d6 xbegin P_pick2 arriving3 I% ?2 _' s% k* c8 s
set A_i to 118 \9 ^3 e! R: k+ j; s; P
move into Q_induct2' y# a4 ]# S4 h, w
move into pickaisle.induct2% d3 i5 \) m. b9 Z! B7 d P
while A_i<=30 do begin
6 S |9 b) r' ^ travel to pickaisle.con(A_i)
- [. B) t# X+ h5 H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% Q& V _0 L* X( m
else wait for 10 sec
$ W& v. u+ W2 j if A_i=A_leave then send to die
+ r2 a/ [( R6 `2 `1 ~, I else inc A_i by 1( N3 h) r d4 ]: S9 n+ r' |% K
end" P, e% `7 H8 Q$ ?
end( P5 L+ ~9 w; T( D+ d3 s5 g! p
9 a3 B# g+ `* W Xbegin P_pick3 arriving# [ Y* A* Q8 d
set A_i to 21( q. V3 x& |- W$ ~/ P3 P
move into Q_induct3) `( V; C) ], Z! R/ o& S
move into pickaisle.induct30 H% ]' n$ a* _# Y, o5 y
while A_i<=30 do begin
9 V) x, z( j/ u: l- ?6 E travel to pickaisle.con(A_i)3 s; H s/ p: R3 ?6 h+ a8 \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 M. ], X* U% B1 [ else wait for 10 sec
: H7 ~( B. b9 i, Y# x if A_i=A_leave then send to die" |' r* H7 g" r8 Q; \" y6 l
else inc A_i by 1
" m) h3 U% l! h+ W: F7 \' x' u9 ^ end
" N( h) \, k) r% r Jend |
最佳答案
查看完整内容
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,其它按你的 ...
|