|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" f: G. D" u# y7 t+ J
, x. V& ]5 _1 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- T% c# W- M% d( \& E, C
0 Z" N6 Q9 F+ p) V5 @& y0 V" E( l0 `% Mbegin P_read arriving
N) ~; T9 q4 v- E. I( _3 O5 i while 1=1 do begin: o/ Y$ ?; v# U! X
read A_tote from "data.txt" with delimiter "\n"
1 i; T4 w4 J" K" M read A_time from "data.txt" with delimiter "\n": P' j7 I1 h h: G+ D1 N
read A_leave from "data.txt" with delimiter "\n"/ x/ j1 ~# h( P0 N4 q
read A_picks from "data.txt" with delimiter "\n"
5 {( A" h2 \# H7 c" Q- W set load type to A_tote0 r& \6 B% O) S8 u+ t+ r/ \
if A_tote="tote 1" then set A_induct to 1
) c3 w! Z) T: q( I8 n- ?* h0 Q" P ?2 k5 v else if A_tote="tote 2" then set A_induct to 2
" E0 P1 C+ ^: V+ o else set A_induct to 3
+ | ^' M+ D4 j: s2 a9 Y" [ set A_i to 0
. M& ^3 c3 F& a4 V clone 1 load to P_induction
' w/ i4 J- ?( h& l; F+ W, P wait for A_time sec- k7 |! U6 w5 Z+ i" F
end# A, Z3 h) r$ k/ [5 W
end
( [. G6 G8 o3 g. U [, Q" B- T0 x& B2 P0 E) a' P4 n, V' z
begin P_induction arriving
0 [* \, x* r" z1 D if A_induct=1 then clone 1 load to P_pick1
" ~/ I7 ]6 F, Z& ^$ g/ T else if A_induct=2 then clone 1 load to P_pick2
) M L5 O8 B& \' B. w else clone 1 load to P_pick3/ n7 q& @" y; ~ C- x( w* t3 U
end
$ {, [; r K1 s# F# }0 ]. w7 K8 J: l
begin P_pick1 arriving
5 k$ ^7 u" u0 y& m, _* s/ H set A_i to 1
* @: \% E% T/ `/ Z- q move into Q_induct1
2 k, p/ x% T0 C- S) A move into pickaisle.induct1
6 d) C8 X: K8 c( }0 B while A_i<=30 do begin+ b3 `8 N8 K1 r
travel to pickaisle.con(A_i)( n" `% g2 |8 d8 I. j8 _4 J; v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ i; f3 p' q7 }) O
else wait for 10 sec/ A1 V }1 ~# C: ?" W6 h
if A_i=A_leave then send to die3 `& q J/ q/ U- c( b2 g- M
else inc A_i by 18 Q: m3 t- h+ x
end
9 F' {' M! S. R3 `0 Iend
" \# B, x" `! O3 ?
1 C" |! o8 X5 @begin P_pick2 arriving
7 {3 O& H6 O& `' n- A set A_i to 11, j0 d# m( Y5 H4 n6 E
move into Q_induct2) I1 j9 w8 ~7 }6 F* V9 m: Q6 l8 m
move into pickaisle.induct2
' ? n. C/ p1 q0 b! ] while A_i<=30 do begin
, Y7 U8 y0 l+ e+ ~. s travel to pickaisle.con(A_i)
1 R6 B( s/ k* ?6 l- V- ]! V2 j. O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( M+ `1 i, r4 J
else wait for 10 sec
# ?" [ S. I6 t. \# k7 H if A_i=A_leave then send to die
2 R7 g4 n4 ]$ t z( m) _% O else inc A_i by 1( x9 Y; d7 Q3 y* E9 ~
end1 S' z) O5 S3 D2 g* y
end
" |% G# f; |& E9 B8 S9 f2 j
6 p9 K& Z, h" {: T9 o, ?begin P_pick3 arriving
9 t' `0 \7 a0 l$ W3 Y) L set A_i to 21
6 i7 r9 B8 [! U# E7 U2 B move into Q_induct37 g5 g9 l" Z1 U; @8 `
move into pickaisle.induct3
' U6 \( z' M3 F! B' \ while A_i<=30 do begin3 a2 g5 s4 \& a& w2 B$ p
travel to pickaisle.con(A_i)
^2 Y# q8 P& V8 M' F4 J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 s1 \: c% i4 Z: w; j9 K" \* }: u
else wait for 10 sec7 u7 x3 _* e7 Z j: R% V
if A_i=A_leave then send to die& n3 L% _6 n/ `- M1 L
else inc A_i by 1( L1 `: D# \% A7 T
end" @, a5 L2 r 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,其它按你的 ...
|