|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 f9 _3 ^7 m6 }9 a, d! a$ s
7 p& H! v0 C; ~) D# {6 m- c( v
我的问题是,在每个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 I1 @# J( b9 w+ t9 ]
1 F# G1 j! m3 ^# \- p) |8 s8 Jbegin P_read arriving
e4 }! ?% O( f0 U while 1=1 do begin, m2 A* l' O; B/ l4 S# U
read A_tote from "data.txt" with delimiter "\n"
2 O% O& M0 G# _; O read A_time from "data.txt" with delimiter "\n"9 ]& G/ R8 \0 {' R! W
read A_leave from "data.txt" with delimiter "\n"
( G( O2 D% o7 ?' _4 M read A_picks from "data.txt" with delimiter "\n"
$ s1 |7 B, Z0 S0 K0 A, m6 h. L2 _: \ set load type to A_tote; E( {) d+ a. n& c1 v3 Y
if A_tote="tote 1" then set A_induct to 1
; u% P" p0 }- U. @) @7 p& r) { else if A_tote="tote 2" then set A_induct to 2' W5 T) Q) u( h; i& J h& K
else set A_induct to 3 ) W `4 E0 W' D3 }! w
set A_i to 0$ @# l0 j0 a# {4 F8 U
clone 1 load to P_induction
+ e- U1 ^$ q- `' r& \* v wait for A_time sec
( K4 C! K: f. v! W, @ end
: u, A8 e* b# {0 c/ Z8 y* Send+ A4 s$ Y% @ \8 a' e8 ^4 v: t
. n, i5 d, p9 x! }% Gbegin P_induction arriving
- o- |* u; q; t1 `: P if A_induct=1 then clone 1 load to P_pick1
% i; t8 u; o8 [' k7 E else if A_induct=2 then clone 1 load to P_pick2
% e9 g" ], X# s* d else clone 1 load to P_pick35 t) j- _0 h* x* E# U! D
end
$ \1 I3 Q5 L) {
# ~# q, t: A9 d! B# P( bbegin P_pick1 arriving. D, s5 c. g2 L3 q8 W
set A_i to 1+ `# A& Y6 G- D% Q Z
move into Q_induct1
% i: v) n0 B- U9 E6 G) Y move into pickaisle.induct1$ m- E9 [) n6 J/ T
while A_i<=30 do begin$ \7 q% d; k$ K! r
travel to pickaisle.con(A_i)
; D6 W2 Y4 x, b, o; E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# F0 g0 p1 E, k else wait for 10 sec
8 ~" w* {, h/ g, E: N! S6 T if A_i=A_leave then send to die( d6 P2 c+ q' E! q
else inc A_i by 1
9 H: Y7 x+ ~- H3 [ end/ X* [2 e N7 K- m* _+ r
end
# I! j! x3 b1 U- k4 y) j* M" w6 n4 p% g; V9 a& j8 W
begin P_pick2 arriving
9 ]; x: {9 E, Z9 q$ U set A_i to 11
5 v# }# U( U9 g# _; r+ c move into Q_induct2
2 |% f& o9 c) ]% d5 s move into pickaisle.induct2
P+ ^( k, K0 |1 t while A_i<=30 do begin
& @3 _( f+ [) w* Z! V1 @3 |2 W; v travel to pickaisle.con(A_i)
; ~& ]/ w: ^4 c& M' K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 G3 D9 @) c ~ else wait for 10 sec
8 d% r$ j' F5 W4 d, \ R) \ if A_i=A_leave then send to die# U |; m4 p& ~3 u# V8 F: E& Z
else inc A_i by 12 K, H( V' b* m4 c& `3 I
end
; Z* L0 S: Q8 F; u! |end' W K+ x) [! M$ x+ Q! O. I$ T/ f6 F. X. ^
, w4 T1 w$ n3 C3 {# K
begin P_pick3 arriving
! X! H/ W, m. \8 |, t set A_i to 21/ A9 N8 P. f5 ?9 Q! z
move into Q_induct3
" V# L( @4 ^" Q {; P move into pickaisle.induct3. n/ X! w4 q+ ~( ?3 ?
while A_i<=30 do begin* |6 v" u5 w0 }4 l' T
travel to pickaisle.con(A_i)
9 o7 b. x6 K* W i3 _. Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 M7 r# \: `8 m" f9 m5 x( R8 H else wait for 10 sec
1 k% i- K' S' i: W0 ~8 u/ z9 ` if A_i=A_leave then send to die7 k7 a# s, F2 R, c
else inc A_i by 1$ J8 p" J6 F& L; m5 |% K1 ^
end" u( P5 g7 }8 G; E" B% Z$ Y" S
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,其它按你的 ...
|