|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 @0 y, u6 }6 Y9 l, @& }# \
1 H q, H$ X+ l! ?8 t8 M% j我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ h0 s# n: Y- q, a- `
: q" V' W0 ~4 d( pbegin P_read arriving
' Z6 q9 H; e M, ?+ k. F while 1=1 do begin6 ]; _4 j: U: x5 l5 S& U
read A_tote from "data.txt" with delimiter "\n"
$ q5 j; r& D" D6 m read A_time from "data.txt" with delimiter "\n"& e Y6 g4 u$ Y) G0 F
read A_leave from "data.txt" with delimiter "\n"5 \ o3 E$ N2 b, R5 S5 S
read A_picks from "data.txt" with delimiter "\n"
' q8 f# }- K; w0 i. N+ K- b set load type to A_tote2 Y3 m$ }& G- z+ j z9 P( c
if A_tote="tote 1" then set A_induct to 1
" A/ R1 X) S: z: u, Y! Q0 i" `. H else if A_tote="tote 2" then set A_induct to 2
3 ~6 }* B! ~" ~, G9 a9 I% T else set A_induct to 3
+ {3 e7 }: I2 V" Q: c7 s# w, B set A_i to 0
" W' O) w* F0 E, `6 g. O clone 1 load to P_induction# D+ W ?0 K9 e5 u7 Z9 d
wait for A_time sec
/ ~. `- Q; R+ T. o8 s1 p end% y! \9 O. l. l. k( R- @
end
2 {% \1 N6 ]9 _. P( _* m0 e
! ?( h4 h8 O5 Abegin P_induction arriving$ z$ C6 |0 ?, e* M3 y0 y
if A_induct=1 then clone 1 load to P_pick1
( {1 u. @8 l6 Y* c; b- P- s8 g else if A_induct=2 then clone 1 load to P_pick2
$ g7 c6 e& w2 j) @4 P" U else clone 1 load to P_pick3
& i+ E( e6 c7 Y7 i) e9 W& Y, pend) ~6 B W: b3 b4 F" b& {1 h; R( u
, ^* F9 P h0 p9 |! D- J" Tbegin P_pick1 arriving1 \* b% J! m" e* @# n
set A_i to 14 ? I2 S) ^2 Y, w* g9 y+ p8 q
move into Q_induct15 c8 j# T7 h2 I3 {5 c
move into pickaisle.induct1
; g& a" S: W. l' u( O while A_i<=30 do begin
$ p) M# K( ?7 K7 N ]5 f; u travel to pickaisle.con(A_i)
7 N. r d& i2 e. p, v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 B1 x, X4 z9 D e
else wait for 10 sec
6 p) Q" l1 ~. G if A_i=A_leave then send to die
& V$ n0 E) t% F9 L1 I* z0 ]' n else inc A_i by 1
E' ]0 f3 I8 }% e P7 [7 w7 e end
& |6 @; `* ~* c5 S' J% ]) pend
8 x! f4 C) B; h! x7 b* S! {5 a9 f6 V5 X/ T% {4 A' v. W) v
begin P_pick2 arriving Z1 P1 f5 L4 h
set A_i to 11# Z+ B4 E2 I: z
move into Q_induct2, [) t5 n8 \ j) q5 ?$ {
move into pickaisle.induct2
- ]% p* t5 j5 D O4 A' n/ I while A_i<=30 do begin
3 G3 x. x+ E) U0 |' i2 q' i travel to pickaisle.con(A_i)
: I; I/ g* C$ {2 S3 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, T8 _8 x! } I j9 I& g/ e; [/ B
else wait for 10 sec
& {( g# t: w1 q/ Z: H8 g9 F6 ` if A_i=A_leave then send to die4 G6 ]9 X4 R( K( o8 u$ d. U
else inc A_i by 18 W. t8 V& h! ]9 L+ R
end
3 j+ e/ p4 w5 ]0 qend3 A/ S: t- \* d
2 y8 ]0 a. R r, P( K7 A
begin P_pick3 arriving0 j8 \5 {0 V, R
set A_i to 21! q; E! A# e# ~+ a1 u9 x+ F+ E
move into Q_induct3* C% m8 I5 Z: N
move into pickaisle.induct3
# l2 ?* s! V. O$ j/ Z while A_i<=30 do begin+ q7 z! Z4 i1 K' k$ o& d: v
travel to pickaisle.con(A_i)
' z/ q! l: D, ?6 `# ^4 x. ~% e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 w% `: ?8 `; Y5 r/ g4 U' v# J
else wait for 10 sec
7 |( M0 \9 F' D2 n9 d if A_i=A_leave then send to die
7 G% u% J% _7 [2 H7 M else inc A_i by 1# ~, f) H( _/ x" M, M
end; b1 V( `3 S# R
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,其它按你的 ...
|