|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. q4 f( T: J. R2 R% X$ p- c6 [' R h8 Y7 A% `( @$ D
我的问题是,在每个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 l* ^5 ?; }( a# f6 q# U# F
& F9 q1 |' N7 g) pbegin P_read arriving9 g# @1 n, C5 z5 |
while 1=1 do begin
/ ^* {7 {2 U5 q5 s) T, i8 ^6 t* ~9 t read A_tote from "data.txt" with delimiter "\n". f) E; S% ]8 e
read A_time from "data.txt" with delimiter "\n"' y0 b/ K3 @0 @: R# L H; v
read A_leave from "data.txt" with delimiter "\n"+ T' u) Q. ~6 \1 a {
read A_picks from "data.txt" with delimiter "\n"
2 h7 R6 n0 X- o set load type to A_tote# L: o# {( b" ]4 m+ ?
if A_tote="tote 1" then set A_induct to 1! Y- p7 B' G$ R/ ~
else if A_tote="tote 2" then set A_induct to 2* i+ c) [+ J' c$ l( B$ @
else set A_induct to 3
# T; V+ k$ P, Y1 G set A_i to 0
: a- R" R$ \ w8 Z clone 1 load to P_induction
$ u) j( _5 I5 _" R wait for A_time sec3 y' ]8 D0 K, t0 @& ]
end
3 A/ n# ?8 y. P: n* Jend0 y7 Q2 E7 m& f/ m/ S5 }& L2 q
5 r3 t& ]: `8 ^; f' R" Ubegin P_induction arriving
O4 {' M9 }. V& U7 j if A_induct=1 then clone 1 load to P_pick1* _3 L( t) v. e
else if A_induct=2 then clone 1 load to P_pick2
) ^, i. w' [- Y% r& D0 Z$ Q else clone 1 load to P_pick35 ~9 J r; v" j9 [( Y
end; a1 i1 l3 D; W0 }
W3 ]6 k, {% s- d0 }5 T
begin P_pick1 arriving
$ ?8 s8 J4 m$ e7 R& ^ }7 } set A_i to 1" u8 i \* p- B S2 |1 O3 }( h7 \
move into Q_induct1/ f) I5 i3 L8 ^+ b9 F7 d8 z$ e
move into pickaisle.induct1
" V+ X$ y" b/ O while A_i<=30 do begin3 h, z7 I' Y0 [8 l9 v; a5 U# M
travel to pickaisle.con(A_i)# S# \% h7 q7 w" N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 x$ K8 v7 M$ D7 Q* H! B7 l else wait for 10 sec$ `6 T+ |0 e* W; }8 a
if A_i=A_leave then send to die
* X. c6 {4 [# P8 b) z0 g else inc A_i by 1
4 E" a- k7 C2 K! [2 @ end
9 n/ ^5 V9 ~2 v% B" z0 f4 Uend6 v; Y9 i# z, g+ x. a4 [! j
. ]1 L$ ~( Y0 N: a+ e6 zbegin P_pick2 arriving) N; b" D- t" E
set A_i to 11
. ~. C' k- n% O0 g3 E move into Q_induct2* M$ I2 o4 x/ q1 L5 j; T1 C8 ~5 e
move into pickaisle.induct26 B- {4 ?$ O5 V# f F
while A_i<=30 do begin: N! g: l7 g+ C( m4 V
travel to pickaisle.con(A_i)" z" m# y: X1 ]5 g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ q* K" i2 P1 u6 W' l else wait for 10 sec4 j% W, d6 r. Q8 S5 W. Y
if A_i=A_leave then send to die1 u4 @9 ^# R% ~7 p0 ^9 A7 B' [
else inc A_i by 1
( I- {* _4 y2 R end, X6 s- X! p) {! J0 q- r" y
end$ O- Z1 Y$ {" v4 ~) b
* F G* G" }7 K" \9 zbegin P_pick3 arriving& e2 |9 a# {8 v. ~
set A_i to 21( @: U$ ?+ ~2 ?2 n
move into Q_induct3
& U7 { k# e T ]8 n2 P move into pickaisle.induct3
2 o" `. e" E: M( A' I @ while A_i<=30 do begin& V/ b1 r4 j+ ^4 z+ T
travel to pickaisle.con(A_i)% ^ W) c4 b+ P; r& K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G: o1 d# R3 w3 M Z0 x% x/ x else wait for 10 sec
- B/ S Z5 B0 p if A_i=A_leave then send to die+ l7 s- n/ Y1 h( e7 ^2 \
else inc A_i by 1
, S! i! l. u4 z# `- h end
0 m7 p! h8 N3 y& Mend |
最佳答案
查看完整内容
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,其它按你的 ...
|