|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; O, i+ `' I7 p; v
5 ]. K( n% V! h u( y7 m我的问题是,在每个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 m0 L, @( _2 C4 @ t2 N
' G) x9 \5 S0 P: h. ubegin P_read arriving
7 R; b4 {5 [5 e a& d. z while 1=1 do begin3 ^& c7 P% n; s, b
read A_tote from "data.txt" with delimiter "\n"
8 a {5 I$ p0 g, C3 f+ p4 t1 } read A_time from "data.txt" with delimiter "\n"
: M$ I" v, F! O) A' Y2 S read A_leave from "data.txt" with delimiter "\n"
: B4 e; E" P" q read A_picks from "data.txt" with delimiter "\n"/ X2 x* q5 M# Q
set load type to A_tote% N' _9 y5 B) J6 S1 S
if A_tote="tote 1" then set A_induct to 1
2 |% q5 h' m; z/ ` else if A_tote="tote 2" then set A_induct to 2
- x; W9 f0 f: M, b else set A_induct to 3 , U; z* e' _- O3 J9 [3 U. B3 M
set A_i to 0
/ [0 L/ j# A! w0 Z5 X. s, J6 w clone 1 load to P_induction
9 s/ v2 S: W* |* b/ X wait for A_time sec* C5 g* _) B! D% z! n8 E% k6 k
end
4 L r: r0 r5 Tend5 v' D( t/ ?% ^1 ^* Y8 m+ x: I& H2 i
: x% K$ \! \' c. }- f+ w3 pbegin P_induction arriving5 [7 o' ]% a! E6 X H0 j- N
if A_induct=1 then clone 1 load to P_pick1& @' w5 S j5 d' n' ~0 Q
else if A_induct=2 then clone 1 load to P_pick29 t$ {* e. A' c. ~4 b0 N
else clone 1 load to P_pick31 a4 a8 o* f `4 U) ]. D7 c
end
6 c+ O$ o( V, x; ]7 H& W) N4 j) h9 B" G
begin P_pick1 arriving
S Q$ _; y' e2 j! ^" M8 Q' ] set A_i to 1/ d9 Q+ p+ E2 f: h. h: v! ]# c
move into Q_induct1
6 ^) M; c* X8 k/ ~) G; H move into pickaisle.induct1
9 s% ?: ^: D4 X U while A_i<=30 do begin5 D0 B# n$ B8 \* X+ f) Y
travel to pickaisle.con(A_i)+ Y& |6 M' R) Y. V. Y# `6 H7 I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 ?- ?: S# S0 A% b5 F3 p else wait for 10 sec
, C" d: A V3 W' f if A_i=A_leave then send to die
5 C- P' N$ K7 z8 n else inc A_i by 1
$ W* U* l( M2 |4 l! `7 f k end
+ I9 Q- C; @$ B, g5 Q nend2 a6 ]; j7 U9 ~4 D
! ]0 K; E# F# z/ W4 E8 H/ [! obegin P_pick2 arriving7 X6 ~0 e3 D3 N7 _
set A_i to 11
6 R& S/ z6 A' y" a move into Q_induct2
+ A/ m! h# U' p) G0 p move into pickaisle.induct2
4 V6 F; |2 }: B4 c1 @( F( K- k* \7 i while A_i<=30 do begin7 s% o! A/ s. n: N6 {( b" f
travel to pickaisle.con(A_i)
* u8 e" Z- Z" \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ?. L1 Y7 a# r9 g: t/ V% k. z( \
else wait for 10 sec
9 t( x$ |( g) j& q3 H! Z if A_i=A_leave then send to die6 V6 I8 @) J u
else inc A_i by 11 w7 y: N2 J$ e4 w5 B8 C* _
end) y8 ~/ u9 S7 c# a* A, X% n# ?8 c
end
% e3 H9 m* j5 n* ^7 @/ b
0 c1 U) b/ B6 S& @3 f4 ^% bbegin P_pick3 arriving
$ g3 F; `( M& }: z set A_i to 21
) w4 ~2 [3 |1 j6 ?4 C* |& N" d6 f move into Q_induct3
/ |4 q% l# S7 ?+ f# R move into pickaisle.induct3$ X% F b2 o, a( ~$ J
while A_i<=30 do begin
* ]* n; j% x( e& t( D- E* X. \ travel to pickaisle.con(A_i), |# c/ w, r }! I( S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" `0 \0 v0 }4 Y; L: r: p2 M else wait for 10 sec
) k% w5 i$ W) d* I4 ] if A_i=A_leave then send to die
* c" C1 V9 R9 l5 M/ Z else inc A_i by 1, v( x2 ?! F: \9 Y# B E$ f
end) N) G" r l5 D/ {0 Z
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,其它按你的 ...
|