|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& e- i" F/ Y" V# R! ~
( B4 U E" ?- ~, Z$ V4 h/ 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中的数值,不知道会不会有什么不妥。
/ Y8 C; r0 C$ A- k5 t/ g7 @
" e `" R; H1 k* Qbegin P_read arriving: M u o) p# S: V6 I' n7 |: Q `
while 1=1 do begin! ^: ]. m* M* U- ^' s' z" j" H
read A_tote from "data.txt" with delimiter "\n"( X. `8 m* }8 T0 {
read A_time from "data.txt" with delimiter "\n"8 z) @& |& s; j A( E9 v2 q* I! a1 c4 U
read A_leave from "data.txt" with delimiter "\n"4 K+ ]1 c# a6 T0 n( x# B5 D
read A_picks from "data.txt" with delimiter "\n"- c4 d1 @7 k0 D! F
set load type to A_tote
8 N; f9 G5 ^. v/ T. g if A_tote="tote 1" then set A_induct to 18 a9 T) d; ?2 W9 c7 P. C, z
else if A_tote="tote 2" then set A_induct to 2' O$ ~6 j. s$ Q' \+ ?6 @
else set A_induct to 3 " a7 V: h/ J- A0 e; D/ f; l
set A_i to 0
' I% X) E8 L5 L* _; j clone 1 load to P_induction' B; j0 I8 i- F: f) n
wait for A_time sec& Z6 t, K% A/ c# G& j
end
/ \, p0 z, Y& |- Q% ]end( b. m1 m% n0 U1 u5 h2 t6 h) h) ]
$ i/ q3 o" U- p) F& Y) I/ Obegin P_induction arriving1 C6 Y3 o" }- ^* Q! K7 D( B
if A_induct=1 then clone 1 load to P_pick1
. M6 p: h% X6 c0 ]: W* v* z else if A_induct=2 then clone 1 load to P_pick2' V# ?' U+ D B1 D! d6 U- B
else clone 1 load to P_pick3
/ L& k$ h( p5 fend
L$ n: v2 h A" R
8 x6 Z) Z2 s& ~5 c/ u$ lbegin P_pick1 arriving7 R; D, V! f: m, u0 ~. O
set A_i to 1& p4 ?. N* g5 I. z
move into Q_induct13 z p, Q6 E( t/ ]
move into pickaisle.induct1
, [4 r0 Z0 @- {' c: v( Z while A_i<=30 do begin8 t5 m0 Q) m! V
travel to pickaisle.con(A_i)
2 m" }8 a( P! J( ]* [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- \6 M0 l" @8 N7 J; I else wait for 10 sec
* C& Q. I- a4 D: ` d if A_i=A_leave then send to die3 V* l" x2 F& {0 x- g
else inc A_i by 1
. @3 `, O% h# {2 X end( l( f- }6 K6 d2 N9 _
end
4 U$ _" Z* N: [7 t* _: l# o/ B" R+ V- M
begin P_pick2 arriving
# y# o' y" a; T7 g1 y set A_i to 11$ R6 I5 M- U3 {' O7 y
move into Q_induct2
( {: u7 _5 y) K5 r move into pickaisle.induct2* w* k6 m1 ~/ w; w
while A_i<=30 do begin
7 d6 ^8 ~: N" b" c+ B4 ?7 g travel to pickaisle.con(A_i)
" u9 x! B# ]: K, r& s6 H! y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 f4 a! l) l& W1 L2 W
else wait for 10 sec/ {6 j: s: c6 }5 C/ @" x6 C
if A_i=A_leave then send to die
5 I% D: o8 n }! m" e, y else inc A_i by 1
1 x, Q" I4 L. m$ m end
/ r) v" n& |+ |9 h8 P- y0 Yend+ I N$ U9 p( w g
8 `1 e: }" ^5 f. l2 C. Ubegin P_pick3 arriving
9 M! I0 v* R0 T6 y( Z set A_i to 21
' i z q" V N' l move into Q_induct3/ ^. z- J* p. q( c
move into pickaisle.induct3" E3 m! j* F: I8 i- I
while A_i<=30 do begin
8 Q' U- o( ]7 F0 u; e travel to pickaisle.con(A_i)7 [) \9 H8 W9 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" o0 ^" Y2 A) \, B- P
else wait for 10 sec
& ~2 ]; M6 w7 s0 Y0 d- I; m& ? if A_i=A_leave then send to die
5 P- H, c3 x' i else inc A_i by 15 r$ S! n1 v4 H# }, K1 ^$ f
end& q% R) _$ r) q4 H$ l% z+ e
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,其它按你的 ...
|