|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 a7 G4 d$ D. k$ m/ ]( y0 A1 f9 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中的数值,不知道会不会有什么不妥。
: Z( D7 v% G$ L
0 Z7 W% [; i+ G: ]8 ^begin P_read arriving7 ~5 ?: J- {2 v" E$ b5 i4 J$ |
while 1=1 do begin( { f$ S$ p/ z# c7 v
read A_tote from "data.txt" with delimiter "\n"
# E+ n% _ j8 K& o; ]3 x* s' C read A_time from "data.txt" with delimiter "\n" }- |9 F0 U5 J% H$ N( R2 T
read A_leave from "data.txt" with delimiter "\n"& K. q' H4 W/ e3 O
read A_picks from "data.txt" with delimiter "\n"
" A u: c: o/ |0 G {% \$ k set load type to A_tote7 S8 e& e; D0 [
if A_tote="tote 1" then set A_induct to 1
# i! K& x. |6 X6 q# i% f! V+ e else if A_tote="tote 2" then set A_induct to 2; h3 s* ~& _% n" K
else set A_induct to 3 8 _4 R+ C# q9 p v' ^
set A_i to 0
: N% }5 ] u6 o, U clone 1 load to P_induction5 a! R- v8 ]8 U6 O
wait for A_time sec3 x( Z' x! b) m m0 h6 _; z
end
# f5 L! W% l: c- V* C: A( |end
$ i+ G7 Q" G. x5 A$ i
9 Z6 H/ c7 _! Q5 [! M) U3 c9 jbegin P_induction arriving
. M4 {, d. g. T1 {3 m if A_induct=1 then clone 1 load to P_pick1
- E+ G7 {7 e6 w- `% _# z5 Y else if A_induct=2 then clone 1 load to P_pick2
6 d+ Q: X5 g/ |& ? else clone 1 load to P_pick3
2 C8 j/ V' T9 h! Bend
, B. ^8 _0 K5 f& `7 b/ ?5 K9 _5 q, E9 I# A
begin P_pick1 arriving. l2 n5 G' s2 Z5 ]; H# ]2 C
set A_i to 1! O, B i5 }' J/ r t' |/ w
move into Q_induct1% _1 @1 P! h- [
move into pickaisle.induct1& y0 t; i; h9 f- ?% M
while A_i<=30 do begin6 p' ?0 u4 y% Z6 G1 A$ D+ u" |, s
travel to pickaisle.con(A_i)
3 ~' B* x6 X& I. @6 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) v% l* w( n; }7 e t. t else wait for 10 sec% b, J# ?7 ]/ L
if A_i=A_leave then send to die) J/ N% ]8 ]. L
else inc A_i by 1! J* R$ N; q; I" y Q7 W
end
5 X9 _ z; m! J+ ?& Yend7 \9 q7 u. v" x4 ~2 |; N
& }* T; `% H! X# c( T7 n& e7 w
begin P_pick2 arriving
, h6 ?/ a- b1 R' F set A_i to 11
" H3 s- Z o. G t7 Y move into Q_induct2
. U. z9 C" e" E; c/ y' ], \. j* X move into pickaisle.induct2
7 t2 @% O9 o: M1 J0 X, }* G% f while A_i<=30 do begin
% x* L3 H8 f+ B3 _* p, c) u travel to pickaisle.con(A_i)& O/ G; \& ?2 `6 p& d# s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' J* {% z, E0 d/ \" M+ \: G
else wait for 10 sec1 E0 O9 l( y7 K* q4 }/ o
if A_i=A_leave then send to die
, G) d* _6 [: h, J X6 \ else inc A_i by 1
: a/ E+ X1 n w3 f+ N9 w/ [* b/ ~; a8 i end
o1 I6 m# V2 u8 o7 s2 }; ]2 xend
& p3 h1 l- a9 u1 q. i
4 W! e5 b* g3 `* Y0 s" U# nbegin P_pick3 arriving
6 S) e/ y$ z) c set A_i to 21
) b/ ?" k' x' ^% e% H% L move into Q_induct30 `2 ^/ X. j9 F/ c, W7 h
move into pickaisle.induct3
9 x: E# Q* B6 n5 q0 s while A_i<=30 do begin; p0 A) d/ S: b/ w
travel to pickaisle.con(A_i)
* t! p1 F- B% Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 k4 \7 I" M2 O4 u else wait for 10 sec
, O0 n5 F) b& l( J A* C if A_i=A_leave then send to die( @* r/ r, P6 ?( z. N7 m r
else inc A_i by 1
7 A2 F2 _( x- k# L) G/ g end: \! f7 H/ e9 V, h# B# _: V) 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,其它按你的 ...
|