|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 ]' G1 S2 d, Y+ s3 \; ^/ e2 W) F4 P7 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中的数值,不知道会不会有什么不妥。
2 U n6 h8 X- A% c7 ~6 j- [0 W g M( K' g# ]0 ~ A/ j" a
begin P_read arriving
/ f# N/ w; |5 D- N while 1=1 do begin
) C9 U( @6 l' ]1 J read A_tote from "data.txt" with delimiter "\n"; ~ x+ M5 l- t
read A_time from "data.txt" with delimiter "\n"
1 ?0 u3 E5 \; Y/ ?/ b read A_leave from "data.txt" with delimiter "\n"
- L1 y8 _1 r2 }. x read A_picks from "data.txt" with delimiter "\n": s) f1 [# _+ u: z; J
set load type to A_tote
$ g" j, F2 F- Z i" L- R if A_tote="tote 1" then set A_induct to 1
& ]0 W- F6 P( \9 K- L) a3 s, `2 O3 z else if A_tote="tote 2" then set A_induct to 2
8 u" n/ b; B3 q: K5 n$ x else set A_induct to 3
- F9 o3 j$ n- @$ @5 h- U' ^ set A_i to 0
+ u+ z$ c# e# G( d clone 1 load to P_induction" Q: n2 B/ ?4 a: j) E. d3 o
wait for A_time sec
" E% S! p8 X! c* { \& J end
# ?; q* J* k9 rend
2 |! m X# C/ ^3 S
; R' n5 R2 l. `. ~8 S8 ^4 D! cbegin P_induction arriving; c" t: [. ~- W# k" ? p2 p! C& [; P
if A_induct=1 then clone 1 load to P_pick13 v! t% v) v8 _
else if A_induct=2 then clone 1 load to P_pick20 z0 ]( G9 J7 ?
else clone 1 load to P_pick3
0 a5 o/ r% B3 X0 g; Mend% z& x3 r0 E2 [2 g# _
: M' P0 {& j% U3 }
begin P_pick1 arriving" y/ b5 u5 d$ B9 [5 e4 A6 W
set A_i to 1
5 Y6 E( \5 E9 x( i" e; r' a move into Q_induct1
$ F$ X* `1 F3 _1 T$ y! W# K$ n$ q move into pickaisle.induct1# U; T8 I2 I( ~4 \8 ?# }8 H
while A_i<=30 do begin
$ A2 t- b5 e7 K/ s$ x/ m travel to pickaisle.con(A_i)
4 J0 b9 @4 u! R& S5 Y% ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ f8 Q7 |) }" r ^- u. |2 n' `
else wait for 10 sec
) `5 u) ?/ n) q7 Q8 `; h; _ if A_i=A_leave then send to die! j5 o3 v0 V' M! V) ^6 |& n6 J
else inc A_i by 1
, E# S, G! g+ n ?. r end
+ H: ~2 e, K$ K! L" fend9 |* C( ]7 a' \5 s ~- G: e+ G
! G8 ^7 }- d5 v9 b) u1 ~" k
begin P_pick2 arriving
% e2 G. U2 [$ {, _ set A_i to 11
; }+ t: D* e' L/ [, _5 O# R move into Q_induct2
2 \5 ?2 \0 p+ |+ W/ H. o move into pickaisle.induct2
2 G! O G5 y) R& f/ G& q while A_i<=30 do begin
% m4 @9 C4 ^. Q9 X2 A1 Z/ @ travel to pickaisle.con(A_i)
C1 L8 B' g, I6 M: Y$ F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 ?7 E8 D1 K' ?8 ^8 h8 \4 r: D else wait for 10 sec$ ?; L2 \) `+ X( b2 b" U
if A_i=A_leave then send to die8 f/ h" q. P+ z/ q A
else inc A_i by 1( A+ U, {7 G4 x5 v5 ]# o# s
end D' h) o* n$ m8 D- J! Z" Y
end
& z: L7 a3 @7 U* r4 T$ I
) b; T' B) G' Jbegin P_pick3 arriving
/ L6 h2 `- a2 G set A_i to 21
. \ q3 b& h+ F; b/ D7 Z, P9 _& ]' t% e move into Q_induct3
; Y. c I1 g3 ^$ G move into pickaisle.induct3
& A) P: L/ k8 ~6 z6 `9 @ while A_i<=30 do begin
]% C# `: A/ B' Q travel to pickaisle.con(A_i)
4 n3 q& x" h2 k) i& M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* }# Q* R5 W5 K' D+ B else wait for 10 sec
6 H8 j! D" ^0 Z( m+ i8 c2 _ if A_i=A_leave then send to die
) C) W6 [5 s9 m3 g7 M else inc A_i by 1
$ r/ q8 L& h5 Q Q0 A) e end
: q$ y; A M$ H, Y2 {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,其它按你的 ...
|