|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# f( R) b# ?, ~ ~$ D% s2 w1 H; A1 [9 ~0 Y8 e* G9 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 E- e; Q4 u3 k& D1 o* K
/ F* d1 _3 I" X M! I$ I( i" i
begin P_read arriving
2 O p! H: I# Z5 ~, f while 1=1 do begin/ E, n9 u' ?" ?3 \, G/ u* ]
read A_tote from "data.txt" with delimiter "\n"
M3 {" ~- o5 t a" A3 f read A_time from "data.txt" with delimiter "\n". c+ i& @0 }. v
read A_leave from "data.txt" with delimiter "\n"
, {6 H. j9 ~3 f9 }+ L3 ]. g read A_picks from "data.txt" with delimiter "\n"( c! n! }6 y6 n
set load type to A_tote
8 ^) v+ C" `, {% Z if A_tote="tote 1" then set A_induct to 1/ A/ s2 J8 h( v) {1 O
else if A_tote="tote 2" then set A_induct to 2
# N. z4 `$ Y& W' M" a [4 ?9 f else set A_induct to 3 % P j' C% u6 j/ O; Y9 p, ]
set A_i to 0
( c7 R. r. f- I clone 1 load to P_induction
6 t' V4 Z- c6 X6 O wait for A_time sec
O! ^5 v5 |& k& _/ L4 d end+ _" q( X! K& J3 k( M) O) L
end+ b- l. H( a! }2 c
3 O; d$ G/ P2 T6 O7 Y! L9 x0 r
begin P_induction arriving; I7 p: O, I* Z/ A& g+ a9 b
if A_induct=1 then clone 1 load to P_pick1& d: M" d/ ]7 J
else if A_induct=2 then clone 1 load to P_pick2
* T6 V) c+ T7 n+ o else clone 1 load to P_pick3
. c, O P( V3 Z9 U$ e, Wend
* Q+ G; e& W8 @
/ `# F# Z. c# N( W% b, ~begin P_pick1 arriving
( A7 B U& @2 g5 j7 ~1 b set A_i to 1
- v' L; Y# G! K! {) B4 Y' a! o; D# H move into Q_induct1, M2 j- Q) k( b# c! P1 w. [9 z5 E4 {
move into pickaisle.induct1! Q" N! {# n2 N% c9 d5 w- O* U; T
while A_i<=30 do begin
* N9 ]+ C/ ]/ J9 u9 a3 C7 ]9 b4 V travel to pickaisle.con(A_i)
' z& T0 m. ^1 l* t9 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& b# l8 d: x+ Y! r
else wait for 10 sec* X: H, h; }* C' R8 t
if A_i=A_leave then send to die/ D* {4 V! S+ K" W- K2 I5 o! @9 Q6 X
else inc A_i by 1
- G% q' H3 T3 D/ l- m end
! Z0 ^. `6 H7 dend
% \! y" B" R* r# K( C
4 G- |" H( Z) R! R2 T! g9 gbegin P_pick2 arriving
$ o4 `* l; S7 O7 a% I set A_i to 11/ c! Q' p. a! U4 z* o! r" I
move into Q_induct2
3 A$ |5 t" R6 Q: Y4 H$ v move into pickaisle.induct2
]( @- D/ S1 ~ while A_i<=30 do begin
5 V6 L& |0 c; x: D% d travel to pickaisle.con(A_i)
/ P, `; B, U! I5 n) ]3 \/ o, B: @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 F- e3 t# ]8 g1 Z( j& j
else wait for 10 sec0 ^3 @2 T2 {" M
if A_i=A_leave then send to die& H: w9 R, C* _
else inc A_i by 1: E3 ]+ R' T, O& g+ i" l8 b8 `
end
$ [# A) ?: b( c4 G2 P* dend0 F2 K7 r$ W; \# C
2 m9 y& U% [& C) xbegin P_pick3 arriving
4 q- T! v% k$ i9 V& h z7 H5 b. X set A_i to 21
! m7 g; Z, V+ K \- f6 [7 G+ y move into Q_induct3* A, u& o% o: B0 i: ?2 v
move into pickaisle.induct39 H! k& p b- Y* d/ x+ b! z/ S9 e7 G
while A_i<=30 do begin0 R2 b d9 Q4 I; [, i- @0 `% B
travel to pickaisle.con(A_i)
' R; Q& i0 n/ D) S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' x$ d2 ?$ [" C
else wait for 10 sec: E7 T2 `1 J6 f- o- b6 d, g8 n
if A_i=A_leave then send to die
- C1 ^* [) f$ d% I3 g' y else inc A_i by 1
% g4 s. T4 `5 n& @ end# E' f4 G3 [* B8 Y% U- X& l
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,其它按你的 ...
|