|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* s. D; E# A7 s
* G( J1 U) @9 X我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ?4 Z0 e3 }/ V' r. {- Z* ]- ~* `/ ~0 r$ Y1 T
begin P_read arriving
" t7 S8 J7 {4 @. ]4 _8 E4 J6 n while 1=1 do begin# h v6 n9 i# u# X. X) R
read A_tote from "data.txt" with delimiter "\n"$ F; e. W ?5 ~7 L
read A_time from "data.txt" with delimiter "\n") u7 k9 w$ S. r8 [% O6 F4 J
read A_leave from "data.txt" with delimiter "\n"$ m4 R4 ^- E" A0 n( n" y
read A_picks from "data.txt" with delimiter "\n"
/ Z5 y' ]& ?! S1 \ set load type to A_tote
/ \5 G& S( E# N; K if A_tote="tote 1" then set A_induct to 18 y) {. _9 g$ @
else if A_tote="tote 2" then set A_induct to 2
! V5 E: W* u$ |, s2 D7 x; B else set A_induct to 3
) \3 i3 K3 ]7 K% E set A_i to 0' y# ^- r! M! D/ q. |/ a
clone 1 load to P_induction& ^4 r2 n! ]5 V, @) z7 p
wait for A_time sec
0 `; v4 ]6 ]8 n6 o end0 V [" [- s- r1 C* |. R
end, P0 v8 [/ c" m" T) K; | q) _
$ t/ w; t8 F/ U1 r0 [) Gbegin P_induction arriving$ n7 x6 x5 ^( |5 }9 E5 E
if A_induct=1 then clone 1 load to P_pick1/ T4 h# F K' i2 c/ T
else if A_induct=2 then clone 1 load to P_pick2
" I* e" c$ F9 U0 E1 A* n else clone 1 load to P_pick35 m% m e# I% N% B G+ ]
end
0 k; D. E8 x# W( M8 f7 O
4 ^* |; @/ F. }begin P_pick1 arriving( }- y' k1 t+ F& ^( y
set A_i to 1, u+ Z1 ~, U. T. k- b( V- [
move into Q_induct16 G- ?6 Q6 ]5 K; ?3 Q: _
move into pickaisle.induct1
! B! d3 r9 _( e while A_i<=30 do begin% F; A: q* |$ k) ~$ J% p: ~* K$ J
travel to pickaisle.con(A_i)6 q5 b- y4 c7 `' J S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 S0 X4 ]" Z) s! c' o9 x4 s4 i, N6 U else wait for 10 sec
+ p! k f- W" G9 b8 { if A_i=A_leave then send to die5 R) D% R" I, R9 i! K* u$ b
else inc A_i by 1
- T/ h" I7 a$ \- ^/ Q; u end
2 G! V; Q4 X- m4 gend9 d: H/ `" S- H/ g+ T2 L
/ `2 l, ~$ I0 I, ^) Nbegin P_pick2 arriving5 v. q J7 z4 g; u% B
set A_i to 11
6 P% Z, g T% e4 x9 Y8 _5 y move into Q_induct2
: g# y" m8 c$ C$ x( U: l$ R: P- S1 E move into pickaisle.induct28 T8 w6 L- z9 }. Y+ {
while A_i<=30 do begin, R$ A9 n5 F: A/ n* g0 z5 K
travel to pickaisle.con(A_i)
) N' v! V: @4 g( m2 b5 R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" |4 s& s. g7 L
else wait for 10 sec
( T! s7 n- y5 ^& X/ u# d9 ^ if A_i=A_leave then send to die
. h3 z! r1 X, v6 j. k: G: x else inc A_i by 1% n' B! D) a- I; X
end
! U" K7 a6 ~8 {. Oend7 x1 p" R, P p& B, a+ n+ v
5 n% ~2 K3 x' c: t& hbegin P_pick3 arriving7 `; O/ N) b/ G, B1 X( J* n
set A_i to 21% ]4 N: ?. L1 L. E
move into Q_induct3! I7 B% Y# h9 x4 t' Q+ B; K3 d8 P7 G
move into pickaisle.induct3
, N9 N3 x. H: @* J2 W$ Y while A_i<=30 do begin
8 K. g, V" n p* P8 R# m travel to pickaisle.con(A_i). E; ]; N0 E+ H( {# G F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 T2 q' h3 s4 M! R! A* B( } else wait for 10 sec/ [0 E0 w& o9 a5 E9 t" G9 I
if A_i=A_leave then send to die
% r' D( I" O: T, F2 f/ m; ^7 R2 F else inc A_i by 1! Y4 G: L/ W" F @. ^2 `, K
end
; J" V) N6 n9 hend |
最佳答案
查看完整内容
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,其它按你的 ...
|