|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) O) y) m6 U. O% F* O5 t" W3 g
4 q& |% H7 c6 j. [1 K# i我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 {4 P G: H9 Z7 _
+ h4 X5 m+ _3 A, [7 T
begin P_read arriving
" s! P. \6 J$ O& N( J9 C while 1=1 do begin* E* P# t$ H2 n/ v# l& u
read A_tote from "data.txt" with delimiter "\n"
1 j% I1 T' L6 i2 O3 i* \. \3 z read A_time from "data.txt" with delimiter "\n"
$ R V3 v3 Z) E read A_leave from "data.txt" with delimiter "\n"0 B# P4 m( B( _ a1 L
read A_picks from "data.txt" with delimiter "\n"3 R& h8 w/ h+ I W; `
set load type to A_tote
* \ |& A1 m* u( Y if A_tote="tote 1" then set A_induct to 1
7 T& D3 h L, Z1 T9 j# u( o else if A_tote="tote 2" then set A_induct to 2
$ ~. `! Z( ]$ y else set A_induct to 3 9 ?1 d" f1 [* V
set A_i to 0
0 I; @" u* ]% ^5 U3 c0 b. c clone 1 load to P_induction
* X- @. @* S/ I# {. i# C; I wait for A_time sec9 h+ t/ m1 j/ l9 R7 u
end6 p* {7 U0 R X# u. h. Q
end
, {- S8 l5 \) O6 s+ F& t
. {9 |6 g- d/ E4 m7 M1 T1 o1 d+ pbegin P_induction arriving
6 n; v6 R9 }( @0 V if A_induct=1 then clone 1 load to P_pick12 {" N8 y8 ^4 s+ H. |6 i/ Q8 Y
else if A_induct=2 then clone 1 load to P_pick2
3 W1 U" ~4 I1 W0 r4 w' C* g3 A9 D else clone 1 load to P_pick3
) `( \( G) o- ]6 L; R" @! mend
2 {6 c" L- ^2 K* a9 [" }9 n E1 e/ K }3 o" E9 u
begin P_pick1 arriving1 W, ?, Y4 f0 z0 t
set A_i to 1, H p! b$ U$ _! b! Y
move into Q_induct1# F" _/ J# n. n
move into pickaisle.induct1+ N* y$ q; J4 b4 R
while A_i<=30 do begin1 C; L5 Y; F0 s( {
travel to pickaisle.con(A_i)" X! T8 @1 J9 R1 q1 w g/ D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( j: j# V# v9 x; j$ C f
else wait for 10 sec/ b( g5 r r3 p' H
if A_i=A_leave then send to die
) H( \1 |" X6 @ |8 X else inc A_i by 1
0 d3 G$ w8 @% q8 K; ^7 h end
/ g+ i% O$ a9 V& b: T9 [1 Y/ H( Q, Send, {5 G: f# k) X: w" k
% h3 U9 z1 @2 G! @$ i8 L1 }# \
begin P_pick2 arriving# [) B' F8 y) _- b6 H( G2 d
set A_i to 11% w- x g7 s8 e$ R+ }9 N
move into Q_induct2
z, M7 A0 d, C4 I. Z, A! n9 w move into pickaisle.induct2' y1 b$ a- D/ K+ {/ @( {0 K
while A_i<=30 do begin7 O* s) r( i' O
travel to pickaisle.con(A_i)
. B( }1 {* }7 C- I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; z; l; d* m7 i2 Q& B
else wait for 10 sec. M5 {4 o- i2 ]# ]* g2 a
if A_i=A_leave then send to die2 H' E' h# e! ?; x) d& @) ?6 ~ \% n
else inc A_i by 19 p3 ^2 t9 J& f& N5 `
end* q' s% Q- l2 s w9 F+ y) l
end
# w4 L8 T' G- V1 c5 d
% m& M6 M) u+ K C6 N2 obegin P_pick3 arriving# V8 g# B1 m, D3 }: d K
set A_i to 21
8 ~8 n" O r# L6 _/ I/ N9 ` move into Q_induct33 l ^+ v+ ]( R& a
move into pickaisle.induct3
. w; C; R+ J, y5 B while A_i<=30 do begin5 z6 \& J: `$ j/ x/ s& J
travel to pickaisle.con(A_i)
( V: r7 O& h4 c* m1 `, b& T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 A8 X& E( e6 Y' I J- o
else wait for 10 sec7 }& l+ S- H1 Q C* N) h
if A_i=A_leave then send to die; h* M2 R1 m$ f
else inc A_i by 1
5 ^4 l4 h6 k, F( c; ? end
6 F' [/ D' \/ Q0 Pend |
最佳答案
查看完整内容
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,其它按你的 ...
|