|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# ?/ e3 { d2 v' M5 p; e* f4 c
5 C- T3 k5 w+ H" c. a, O5 B我的问题是,在每个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 g: F+ l$ F6 Q j2 l& }
' R: {# {% b8 {3 @- S7 {* Xbegin P_read arriving/ C4 N; V0 k" y) l6 L. H4 X# f
while 1=1 do begin
$ C) `) S# S, q5 z read A_tote from "data.txt" with delimiter "\n"
4 Z$ I' M- X, W8 W, e/ T$ K3 R read A_time from "data.txt" with delimiter "\n"
/ r- V' C( x- G" L a1 e read A_leave from "data.txt" with delimiter "\n"/ W4 d6 g# k5 @
read A_picks from "data.txt" with delimiter "\n"4 i. i2 l4 v ]8 Z6 a1 \& m( n
set load type to A_tote
2 s1 G: T. h! F% } if A_tote="tote 1" then set A_induct to 1; A g* Y$ I9 z, g4 v: P3 `
else if A_tote="tote 2" then set A_induct to 29 @ U7 t7 y' T) H5 y
else set A_induct to 3 2 u9 N7 R$ G+ ^2 c. Q
set A_i to 0
/ X2 e1 c- c. \5 Y' C clone 1 load to P_induction1 w, K$ X% K1 r' _, }
wait for A_time sec; f; `8 h" Q$ s7 e! Z, Q
end
. g" v& G# y/ a! S/ }end
( ?( t% G8 F% j8 ?% Q
. _+ C2 t( x/ G0 M' c+ abegin P_induction arriving
9 V+ r* t+ l& j/ q { if A_induct=1 then clone 1 load to P_pick1! \5 a; `: e9 f
else if A_induct=2 then clone 1 load to P_pick2/ [$ {$ d3 j) C4 n W' r
else clone 1 load to P_pick3
. H0 o- Q. R8 q. ~& cend! H% t# p2 ?, e
; l2 F3 m4 n* |, E( b4 W4 hbegin P_pick1 arriving# k5 Y2 f$ A7 z9 U. A
set A_i to 1
$ M' o9 i; g$ I; b/ U move into Q_induct1
( S+ C& }: u; ]/ E, G move into pickaisle.induct12 s, }. g0 g3 n" M- i" a' ?
while A_i<=30 do begin( d- D5 Q( B4 {7 i
travel to pickaisle.con(A_i)
7 U1 }6 I* Q$ Y3 n" B9 ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ @0 t3 a! ~5 ]# ^# A3 ]9 z
else wait for 10 sec
, N5 K, O3 @# x/ C `- R if A_i=A_leave then send to die/ ]7 A7 @% i/ d) S- W) c* a
else inc A_i by 14 A% f8 R* M1 @6 Q
end# Q# c, `% ?+ E2 [: M
end
: ^0 U+ Y3 e, ~! |- L( x8 }
1 j% b9 ]6 W$ t c( W7 dbegin P_pick2 arriving
4 n" p# l; V2 ~* F4 s: h set A_i to 11
$ B f: q0 I- ^5 t1 M& R move into Q_induct2
: r; M$ P: O- c" l u move into pickaisle.induct2* v6 v$ P5 s$ c7 A# |- z) {
while A_i<=30 do begin
$ ]0 O/ D+ }% k5 J travel to pickaisle.con(A_i)
4 ]% d4 Q* h- S# I+ Y4 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! f2 @- T+ V; g6 v1 k else wait for 10 sec. W% J8 k, J# X* m1 s; U
if A_i=A_leave then send to die |) B1 c8 M) ^# S% I2 y5 J" X
else inc A_i by 12 a3 Y! `" B9 e4 u% i% C
end; E" [ C! W+ ?. [ v; G3 V
end
$ \. n/ d: Q) `5 _" [ M; U; I
# F' @0 }$ ?6 B! v) j2 J- `begin P_pick3 arriving! b, W5 q: H6 K3 V# [3 i
set A_i to 21( w. X0 s' A" w% q( ~$ M% _
move into Q_induct3
+ ?1 l% c! V7 u5 Y$ j. k" P move into pickaisle.induct3
( {5 D L# c9 w" K0 I; Q while A_i<=30 do begin
; |5 y$ G; N' T+ R( c! X1 q$ w6 u travel to pickaisle.con(A_i)' K/ V( i- }/ N4 K' T8 Z V; |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# r$ c$ B+ H, }" p3 M* W, L: L
else wait for 10 sec
& c9 a1 f1 E S- Z if A_i=A_leave then send to die
; `0 Z3 |6 Y- a. o& K8 q else inc A_i by 1# }5 b R+ D0 t! f2 A) i$ i
end" Z, Z( D" d5 G. ]4 |
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,其它按你的 ...
|