|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ h, V2 K X7 X0 P, s1 L3 E; r1 H& B6 M0 m/ n3 r0 j: W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 O( M7 D! G) k3 Y
. }$ W' f. m+ ~begin P_read arriving r, U# R! I3 ~/ [9 K* Y3 ?
while 1=1 do begin
) Z% c9 s7 R) c0 F8 x5 H- N' F* U% Y read A_tote from "data.txt" with delimiter "\n"+ S. O* d0 ~8 A0 _3 t
read A_time from "data.txt" with delimiter "\n"3 B4 s9 y1 _4 G$ ^% U( g
read A_leave from "data.txt" with delimiter "\n"
# E) r/ b; A) d! \/ l read A_picks from "data.txt" with delimiter "\n"
: Z- `$ _9 X2 ^# P. L set load type to A_tote
; a7 f5 Y( G% _+ _# [ if A_tote="tote 1" then set A_induct to 14 |3 f8 E6 E2 k$ N& D+ L
else if A_tote="tote 2" then set A_induct to 28 F. P/ w9 S% L- Y
else set A_induct to 3
7 C) G& M2 ]9 c0 F set A_i to 0
. ?' o& H) D7 Y7 f9 Z clone 1 load to P_induction
) c; S) a' i9 Q7 `9 q! e wait for A_time sec' B$ A' T" }5 }; \
end
: v8 }& n4 i5 |. u+ Z3 ^end3 }- t+ B4 ?4 o; e* s
+ N1 W! ~+ C$ D7 h6 t; Ibegin P_induction arriving
- ?2 n4 O; u0 J* F. U if A_induct=1 then clone 1 load to P_pick1
. h y* V- u/ L+ M else if A_induct=2 then clone 1 load to P_pick2
7 p; x1 n# z3 L- g6 @( P9 B9 A else clone 1 load to P_pick32 t3 l, L# o+ j1 Q( E% L
end6 g+ x( ?( F+ E; b, c3 V
' v" k3 N- i) r
begin P_pick1 arriving
" S& f& M9 D3 W) `5 b& n" ^# n6 K8 x set A_i to 1" ^! \' x+ h# r, ?$ t$ e2 A4 K( t
move into Q_induct14 f. v8 ]7 p$ {% \
move into pickaisle.induct14 \2 T3 W9 ?/ M" W* I8 h
while A_i<=30 do begin
* C/ y* t$ T0 u& g2 p travel to pickaisle.con(A_i)# ]% Z% d1 n/ G: ?. o2 y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ^( V4 r' |( ^3 @: t# g2 Y6 @ else wait for 10 sec! S) @, @# t9 x! c
if A_i=A_leave then send to die0 _. p, a1 Y$ M- D# R _
else inc A_i by 15 }# g% s2 I2 j$ m' z L& [2 q7 o
end% R# b! o$ C7 I
end9 X9 ]) {( U0 r! \
/ d$ `4 V* s+ b' x7 lbegin P_pick2 arriving
3 b7 n+ J4 v! m, `! [ set A_i to 11: q+ f( ?* l: e7 S! u3 x3 s/ Q
move into Q_induct2- ]5 u, G, C4 N& S+ a
move into pickaisle.induct2' ?8 E- X' I) v! s; N
while A_i<=30 do begin
: E+ }0 p- Y3 [5 p+ x% O5 U, d4 b: w' C travel to pickaisle.con(A_i)4 i5 F9 |3 }9 ^, m1 i/ Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 M- N. Z. s* x+ O0 h else wait for 10 sec
7 ]) ~% X; A1 X# R$ r! B if A_i=A_leave then send to die; i- ^7 i: l# y/ K8 q8 ]; |
else inc A_i by 1
& z3 E' ` }! s$ S end5 D! m( B, L+ }- o
end7 K' Q3 @" M5 ?6 u
$ J/ p/ p1 T& {$ r% Nbegin P_pick3 arriving0 S, l" [. }/ w' l( p- I% G
set A_i to 21$ C3 }4 x, `4 n1 r: W
move into Q_induct32 ?! z. `! B5 P, d
move into pickaisle.induct3
- ]8 s. o" ? `% ? while A_i<=30 do begin
6 B# c2 v7 j" q2 a travel to pickaisle.con(A_i)5 _+ {$ Y7 A- g0 G# e. f* q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec X5 V: R! z& [& _: G
else wait for 10 sec
( T F0 S" u! |" a/ y2 ~ if A_i=A_leave then send to die
6 n6 h$ ?4 L3 G# M5 D; R. s: K else inc A_i by 1
! q* f( O& N4 [ end. o/ O6 ~6 b: `( k! t
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,其它按你的 ...
|