|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) P1 H# k0 w: N# f4 }) d1 p) B l4 L9 A4 [) @) S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ v( N! S$ S' F
' t# D0 H8 x6 {/ d3 `$ z+ _! p
begin P_read arriving8 E$ ?% X: o, V Y! s! X I
while 1=1 do begin
; n! g) x4 D$ i+ C. r read A_tote from "data.txt" with delimiter "\n": w, {) t, h' \& s4 g5 l5 c0 M
read A_time from "data.txt" with delimiter "\n"
# g8 g4 |! n! _1 `# V: y% J read A_leave from "data.txt" with delimiter "\n"
; y5 P# l# B+ ]$ h read A_picks from "data.txt" with delimiter "\n"
- Q; N9 E. p7 W0 Q- `) { set load type to A_tote
# G7 Q2 H2 j, m/ K9 z if A_tote="tote 1" then set A_induct to 1
; I, V" A5 E" Y6 t+ `2 C; J h else if A_tote="tote 2" then set A_induct to 2$ a: a( `1 H! O$ ]% E' d$ C. _! b" k
else set A_induct to 3
1 p+ N0 S4 z) F, v8 v$ o# C$ ~ set A_i to 0) B0 F# z0 R5 e; X
clone 1 load to P_induction7 t7 b# r+ ^/ |1 E
wait for A_time sec
( @: N- C: P) s! ^8 P K( m end
. [5 K! M5 K, C1 @+ d! lend
+ S" t" J0 O( ~/ k# h6 P( {
: V! {) `+ V# v cbegin P_induction arriving
6 l6 B& s' f. ~2 @$ Q if A_induct=1 then clone 1 load to P_pick1
: S& M; Q7 ^) G/ }% L( _ else if A_induct=2 then clone 1 load to P_pick2
" \- H" Z) n9 k# O! r3 `7 N2 Z else clone 1 load to P_pick3
) t3 F) g' X @6 O" lend# _4 c' |; c& L3 J5 T: |
* s% L$ Q/ M( F a# h
begin P_pick1 arriving$ K' `9 i% W! d. J( q
set A_i to 1$ X2 v" }7 m5 r, b) \- `* S. O
move into Q_induct1
9 t$ t( f( `8 \- H$ y( W move into pickaisle.induct1# F. D4 e+ N; I5 P' u( j# U
while A_i<=30 do begin
9 F7 e- j7 V3 p% X travel to pickaisle.con(A_i)
3 T3 z3 h% X ?; ~5 o( Z o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 V2 G7 {4 d5 F$ F& g, Q( |) Z else wait for 10 sec+ P ^" ^; F' G; t3 T
if A_i=A_leave then send to die# i- z$ _2 I' Y7 Y/ g
else inc A_i by 1
- n1 A2 y) K5 r end% h# E$ ~! y0 i0 o
end
% Q3 S* a5 D. e$ G' ?) {6 ~& p
: i# N% V( W& {: lbegin P_pick2 arriving% I3 Q( [* j( C* j/ N" e" F
set A_i to 113 Y" W7 q I2 _) c4 r. o; \9 k
move into Q_induct2# T5 E$ e. C0 A
move into pickaisle.induct2* A! g3 M {; i: D4 n& z
while A_i<=30 do begin |( [# m' G8 E2 i8 {; Q
travel to pickaisle.con(A_i)
* `$ U$ Q0 w! c0 M* I$ d! y5 H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 N+ D# P- k/ G: t( {$ f else wait for 10 sec0 w G0 O: ]1 V
if A_i=A_leave then send to die) j) m: E3 h3 h' ?! n R/ ~
else inc A_i by 1
1 K+ g1 F+ @* H( n" h9 k end
) S/ @. V+ z0 I0 k6 v; {end
8 m, C! U4 R" c. n% P2 j: ?+ |' N$ U" j( W
E3 i* S) f8 V& F9 i& p3 V* Xbegin P_pick3 arriving/ L1 N$ u8 `. X' s
set A_i to 21
3 t) ?" X7 t' `9 m move into Q_induct30 P8 F0 k5 N& i( ~
move into pickaisle.induct3
9 S1 [& I. r: d/ g' e9 F8 h' R while A_i<=30 do begin
( G v* t5 ?( T9 { travel to pickaisle.con(A_i). A! h1 b$ h f/ G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- A6 u; G) T8 u) t' r5 R5 \
else wait for 10 sec
* q9 M0 S, m; i2 c; M5 Q1 `' Q if A_i=A_leave then send to die
% L6 G! ]+ [' g& q* l1 [. [ else inc A_i by 1/ Y- |* w; C/ e9 e' Q( U6 h% j
end
! u3 Q- G( _2 @0 Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|