|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 d3 f3 }4 X, M& v/ x' @
* S8 B2 J) L: V# D& U4 x/ C我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' O* I. S7 D( F+ u6 U; m& I; A, J
begin P_read arriving
+ V7 V0 `4 u3 `& K+ d0 w1 \/ ? while 1=1 do begin
0 v3 l, H' _7 r! h( z read A_tote from "data.txt" with delimiter "\n"5 i( @- M$ g* ^" t* ?
read A_time from "data.txt" with delimiter "\n"
8 q8 S/ _/ X- {$ x5 L: N read A_leave from "data.txt" with delimiter "\n"+ K2 }" @ n; E. V3 H
read A_picks from "data.txt" with delimiter "\n"
+ j# n, s& W7 ^8 t- u( \ set load type to A_tote2 F3 I0 c% W& m+ k7 f, y4 k
if A_tote="tote 1" then set A_induct to 1
# e1 Q9 u* t; V8 X else if A_tote="tote 2" then set A_induct to 2
. s ~1 o7 C4 l" P& ` else set A_induct to 3
' o9 R8 m' n1 e! B/ ~ set A_i to 0
2 i- L6 |- j0 L# T" Z clone 1 load to P_induction
8 D9 I3 p. s3 Q0 D$ J2 l: O; x wait for A_time sec8 m, ]. S9 Q$ h' g8 k$ H; H" Z
end
- w- W8 u; l2 v) ~# t. Pend
' u9 o0 W# d5 f" w; u+ d( A( V& q+ q# g* _6 P! b9 g0 K
begin P_induction arriving! D6 V3 @5 W6 U5 ]
if A_induct=1 then clone 1 load to P_pick1
* j9 o# q/ {0 w9 o* W6 f$ n else if A_induct=2 then clone 1 load to P_pick2
/ }* ^/ k0 H( o6 n else clone 1 load to P_pick3
0 j5 C3 V- p, R$ J( Iend8 m, F; b: \- u% S! F0 m% j& J
: m5 Q+ k) A, O$ t7 zbegin P_pick1 arriving
& e. C y" X1 i9 g' C1 a' S( @ set A_i to 1# g; x2 T" r7 j8 c" l) P: a3 Z
move into Q_induct1
( @' v! n& g" ] move into pickaisle.induct13 l: x+ {: N& i& C, I& E1 P+ {8 u: c
while A_i<=30 do begin7 t4 n. v+ J! d; A
travel to pickaisle.con(A_i)
1 D; p4 h; M: W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* F4 h0 W: b( { else wait for 10 sec
: m) d8 Z* b& h) G' `3 Z5 a$ t! C. Z d if A_i=A_leave then send to die
, p8 g" ~2 o9 r! i2 r else inc A_i by 1
3 c5 v9 p D4 f end
8 w9 n% S$ v5 P5 C9 K/ Gend
: Q6 e* D& [. m; d! L! i
& [3 [9 `0 w" n2 A$ ibegin P_pick2 arriving% w' r7 ?. @ l% X7 w f# ^
set A_i to 11
2 P: }8 J8 |3 W( R0 y; b move into Q_induct2( P0 M/ _/ V P, z% Y$ o) G$ r8 l
move into pickaisle.induct2" T7 u; d ^* O1 v
while A_i<=30 do begin
2 K4 D, m. c, F0 C5 _ travel to pickaisle.con(A_i)3 y# V0 W8 G3 A y6 }( |1 m; X8 U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( H7 h a+ S0 f4 I7 M else wait for 10 sec# M! J* A7 K, k e! z
if A_i=A_leave then send to die
# o2 v3 B* n- F, m# T9 Q else inc A_i by 1) ~" d+ l. ^* f4 q
end
3 ^5 x1 d' Y& b' h) Y" h( t J% Rend. H. A* a! e1 A. ]
$ m, D# [; L9 [: O4 B g! C$ B: qbegin P_pick3 arriving
( g% m8 D( r0 v: x/ S set A_i to 21, W4 a" a1 u& X( ^/ y8 w9 [
move into Q_induct3
. r2 l U4 X1 j- F) { move into pickaisle.induct3) x1 d- c$ o: w4 m5 p% }1 n
while A_i<=30 do begin
/ M; U, C# S) { travel to pickaisle.con(A_i)
! W& R- _" p/ I! w0 p9 C" T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( C& s) W7 l/ v1 h$ e; ^
else wait for 10 sec* d0 b% r2 B: d# }3 K
if A_i=A_leave then send to die
$ U, o. l- n1 m; l9 N h' g2 D4 y6 p else inc A_i by 1
) @. v. ]* A* Q3 N1 ]" j7 F( L# u end
- q# D2 x( i4 K: Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|