|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* K+ |" z1 c4 W( a( o$ Z& r
9 ^7 w# O4 l: a/ t我的问题是,在每个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中的数值,不知道会不会有什么不妥。; b$ _( B. |2 x$ X, F4 M- l
. V' I- Y% o. J1 D+ V) `9 D9 }begin P_read arriving
8 O& H; L: k, \+ }5 N' F. w while 1=1 do begin4 ~) G* F3 V1 U5 a
read A_tote from "data.txt" with delimiter "\n"
# @6 Y8 l. E2 w$ K/ C; w read A_time from "data.txt" with delimiter "\n"
3 U0 [. p5 l& b2 k5 ]3 L read A_leave from "data.txt" with delimiter "\n") F: g! |, O* Q# C3 a3 t
read A_picks from "data.txt" with delimiter "\n"
6 G& v8 Z s( B8 S set load type to A_tote5 n! T8 n6 P8 s7 f3 m9 R* U
if A_tote="tote 1" then set A_induct to 1
/ B3 P0 E: X5 ?8 q7 B else if A_tote="tote 2" then set A_induct to 2
- i# A* N1 W* N F else set A_induct to 3
8 w/ G% S' s3 `' O. t set A_i to 0
a' U4 C k0 R* \ clone 1 load to P_induction) R/ S7 M. e; B P/ `- e1 z3 x
wait for A_time sec
! `( F% L; J2 S) I+ u @; T& W end
0 S9 B+ d/ n/ L* D$ Y* ^end
! \3 Z P5 u" O. s( y5 q
! X5 m2 S9 y8 u" U$ f( obegin P_induction arriving
; Y8 t' ^9 ~, G" w* @ if A_induct=1 then clone 1 load to P_pick1+ W4 Q/ C' b' Y% L6 \
else if A_induct=2 then clone 1 load to P_pick2
) _, i9 f! Z+ h6 q5 C else clone 1 load to P_pick3
6 D0 n T3 V' I% e: wend6 O# o. z4 a. g; h0 i
! o0 u' t% S8 W3 K, l2 i$ z0 Bbegin P_pick1 arriving
& W+ k7 V8 C2 A# z7 g# v7 h( C set A_i to 1+ h: P7 w+ \. J" Z: `( f: |2 I
move into Q_induct1
. K/ H% p" L1 d+ n: O move into pickaisle.induct1
1 v: T. ~0 x+ Z while A_i<=30 do begin
8 C# j& V. o! E8 |- U. N' `5 h travel to pickaisle.con(A_i)) M5 [& T% l. B! |7 S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
b* @2 {- P2 R F. U else wait for 10 sec2 N+ R0 y5 M3 E. K
if A_i=A_leave then send to die# d( Y1 ~3 {9 k& W: A. t
else inc A_i by 1
9 M* k; B! {: V/ F# |! F end
7 u! i0 d1 r7 ^- J$ uend& y$ ~% f1 C4 H# s# u9 n1 g$ {
) B3 v9 e8 [: m8 x, [begin P_pick2 arriving- e) W3 |+ E5 H' F$ \; |8 i
set A_i to 11
4 k3 j" a) p0 i) l move into Q_induct2 p, P+ f) y0 j2 D; t A
move into pickaisle.induct2
9 t' ~5 A" b. w; Z while A_i<=30 do begin
* F1 P5 t1 u; }0 F" Q travel to pickaisle.con(A_i)8 F8 `( R/ X. V" \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) W! G5 A8 C# P else wait for 10 sec8 v9 R6 W! L3 m8 J$ X
if A_i=A_leave then send to die$ e5 h: t; v$ ?" H3 B3 m$ T' I
else inc A_i by 16 d4 M3 {# n( l
end) Q% \8 ~* ]4 u k! R( S) L
end
+ l: r- _7 x. s+ F7 E. I0 k w% h5 k5 ?5 X2 w7 Z% s
begin P_pick3 arriving
3 ?4 A3 U" U; s& Q set A_i to 21
- z- u. L( [* q move into Q_induct3
6 E& I) P4 s. R" e5 d6 v8 l move into pickaisle.induct3. Y9 ^5 E& s" t% q& @7 \; A
while A_i<=30 do begin
' ]2 F! e7 j5 z: q travel to pickaisle.con(A_i)3 Y/ E3 A# l" l1 Y2 K( m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 ^7 G9 Q$ n- C1 C else wait for 10 sec
/ y: e. ^4 q: u8 W0 V# ~ if A_i=A_leave then send to die# k- `& @7 | C, y" x4 X
else inc A_i by 1* I( M0 r. c7 ~# d1 d p
end& W B7 a# b# m4 N0 [ x( W
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,其它按你的 ...
|