|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ ]! \5 i8 Q0 d1 f
& E' {4 m# v# G* [- @' 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中的数值,不知道会不会有什么不妥。
8 Q3 G& i6 ]0 J( N. Y" o* n- y5 E; k, b* ]5 r6 D* E
begin P_read arriving
2 x; U& N2 ~5 K( j while 1=1 do begin6 J+ }) k6 J) l3 u; _) ~
read A_tote from "data.txt" with delimiter "\n"
* h1 C& C3 X0 {+ }" {) z read A_time from "data.txt" with delimiter "\n"0 {6 Q/ Z) e* u8 M+ W
read A_leave from "data.txt" with delimiter "\n"
+ C2 e: h; [+ ~! j read A_picks from "data.txt" with delimiter "\n"
. r" _' |1 d0 A1 f1 n set load type to A_tote
* r/ h" c$ B! w5 H) w if A_tote="tote 1" then set A_induct to 1# A# s- |% S0 t' p/ L+ n2 e
else if A_tote="tote 2" then set A_induct to 2
7 m" a& \" G& j0 E! U1 ~! Z else set A_induct to 3
, K( l8 P. v% o set A_i to 0
- Q: o! ]5 A! `, v6 j9 B1 Q clone 1 load to P_induction
7 R; x$ P3 h K* ?1 }9 | wait for A_time sec% x* _4 S- h- G, E( }) i- S
end# c4 p& ~4 D# o7 @* a
end+ o( j6 a) F2 L- U9 W/ S
- S1 {" R! K; c" Pbegin P_induction arriving
6 K* d: L: K- ?0 r. @ if A_induct=1 then clone 1 load to P_pick11 z8 d3 }: t p9 Z9 v; j
else if A_induct=2 then clone 1 load to P_pick29 r7 P. R1 O2 v! C' u! T
else clone 1 load to P_pick3
$ j; C! Q8 m" W$ T% ]/ z! H% pend: C, D$ c2 |7 a' U. h5 N( K
, O: r9 x& ]$ }7 `0 E% t; u
begin P_pick1 arriving! h4 L c; h* L% m4 R8 R( m
set A_i to 1
. u' J1 M4 v6 ]! C0 r' e& Y. k move into Q_induct17 V4 X% O" P. F/ e
move into pickaisle.induct1
" T6 ^3 i3 s& r2 ^* }) w4 i while A_i<=30 do begin" V/ K, O8 x" g! H5 e" g/ s3 v
travel to pickaisle.con(A_i)4 ^ [- f" r( V% P- K! o0 b5 U# t8 q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 }: n" _0 Y/ }( | V2 f( x else wait for 10 sec7 X) T+ G3 a5 s5 a% x
if A_i=A_leave then send to die
$ W; k M1 F3 K else inc A_i by 1( T. D/ S' O' s
end
2 F! g8 g) j: s: }end4 g$ T5 G- {7 [9 A+ h7 q' b% j
7 M, k2 u8 Q2 ^
begin P_pick2 arriving( v2 |2 N2 C% q/ i, j$ w) n. H8 k
set A_i to 11
" k; Z* I3 m9 q& y" r+ D move into Q_induct2
* [7 f/ O- c8 s4 i w move into pickaisle.induct2
2 L: ]& Q- _1 D: j3 R4 U. S: f while A_i<=30 do begin% X+ i3 K# T9 \! s+ x
travel to pickaisle.con(A_i)
) W1 h0 Q; B5 B" i5 y) p4 G; l9 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]" R$ J# `' C% s5 F7 X q else wait for 10 sec; ?* f/ L. B3 N5 N5 G; r6 Y
if A_i=A_leave then send to die
3 y' u4 ]- i' ^& A( M0 K else inc A_i by 19 \+ v4 [. S x3 B( n
end
+ K% f" q. f7 H! N4 L" g' N9 Wend* d3 h+ r) n# ?$ H- p
. j/ U9 T' D8 K+ [6 n& J& [9 H0 v1 wbegin P_pick3 arriving$ y' S/ N: J5 S, s; Z2 ~
set A_i to 21
: @5 z2 I" A" ] move into Q_induct3
8 P# b9 Q& U. C5 ^. c: x move into pickaisle.induct3
1 L' }7 O1 X6 k0 } R- F: g while A_i<=30 do begin
6 y7 U$ \. _5 o) Q$ S! J travel to pickaisle.con(A_i). j# C% E h9 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: z7 ]- y" R0 a" N. F
else wait for 10 sec
! Q3 K" ~# _# t if A_i=A_leave then send to die b x9 N6 s! u5 _1 W) n; G7 O2 T
else inc A_i by 1# V. B8 U5 S$ J. z4 L; l, i
end
0 h8 _0 `9 E/ v# y. 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,其它按你的 ...
|