|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 N+ Y" o# ], n7 z4 e2 b
S" J4 R' x- T( v: 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中的数值,不知道会不会有什么不妥。$ p, d/ l1 e# b
3 o1 ?# i) ~, ]3 ?# m) k
begin P_read arriving" R7 }4 P+ y- Y0 k/ F/ G$ l
while 1=1 do begin; t' E/ {9 F) H( u& E2 U: e6 d
read A_tote from "data.txt" with delimiter "\n"
0 G; c' m% t' c0 N$ s read A_time from "data.txt" with delimiter "\n"
4 ~# a- Z. H) M read A_leave from "data.txt" with delimiter "\n"# ~7 g4 ?) p% R/ b* U, I# @. D
read A_picks from "data.txt" with delimiter "\n"
7 O7 F t6 }2 g+ F set load type to A_tote
+ X) s. \! i! G/ l5 S: v if A_tote="tote 1" then set A_induct to 1
6 } L9 X3 O2 k3 B else if A_tote="tote 2" then set A_induct to 2* f1 e _ C" z, ^
else set A_induct to 3
* F: t* B8 w( p7 n+ g) g set A_i to 01 T' H: x$ j( [9 k8 ?- ~
clone 1 load to P_induction: D& m' c0 y2 A: A
wait for A_time sec9 ]7 }; f* x. s, V
end
& g4 W$ x, u4 h3 ^# L; N, iend1 G0 Y5 [- f7 J* V3 X
. ]4 ^3 X/ M5 i! r$ W! D$ C e
begin P_induction arriving
9 k+ _$ u! p! j5 _4 m+ V+ g7 _$ U8 w if A_induct=1 then clone 1 load to P_pick1
8 a) l$ s0 `& @0 q else if A_induct=2 then clone 1 load to P_pick25 J$ F* {& Z! U H
else clone 1 load to P_pick3' Z+ x2 G& w1 h" Y" x5 l
end
* c4 ]7 G' n" }4 ]7 F% K4 h* `4 t
Z, p2 l3 \" mbegin P_pick1 arriving, A0 v5 [0 b2 c5 |, k4 c
set A_i to 1
% I, Q( Z, _' e) {; W) a1 E) ^ move into Q_induct1
2 \# F2 u; T& Q* G7 U move into pickaisle.induct1; T: |( |, u( x; Q* W2 c
while A_i<=30 do begin! {$ N% |: H1 W' Z) r( K
travel to pickaisle.con(A_i)
, g- P5 C6 C7 Y7 \7 w! O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% t+ s6 d: x" c$ X) i
else wait for 10 sec& L$ y r: o" ]! D
if A_i=A_leave then send to die
1 P5 A0 M4 `# ?( V1 ? else inc A_i by 1
6 ^" O+ V1 I, ?4 y end
+ a7 l5 z/ \: L* z: j5 F$ jend
+ u7 Z, W8 l! t4 O/ L$ T6 [
* k2 u+ w4 ^8 j5 j+ k( u# Y0 {begin P_pick2 arriving
3 Z$ }# A: H! V2 u) M set A_i to 110 Y* A4 `, t N0 m4 }
move into Q_induct2- D2 V0 d8 g* ~7 T0 Z3 w* G) n" c
move into pickaisle.induct2
6 Y4 t) Y* s. @7 Y while A_i<=30 do begin
7 O$ U3 _8 Y+ p( q* u& s3 @ travel to pickaisle.con(A_i)
: Z2 F: d1 k/ d9 Z* n5 `* V1 E; Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( ~; C- V( f& H% [8 t else wait for 10 sec% F% G b! g3 [% L5 J8 I+ P
if A_i=A_leave then send to die
4 l4 V n0 h* N! M9 u* i5 A# I" T3 G else inc A_i by 1
% [3 k) W3 g, C6 c; t* b, k3 s- ~ end& O% D% I4 _8 E. Y
end
$ @. ?) B0 h( }; t" g
) i: J0 M0 `2 Kbegin P_pick3 arriving g9 X2 F1 b+ b
set A_i to 21& r$ @. y2 z) f' F& h$ u
move into Q_induct3
( t, Z; ^ i2 d2 U) ~1 _& L8 ]6 N move into pickaisle.induct3
9 ?% Z' h( P' f3 I while A_i<=30 do begin4 l4 w) ~7 T+ |0 e
travel to pickaisle.con(A_i)! l @; t+ Q- y. j* g& k; O& c: ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 q6 Q9 ~. w- n4 D/ h
else wait for 10 sec" I; L8 n! k- X3 t: L
if A_i=A_leave then send to die* Q& z7 }/ J# e+ ]
else inc A_i by 1
* ~; _, C* o- O1 _! c end3 N* X! u) Z6 y" X
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,其它按你的 ...
|