|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- \/ L( X; z& b: z+ X
2 W% U0 C0 w" K我的问题是,在每个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中的数值,不知道会不会有什么不妥。: B% @% D4 Q( R2 N8 `; B
& m5 w- A# j2 k. ~8 ?7 Q3 _0 rbegin P_read arriving
0 F$ L6 M3 ]0 j/ z while 1=1 do begin# S; e( ~4 j) s% l/ F% N% t) B
read A_tote from "data.txt" with delimiter "\n"
/ x- J; _0 B( i5 w2 J1 p* l read A_time from "data.txt" with delimiter "\n"
+ _' {4 n/ L/ C2 ^/ L4 O read A_leave from "data.txt" with delimiter "\n"
2 n. g- x) K0 m3 X, H& u' U: F read A_picks from "data.txt" with delimiter "\n"
/ K* g" J5 v O1 K; A& X8 y set load type to A_tote X& Y. Y8 A2 R5 ]
if A_tote="tote 1" then set A_induct to 1
. j% p9 j' M: B0 T9 Y else if A_tote="tote 2" then set A_induct to 2' `9 k% A$ Z3 z+ R$ }: E d" ]
else set A_induct to 3
, e! J/ J9 ^+ p set A_i to 07 S( l- G$ e, Z$ t+ y: b
clone 1 load to P_induction
9 ^5 S% u: q$ g q( w wait for A_time sec2 A2 H: L; R4 O1 m6 \7 [
end
5 h7 ^. t% x2 f' }& Pend5 T' \5 L" I, z
" i* ~: y; O. D; J; A
begin P_induction arriving
! h& w/ P7 z3 w1 ? if A_induct=1 then clone 1 load to P_pick1
! t. I1 K$ I1 P" { w/ V else if A_induct=2 then clone 1 load to P_pick2/ i0 H+ Q) ?5 f6 s: `; D( f
else clone 1 load to P_pick3
; v2 s# ]/ j, r9 O9 Nend# l1 G" G; c/ g+ C
& ]/ s5 X) U# w" K$ y1 b
begin P_pick1 arriving8 c3 z5 l3 r" q& M) F! z; L9 W O
set A_i to 1
4 f Y9 g1 l ^3 V move into Q_induct1! Q% x8 l, w" @% j
move into pickaisle.induct1, H$ u1 |9 W# ^4 c
while A_i<=30 do begin
8 `, J, }- n& p3 S3 B travel to pickaisle.con(A_i)+ {- [3 k( X0 F* O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, _: R9 S) f0 j# D9 V2 m; L
else wait for 10 sec
" F' z2 Y. ~# ~0 `8 U4 n if A_i=A_leave then send to die
% _7 w! w7 w% \ else inc A_i by 13 Q; d. ^3 x$ N1 G/ W5 z
end( g+ Y4 D2 d! M! I% ?( l
end" {: M5 O4 e0 l" v( \1 ]4 z
/ _$ P8 Y6 K9 I9 G2 q
begin P_pick2 arriving
1 J6 I6 }9 G' a& Z' g7 y set A_i to 116 i! s. R# u0 x! W
move into Q_induct2
8 g9 t- Z) F- f7 Y3 J% Q; r& b, v move into pickaisle.induct24 e. W0 r! e$ x3 H% D/ A" p
while A_i<=30 do begin
4 w& D2 r3 _( c! a; L travel to pickaisle.con(A_i)7 C$ ]1 h8 J6 _2 K( F9 p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 T( [% z* v4 ] else wait for 10 sec
4 q* n: `9 }5 ~8 V1 W8 O4 D if A_i=A_leave then send to die
( a7 @( `1 Q/ P v else inc A_i by 1: A0 K- ?* D" t: z# D; g. ?
end% h3 }5 `+ _5 X0 a
end
- Z% y. ]- A8 I: S
* C( G# V$ ^7 O3 Bbegin P_pick3 arriving; i r3 y9 f, R8 Y$ b, D* z6 b
set A_i to 213 ^; Q' x1 y$ M- g8 I6 Z& m- y+ @ w
move into Q_induct3
% ]! Y" L1 M: R# }* }8 p% @3 v move into pickaisle.induct38 H$ u5 E8 q& v. r1 V9 B" ~
while A_i<=30 do begin, y$ \' @1 E8 i: V
travel to pickaisle.con(A_i); \5 N+ h y* ~6 U- L1 o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 u% T( z- e& e. u: M else wait for 10 sec
* C% r5 f: J2 R; @0 j9 k if A_i=A_leave then send to die
* N; l( q+ @% p3 ]0 v7 ` else inc A_i by 1! p# r7 l! W6 z: e8 }
end* Q% M* R3 K4 s. R. @0 U
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,其它按你的 ...
|