|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ q3 ?# m. q6 r$ T# ?) r8 G! e7 e
0 q: F T1 t9 j, Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ o( K4 ?& F/ l8 u. M
/ }3 b' X2 n' [( G6 W% Q+ `- A
begin P_read arriving
- [7 F+ f J' h4 y while 1=1 do begin6 I, U, l3 s. R/ x
read A_tote from "data.txt" with delimiter "\n"
2 Q# [8 o) n9 s! j. I: Y. N read A_time from "data.txt" with delimiter "\n"1 J; W/ A0 I, u. L
read A_leave from "data.txt" with delimiter "\n"3 k. z8 K+ E( J) i# l; n
read A_picks from "data.txt" with delimiter "\n"3 M/ f* Z# g$ v' [" B, V$ j
set load type to A_tote% t* Z; Z. K$ m% o, O* V
if A_tote="tote 1" then set A_induct to 1
- Z T7 k" [1 x# [( F$ ? else if A_tote="tote 2" then set A_induct to 2
) I, `& k- t( [9 D6 D3 o% `( Y! h6 e else set A_induct to 3
& e$ j* L: `/ b0 G+ } set A_i to 04 ]6 u+ o( M }$ Y. h8 F
clone 1 load to P_induction
, z3 F1 ^9 e3 z+ M4 |% z wait for A_time sec
+ D% ?% ~/ _/ z! x end8 b- m3 e! u6 i
end
* u$ W8 w0 i. }* W
* i0 K! V- G W; Nbegin P_induction arriving/ y1 Q9 y: D: [8 J
if A_induct=1 then clone 1 load to P_pick1
. [2 M: s* O, j/ m# w else if A_induct=2 then clone 1 load to P_pick2
9 M5 `7 g0 ?! c5 U" g else clone 1 load to P_pick3
! Z: Z5 K. [3 ^0 O6 i |end2 N! p) ?; y6 d) d/ Y- e2 B
; X0 {3 V* w1 h$ b# _begin P_pick1 arriving
7 g( i7 g+ a. z$ b3 v. L4 I1 } set A_i to 1
7 f. N7 \8 A8 H& j1 z move into Q_induct1
, F3 ?0 d0 u: e8 H* H move into pickaisle.induct1
0 Y2 a" _, W6 T9 R* b2 O& U while A_i<=30 do begin$ q+ j) l2 |- ?$ {, p
travel to pickaisle.con(A_i)
" _/ n( @$ A3 Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 p/ @" i9 k+ |) l" N/ d6 M+ g
else wait for 10 sec
1 f% Y. ]( G+ F if A_i=A_leave then send to die
/ u3 L, D' l1 x! ]; F else inc A_i by 1( z( R. M/ d( Q& K7 n* L
end4 h. W: I$ k0 J1 s: v' D
end/ e* z/ m( S/ S1 _
( L( c$ A: x2 k
begin P_pick2 arriving
- e4 r7 ^+ }2 E, j1 i: I( b set A_i to 11
2 v. H' S* D- `& L$ B' { move into Q_induct2
8 p, Z% J# U/ y move into pickaisle.induct24 t0 d' K) J( D' v- `$ u
while A_i<=30 do begin
. u q% g' ?+ [0 Z' {# G travel to pickaisle.con(A_i)) m6 y# t8 ^, i* E) v: R, w- \" J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* K7 y0 S! y! \5 ?9 c else wait for 10 sec$ ?1 u0 j: t1 s4 s) l/ C5 n
if A_i=A_leave then send to die! k2 _ x! S+ ?8 q5 {" r
else inc A_i by 1! q6 g8 g2 C1 C; S7 K3 C; V* V
end' z& P# y. ?# M/ E7 R5 F
end& Y1 S" q5 {) C- G5 K5 p2 L
+ j7 T. p8 _ L
begin P_pick3 arriving+ ]8 L5 [, m# c
set A_i to 21! S. \1 e4 j1 Q* f, s+ n$ V. N
move into Q_induct33 v* T" I* w4 }7 L" G7 A
move into pickaisle.induct3
+ d, l; m# ^6 [& c; j8 g while A_i<=30 do begin; [) I$ n: K/ c/ Q; \) q
travel to pickaisle.con(A_i)/ k }- I4 P2 t) P/ r' Y+ [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 J- i2 P# J/ P+ z1 }
else wait for 10 sec, F5 l% |$ w) x7 l l5 S# v2 ?$ c
if A_i=A_leave then send to die# C- @; N" a/ P
else inc A_i by 15 u& G# q* j2 R
end( O/ A1 B' v* a( e
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,其它按你的 ...
|