|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 W- A8 W) T- n7 ?; J( d- P7 F/ `( c) D* K7 `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 x7 n1 J; @9 L
" q! w. I" F4 c% d
begin P_read arriving9 q: k3 i* P5 |5 _8 {
while 1=1 do begin
# N1 b7 L) A2 g$ n/ ^6 C. W8 [ read A_tote from "data.txt" with delimiter "\n"
$ P3 q S2 n5 o read A_time from "data.txt" with delimiter "\n"1 W# p9 U3 N8 [8 G( f+ K
read A_leave from "data.txt" with delimiter "\n"
' N8 ]+ R" q, Z: c. ]* C+ @ read A_picks from "data.txt" with delimiter "\n"
1 }8 b3 D5 Q/ I3 Y0 t set load type to A_tote
9 B& G& }- n q a+ h0 Z$ k: g if A_tote="tote 1" then set A_induct to 15 v: E3 Z0 \1 {( S4 s* I. b
else if A_tote="tote 2" then set A_induct to 2
9 j5 f. D% I8 F4 W/ V else set A_induct to 3
0 y/ Y0 Y0 n i; d V set A_i to 01 _& x9 q& [/ j* a5 C6 w
clone 1 load to P_induction
& Q# D- a S: ]% }) } wait for A_time sec
/ R4 j( P8 l( v& T: f4 Z& j end: u' f- O4 e; S' F4 L3 I
end
& E0 ?5 v3 d) k$ S, A7 E6 f6 C
8 U, l; U4 {* g5 W$ ~: h# F. ^begin P_induction arriving
5 k' w5 G8 Q* \# {" _ if A_induct=1 then clone 1 load to P_pick1$ T: O) s4 i) c: ?6 j' t
else if A_induct=2 then clone 1 load to P_pick2
: ? ]8 d2 N8 W; G0 r else clone 1 load to P_pick38 s( p6 q* R6 J+ Y. t( o6 H2 F N
end- m2 t( T, M( F1 w( K* p
% m' Y& M: D/ ^3 W0 _
begin P_pick1 arriving
. V( N8 v u) Z# A5 ? J set A_i to 1! g' I6 s Y* m5 D4 E
move into Q_induct10 ]4 c* K3 F6 w: k+ E2 B) N
move into pickaisle.induct1+ c, X" u2 t" G: \+ D
while A_i<=30 do begin9 O4 X& u0 J/ ~3 q, Z, H
travel to pickaisle.con(A_i)
6 {% @) R& s4 b5 S, O% d) c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 W0 h( _/ V9 y6 h8 \
else wait for 10 sec
/ [' {% J3 m+ D/ s R if A_i=A_leave then send to die
) a1 G. ?" c0 w( x. S% m else inc A_i by 1
1 Q! M: g+ N* h end/ D# K: [1 b0 k) D
end! m; v' j7 M w* n% f8 o/ y! \
/ N& c% Z+ f! W# V" Bbegin P_pick2 arriving
* z3 R' u$ d2 X- `/ B% d set A_i to 11% c0 h* ~3 J1 l( I/ g4 v' N4 E! @
move into Q_induct22 Y" T8 ?. i/ \) |! |# j+ W" W6 E
move into pickaisle.induct2
, O) k: z3 o6 K& U5 E9 V: N while A_i<=30 do begin
/ t8 w' t( j) n$ F& T# y; a- h& O travel to pickaisle.con(A_i): D/ n- Y6 W+ o8 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 W" l" j0 P- ]0 U
else wait for 10 sec
2 A# _0 r3 ?9 U: _+ c3 d+ D if A_i=A_leave then send to die
1 ?- C9 q; U" n$ A, j0 }6 C6 w else inc A_i by 1
* v( c* S. Q4 |, M5 ]3 S end4 ]/ z; L, F! `3 {: z. p- d' {
end4 j. S( O+ s/ B0 x& l
0 Z& v0 ~7 g& ^0 R3 m; D# p5 Ubegin P_pick3 arriving! T% X- x& j! r/ j6 ?" K+ Y
set A_i to 21
' H8 a$ Q% ?9 v move into Q_induct3- M) [. d1 q9 g" \2 D
move into pickaisle.induct3
7 V6 P/ d# o8 G" f; K2 o while A_i<=30 do begin
; B8 }& d F* [ travel to pickaisle.con(A_i)7 B. M* M/ |3 |$ L/ L- j& G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 a r1 y2 w1 e* | else wait for 10 sec3 e& a1 K/ g( }( b
if A_i=A_leave then send to die
% \: r- q" m5 R8 g/ i2 Z" k else inc A_i by 12 c. j/ c; x6 s" ~; @6 k% D4 _
end' `: @+ x: ]* _5 @
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,其它按你的 ...
|