|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& O& z* c8 f, w' F! l7 C
: h$ d. r2 G3 s6 R4 c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) [4 o$ [3 u B j- Y; X, i: D! M& ?: q. T+ a2 e
begin P_read arriving
: z( \; y7 {6 m: X0 Y6 |' c: Z while 1=1 do begin+ u) l0 D2 o( D" }; {& F
read A_tote from "data.txt" with delimiter "\n"
F* u! A0 k0 R2 _ read A_time from "data.txt" with delimiter "\n"* ^2 i' E' j* h" |( T
read A_leave from "data.txt" with delimiter "\n"
8 W* I( |/ Y; m$ q% Q3 { read A_picks from "data.txt" with delimiter "\n"
7 |/ Y0 [4 k/ R9 Q7 g1 Z" f' E set load type to A_tote
, T' B+ S, e8 H' T% T, H if A_tote="tote 1" then set A_induct to 1
$ T( G( R& M5 M" E, A- I else if A_tote="tote 2" then set A_induct to 2
# D2 _2 o7 x! t3 ~ @ else set A_induct to 3
% e" d' l3 p1 K- C- D4 N set A_i to 07 m- F2 z# S% _" e- N8 z+ j9 W- P
clone 1 load to P_induction
6 w% w& K9 G0 d9 r2 I+ @, V' j wait for A_time sec
* q" o" Y- E; Q; l* P8 |/ k5 x end
4 {. I3 ] `4 G5 vend0 t; {6 H3 Z8 A; `4 b% c3 K
, C9 v7 ^; T; d+ \begin P_induction arriving
# z4 ~' g0 f; w1 m ] if A_induct=1 then clone 1 load to P_pick1
' w1 ]4 T, t6 b! c+ C0 @+ F+ Q else if A_induct=2 then clone 1 load to P_pick2
3 b5 ?4 _3 l1 g- k& e0 O$ u else clone 1 load to P_pick30 D' L, G" j& f( ~0 }$ \3 u
end
* }9 x- l4 z; A4 _
. e( u2 h4 c/ h- [5 z0 A) fbegin P_pick1 arriving
; Q0 `" j, R8 P E) d8 _5 Z& Z set A_i to 1: F7 |& M# O/ U* s
move into Q_induct14 h' z2 u1 V8 Q+ N- m# W) R
move into pickaisle.induct1
# e e& S' S" s5 [0 q1 L while A_i<=30 do begin+ C, {9 F$ u* f- `: o5 A
travel to pickaisle.con(A_i)7 f6 G; m' h/ R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, G' M3 l4 M+ [4 d# Z- e+ n0 F else wait for 10 sec. S9 | k" C5 Y3 n0 Y
if A_i=A_leave then send to die
- r- i5 R- U# S( t else inc A_i by 1
% }5 F9 M- x- w) m. \% Z$ a end: a/ R. }6 E; [! I$ s' S- C
end1 S. z5 s3 ^. V) @9 p
3 @ y9 p3 L4 Y$ }4 }$ |1 Xbegin P_pick2 arriving; q+ g9 M5 O9 s- U. `' y& ]
set A_i to 11. d, L/ l* M/ j# f2 P: G: w, X
move into Q_induct2
, r$ y- z: |) d6 \: g) L# g move into pickaisle.induct2! c: d) h! Y1 U
while A_i<=30 do begin6 ~6 S* d7 o# n; A
travel to pickaisle.con(A_i)0 D/ u& s. ~& b- R8 l" R! m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* T6 N4 a. @1 P else wait for 10 sec3 v; A- l* {( x, f
if A_i=A_leave then send to die
3 D- H6 F4 ]* E- @ else inc A_i by 1
; U* H. ]1 i9 d m% |3 h3 H2 E b" O: o end
7 q8 @" a3 H" l+ V$ rend' d g' P+ B1 R% L+ X9 P. g
7 M% G4 v X6 \& Jbegin P_pick3 arriving
, Y" k- z' N7 x" k! g- ~ set A_i to 215 a" t7 a a% k2 m
move into Q_induct3- u$ m3 Q6 \0 h- y
move into pickaisle.induct3
4 H* J$ q2 P" _( ?: W8 V' _. S while A_i<=30 do begin- o3 q) N, T" L/ Y
travel to pickaisle.con(A_i)
% g1 l1 d; D0 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; p% y, D& x) e. k1 R else wait for 10 sec
$ w1 ^% J5 j% M$ i' \) M if A_i=A_leave then send to die; M" Y( R) O" v; _
else inc A_i by 15 ^. f0 f, ?: K7 N* G
end
" s: p7 j2 ~% X. J, qend |
最佳答案
查看完整内容
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,其它按你的 ...
|