|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 S9 q3 N* W: F
. a! P1 \) \- O我的问题是,在每个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中的数值,不知道会不会有什么不妥。; u. {- m+ F+ r$ D% }. ~/ h
7 i5 C$ y+ |! C6 Y: _$ F) J1 Y1 fbegin P_read arriving
M" D0 C. C4 J/ U while 1=1 do begin/ d5 d' ?4 h c5 _8 }
read A_tote from "data.txt" with delimiter "\n"
9 }, d9 b/ p/ ]4 c& h' m read A_time from "data.txt" with delimiter "\n"
/ z. M; Z% z% t read A_leave from "data.txt" with delimiter "\n"
! t- F' z+ `' s( { read A_picks from "data.txt" with delimiter "\n"/ U. m5 V" j5 I9 e2 [
set load type to A_tote
' w7 K3 ?5 }6 [2 x4 b if A_tote="tote 1" then set A_induct to 1- e4 G5 {3 e' g, h8 i6 x) y5 D
else if A_tote="tote 2" then set A_induct to 2
' w0 ~; B& c* z9 A else set A_induct to 3 - k( ~, @2 m* H% x( m
set A_i to 0
. d3 K3 ]/ A( f) t9 e! f ? clone 1 load to P_induction5 \6 J" t5 t4 \% S0 U
wait for A_time sec# x8 R& \; a5 l2 L( d# m! Q- j
end
( ?5 Y4 d; {/ X$ ?% I" C- ^7 j Fend
6 C% G' L8 N* B! E2 f! F& Y2 `! E/ n
begin P_induction arriving/ H+ B: ~4 m" l4 @1 l. H
if A_induct=1 then clone 1 load to P_pick14 d( h& t+ Z0 U1 m
else if A_induct=2 then clone 1 load to P_pick22 W( i- w/ r0 E- W* g% l8 d% i
else clone 1 load to P_pick3& g A5 `/ R2 C6 `/ i. i# J
end( F" |5 W' d5 S2 Y; w
$ g2 a+ R. Q1 Qbegin P_pick1 arriving
6 e0 H/ {6 C" C: I set A_i to 1% x+ S$ z _6 A2 G
move into Q_induct1
% L# l( @' P+ E move into pickaisle.induct1
5 g' \' |, A |9 Z$ v while A_i<=30 do begin
& R3 [; x/ o# { O6 j travel to pickaisle.con(A_i)
% a/ s( _$ i+ Q' Y2 G. x$ F/ O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 y+ f n" Q. c1 N8 ~( N else wait for 10 sec
, ^. P3 Z! F9 b6 E% z if A_i=A_leave then send to die
/ R3 H8 a! k7 v+ H5 e& p else inc A_i by 19 B9 Y) } K5 v
end
1 F V" s5 P! y- t2 Eend
* O8 f5 J" O7 Y8 w( R& |: z/ ~* I7 Z7 i
begin P_pick2 arriving
* l5 ?9 n- E. p m: \- C/ h set A_i to 11
5 D5 F0 V$ a3 d. b move into Q_induct2" U `. U* x' l e$ G9 K
move into pickaisle.induct2, m. A" U% @2 |4 f$ `7 x' R
while A_i<=30 do begin
' g2 `& v6 |! _* a) _ travel to pickaisle.con(A_i)0 t- |* f6 ?: X1 h7 h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% u9 \& {/ N2 i9 @% w else wait for 10 sec4 r, J/ D) S6 L' r
if A_i=A_leave then send to die" w8 X0 j4 u/ {- R6 w
else inc A_i by 1
( W* l3 v* r8 O6 @8 z end7 |1 Q+ \' Y% f% K
end/ R1 t- @; [' \5 S- Y* ]) c
1 x% g6 `0 U4 C1 o/ I8 vbegin P_pick3 arriving% Q5 S! u7 @0 ]: u9 `/ H
set A_i to 21( s- |* q3 I' h3 p# N6 P& d
move into Q_induct3- Q; N; d; B5 ?- ?' X( r$ w
move into pickaisle.induct35 Y9 X0 D, I' T$ s# k
while A_i<=30 do begin
, I9 O. p# z- p9 F# M$ g1 s travel to pickaisle.con(A_i)/ d" L, b0 G7 A- ]) o# o" L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 q* b6 N$ T, \
else wait for 10 sec
% _% K0 I9 d5 `- r D1 M) V if A_i=A_leave then send to die$ ] S+ j6 a% z/ H+ V7 s; I! n% d
else inc A_i by 1, i& o! W# q c; H8 J1 w9 ], R. p P
end0 c5 N) A" v# `3 K7 m
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,其它按你的 ...
|