|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ k$ O% n* G Z. @5 {
5 A, b+ X5 w: G/ b. x6 ~! w. ~我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 L: N3 h4 j3 R
+ N5 j6 }- x# m# [) N5 c0 xbegin P_read arriving/ M6 [6 i) r a7 X% H% w
while 1=1 do begin
5 d' U0 z* M" b) H2 d6 d read A_tote from "data.txt" with delimiter "\n"
2 x* P* o* G% G read A_time from "data.txt" with delimiter "\n") S2 Z+ o7 L. S; t% n$ i
read A_leave from "data.txt" with delimiter "\n"
! E8 j- D6 ?( I0 D read A_picks from "data.txt" with delimiter "\n"9 a' Q% Y G* t0 r
set load type to A_tote0 H8 t' X- @1 L4 d, }2 Z$ L& t' d1 o
if A_tote="tote 1" then set A_induct to 1( f6 N+ k. {; O ]- x6 C3 f
else if A_tote="tote 2" then set A_induct to 2+ s4 G9 @7 L% F) D$ z
else set A_induct to 3
n" y5 d% y7 q7 u+ K set A_i to 0
4 i4 y. @! x' [( z, p clone 1 load to P_induction
' V" a; u( m$ z3 G$ t9 T wait for A_time sec. v/ Z* R- p, F" y( i1 P
end2 P& h0 N1 l9 U/ T
end, g. a) D/ T6 ^* b
. f$ p% E+ Q+ }( q% Obegin P_induction arriving5 o8 z O" W/ y. M2 d' h
if A_induct=1 then clone 1 load to P_pick1
% \$ `5 q6 |/ E, ~+ f else if A_induct=2 then clone 1 load to P_pick26 }3 @" K4 n, g/ C5 I2 @ \5 g
else clone 1 load to P_pick3
1 e& x6 w2 X$ W3 ^. x* X; E3 @5 M' ]end* X7 v/ z# U, H! O
* f9 T3 `, b! q) U* `0 \" i: H( }8 Bbegin P_pick1 arriving
+ g. h0 A* |/ m4 R6 m set A_i to 1) B* ]8 q ^0 N* a; ]
move into Q_induct1
1 c* ^+ n. r \ D' d; A. i move into pickaisle.induct1
, u6 `8 U3 O. ^, \ while A_i<=30 do begin
# }9 A2 B0 ?3 F- U! h1 T! U, L- B travel to pickaisle.con(A_i)* ]; ?0 b4 j4 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& r/ z' q; I7 J5 `; ]
else wait for 10 sec
( q4 n+ d! J% }2 t if A_i=A_leave then send to die9 [! ~; ?) q9 d2 n+ a
else inc A_i by 13 N) u* L& N& F6 V- } e, T7 F
end) N X0 R5 b- [% S& E/ i
end4 q) F W' k3 i0 l3 G4 N, z
% a+ c- ~0 t1 S9 Gbegin P_pick2 arriving
* l2 |5 Z$ l: a set A_i to 11
: `: c' M" K9 G/ C+ V" ?1 _* E move into Q_induct26 Y* J% A5 A8 Q, I
move into pickaisle.induct2* @9 ?6 G: B2 e2 y
while A_i<=30 do begin- f3 j6 T( G. z+ M& O
travel to pickaisle.con(A_i)
9 b! [. i0 Y* D4 c7 k3 x0 r9 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 j# F* \0 m+ l4 \1 C7 n& S, |8 o# ~
else wait for 10 sec- I% T2 ?! @7 a& q6 Q$ `3 ^* }
if A_i=A_leave then send to die
' Z) m0 I O$ _ else inc A_i by 16 Z7 O" U: w: _' M- m( ~
end. C5 R* a( N! {0 ?! q- B# y7 v
end% m( b% k. }" q* D/ f
+ P' ]& Q3 L$ l8 y5 B+ n# m
begin P_pick3 arriving
; V8 V9 q3 K2 D+ M ]; L: s set A_i to 21! p! L" w( `: n% _# v
move into Q_induct3! a. V/ E2 u- \& ` Z& K# B
move into pickaisle.induct37 E& _2 K& K8 O9 G4 x6 O
while A_i<=30 do begin4 G. t6 q. ]$ s( N7 ?: i/ P
travel to pickaisle.con(A_i)
9 J' M2 B$ ~5 u2 z/ I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" g* q- f5 Q, n$ D else wait for 10 sec3 x0 u3 C: Y4 g/ N" s' s; S% C
if A_i=A_leave then send to die" ~ D) a3 j6 C7 i- e
else inc A_i by 1
# z. w6 L- o2 h& Q# a u3 N end
, ]; z; G, U( Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|