|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 ^5 n) {: u" U# i
* b {4 g" V |( \" I
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# |+ a% w. l. n5 A, v% n7 ?" X( b; n+ K2 \! L7 X9 z
begin P_read arriving
: @* y& w( T3 x) _& F; c( W& h while 1=1 do begin
7 \# T. j& n0 w5 A9 S: G' k- T, D l read A_tote from "data.txt" with delimiter "\n"$ x& d% a3 k, N/ G/ {$ J& L5 e2 L
read A_time from "data.txt" with delimiter "\n"2 C5 d/ X* a8 K' F( B
read A_leave from "data.txt" with delimiter "\n"
, L7 o% {" u: F& j8 U5 h- E- u read A_picks from "data.txt" with delimiter "\n"# u3 ?/ U7 S# e1 g7 M6 p3 c
set load type to A_tote
4 C% P! ~7 r3 p# i' Q if A_tote="tote 1" then set A_induct to 1
% O8 `; ~: \9 C5 S- X else if A_tote="tote 2" then set A_induct to 2; p7 X) G d1 \7 M
else set A_induct to 3 ) ^- s& O5 }* c* P* b5 G, S8 v8 X
set A_i to 0
' ^+ X; }+ g1 z3 ? clone 1 load to P_induction
5 Y+ o8 \, o y8 P* ?" c3 N wait for A_time sec; j: b4 @+ O2 R* H& k& q
end. A4 j0 t& P ~' E9 A F
end2 r7 p7 s. m1 R0 J
( ^2 G; y2 h9 ]3 ~
begin P_induction arriving2 Y. N! R6 c9 g' U: v
if A_induct=1 then clone 1 load to P_pick1
# y* ?+ P! J; m& w' }0 \ else if A_induct=2 then clone 1 load to P_pick2
2 j/ n2 t m. \. t! m% ?8 J. | else clone 1 load to P_pick36 \ L8 N4 _# g/ U2 E( S0 |0 j8 Z
end1 v& q1 T. C$ Y1 X
4 t9 i; M. L, _2 Q# V* Zbegin P_pick1 arriving
/ N* G( p' |$ Q! f$ U; j3 f set A_i to 11 o/ [3 j6 y6 L
move into Q_induct12 E0 Q' J h" V" Y
move into pickaisle.induct1& m/ [4 _5 y( ?. @% H8 u
while A_i<=30 do begin
5 }/ R2 `+ ~, [# l( Y) { travel to pickaisle.con(A_i)1 I' F& `' U: K9 ?, ]3 H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' I2 j5 c$ e/ j1 `4 j8 t8 e else wait for 10 sec- T: [" L! y/ N% l
if A_i=A_leave then send to die, w( ^ ?+ m( S7 f! n
else inc A_i by 1& U3 A) i2 s* Y/ G3 m, D& M
end
W+ T% M( h% rend& @& G2 V1 l; B% Z+ C+ a2 H7 y- n6 n
5 g% T7 d) c/ \! K, l, x0 n% r E( }begin P_pick2 arriving7 v- y, i2 ^) t1 k( i$ X" \3 R
set A_i to 11
6 c( C' H) [/ O1 h7 s! ?2 A move into Q_induct20 V$ |6 C) y2 x* z; y
move into pickaisle.induct2
! d2 R7 W9 M) s" n R$ i while A_i<=30 do begin
2 Z6 }; H3 B1 k! W6 e& q* K travel to pickaisle.con(A_i)
1 T7 {4 d+ S0 E$ K1 T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) ]; q4 o" k4 A
else wait for 10 sec
7 h& W' ^7 a/ r- P5 w2 a i1 O if A_i=A_leave then send to die
* B$ u* s/ w8 { else inc A_i by 1! G5 K* W+ d8 y3 T1 N3 P: ^* t. k
end
# S+ @* n. `* g4 B& A. Y: [8 rend5 }& e; ?: i n! v0 H
+ W: M( ^1 f; v5 b
begin P_pick3 arriving
# G/ K- E }( } set A_i to 21" @/ @" T6 L( {* \1 K4 N$ e1 T( G. {# ~
move into Q_induct33 C/ `- J8 e' G6 p( `
move into pickaisle.induct3
+ e' _/ s, c& s: h; [$ T0 |- O while A_i<=30 do begin9 e/ C1 [5 h$ v. r7 L0 w$ z
travel to pickaisle.con(A_i)
s( e! |9 j: t+ B4 p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S6 e% ~$ S$ E2 ]7 X8 O
else wait for 10 sec
& E7 V# W* `8 `6 P' Q7 t' {/ P if A_i=A_leave then send to die
[6 f: h5 D8 Y6 I" O! x% d3 V4 ` else inc A_i by 1
( F# Y# @1 W1 K end5 e& W/ v5 O4 k9 ?9 q& ?
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,其它按你的 ...
|