|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# P2 r3 D! G+ Y# T
0 R5 Z& N. i1 Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 q3 ?, p, c' N! _$ l
b' R: Z9 z- Tbegin P_read arriving$ z) o2 s8 w- L& k& L
while 1=1 do begin
" B+ j& l1 U' @' {0 G read A_tote from "data.txt" with delimiter "\n"
! u- l1 `, z! P$ K( J e; F: T read A_time from "data.txt" with delimiter "\n"
# ]) U5 h Z2 ~# y2 M3 t1 O read A_leave from "data.txt" with delimiter "\n"
, L2 E2 L# E/ L+ Y1 J* F2 c8 g read A_picks from "data.txt" with delimiter "\n"$ s' W! A( `9 E
set load type to A_tote
* Q7 \- P' O$ b' _0 ^' n if A_tote="tote 1" then set A_induct to 1
[; x4 V+ F) j& h- G6 L0 A: O% Q else if A_tote="tote 2" then set A_induct to 2
$ w" Y* E( t7 V: R* y2 ]7 T3 c; X else set A_induct to 3 2 [# z$ y: L$ Z/ y! C( |8 W
set A_i to 0
6 F2 e/ d$ E! R/ Y$ b z4 N clone 1 load to P_induction2 |6 {$ Z5 V; S
wait for A_time sec2 K% C: t* O+ P/ b- a/ e: `( y7 @
end6 C5 ^1 p% c% k( d# i/ M, x
end, J7 [6 e1 ?9 L3 N0 V" \# e/ F
" n# Z b' v: _/ T
begin P_induction arriving
9 U$ l! j8 `' [& u! O if A_induct=1 then clone 1 load to P_pick1
& m8 B" W% @8 W* ~7 }& S0 E$ S- H else if A_induct=2 then clone 1 load to P_pick2
* ^* X& i2 n8 ~( ]8 ^2 d* S else clone 1 load to P_pick3# |" V( u/ G% O4 h' T3 _' S
end h3 ^2 I3 B2 O5 X2 o. [
: G! _; F: h2 x( _- p0 a( Nbegin P_pick1 arriving& t" W- A8 u0 K7 G& C9 ^, r+ p
set A_i to 1
' ~% g5 v" x6 O0 [ move into Q_induct1
! z1 D' A$ C( \ move into pickaisle.induct10 R! S% W) Y8 B1 B: j. C3 ^
while A_i<=30 do begin e5 Y" l: [7 `7 ~* ?- [5 w/ I# F
travel to pickaisle.con(A_i)
4 I: r3 h- i1 i& y0 `) {5 Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 \( R+ g: y# ~8 a9 q/ f else wait for 10 sec
5 Q0 X( F3 W2 J$ \: W$ L3 E if A_i=A_leave then send to die
7 c+ [4 o) y- H, r; x* e else inc A_i by 1, C! E2 _# }. Q4 j
end( t# {$ S# }0 `! b. S8 H
end
; f/ B3 x% Q* @6 f6 k1 w( z, Y6 a
3 ^% P! R5 Z, N* N: f5 Kbegin P_pick2 arriving$ w7 }0 b0 d, [! o, E2 q* v6 O
set A_i to 11 R. |/ e* C# n3 {$ N" ?( E
move into Q_induct2
* O9 @, b4 u# e$ L move into pickaisle.induct2
- t6 Z& w' u" t: a. g while A_i<=30 do begin
1 `% X5 U. e; R. w+ F travel to pickaisle.con(A_i)
+ e' F s. @# o) d8 {' h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( _' n7 S, V% D- D5 P; P4 J- C+ }
else wait for 10 sec
# f. y/ [$ t8 D+ A# c if A_i=A_leave then send to die! r y; L3 h; X6 [* L3 u
else inc A_i by 16 ?; ]% {" P! y- F" V
end
* k. t6 d: d7 s% q, c' `( `end$ [; u- k) b& C5 N
: q4 \4 y( F8 V. Y+ Bbegin P_pick3 arriving
/ @! z( X f# u' B set A_i to 21
3 [. n2 H. C+ O, E* x move into Q_induct3
' ]. L1 [. F5 d- G }4 L- b move into pickaisle.induct3+ t, ]: U# h- Z. e7 Y, \+ t0 K
while A_i<=30 do begin* F7 n* S0 w; Y& [0 t3 Q& F: Q
travel to pickaisle.con(A_i)7 U; U% f) H9 s& c5 Y. U5 u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; \% T7 w% |0 U0 H- A# D
else wait for 10 sec
1 R0 z( Z+ G* L) G9 R if A_i=A_leave then send to die- a8 ~: M+ U5 g) C
else inc A_i by 1" K7 G0 m/ h+ f% Z
end( P2 O H! d1 {* i$ x
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,其它按你的 ...
|