|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 A8 t' H6 b# I1 H" ~: ?
- D2 L. v J% u3 p2 t% X6 m: L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; r8 o4 T8 \% e# M) @7 X/ x+ \. n) o8 K9 t8 ]
begin P_read arriving
7 T# F; a4 H7 Q6 C. u" w while 1=1 do begin T) {4 q: h$ {7 Q
read A_tote from "data.txt" with delimiter "\n": C) }0 |* g' _# L3 `" W, b$ x5 L( s
read A_time from "data.txt" with delimiter "\n"
, q: r! S5 L$ J \9 n- M read A_leave from "data.txt" with delimiter "\n"
( S0 q! ^0 P* M5 S+ C* O; i read A_picks from "data.txt" with delimiter "\n"
+ q/ C7 k: d" \) E r9 y set load type to A_tote- \4 C' n1 U- x& v" Q+ i$ j, f7 o
if A_tote="tote 1" then set A_induct to 13 J, v) d( i: f4 `0 p! {
else if A_tote="tote 2" then set A_induct to 2
1 @( t9 x3 D! { else set A_induct to 3
" D, `) d1 U+ c7 z: P, ^; ~ set A_i to 0
/ _; \4 y& D5 J6 J6 u" M7 ]% w clone 1 load to P_induction9 l6 T8 I6 |( Q3 p9 u% ^ g) w: W$ k
wait for A_time sec
; O* j# c* r! h/ T. K; H end+ i. l1 i/ v1 Z5 x) Y5 q
end
5 L- Y$ m; P' h* ^0 Y+ ?$ L
) w' V4 F: L$ H. `7 [/ u! `9 _begin P_induction arriving
: W% E9 v# n7 Z1 J8 F. g if A_induct=1 then clone 1 load to P_pick1: d* S9 [9 L% {, t4 K
else if A_induct=2 then clone 1 load to P_pick25 K/ B, X9 g0 c
else clone 1 load to P_pick3
6 s+ T; E. \( u7 f5 ^end! [7 X& }9 Z- k0 P) U, c+ j
6 c# e( `6 Z5 @' Y! X) i
begin P_pick1 arriving" u& H( g! V7 G( \- o- z1 m
set A_i to 1
- z P" G& g7 X* n$ Q) } move into Q_induct1
! X. _; r7 O) N' C5 V/ V/ x8 X move into pickaisle.induct1& G+ d) ^" X0 P2 Z9 D9 l- \
while A_i<=30 do begin
; d. l! Y8 d5 [6 v) D; r2 n travel to pickaisle.con(A_i)
+ F1 Z5 v7 T0 f: I* F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# L: N! t3 k8 u; g
else wait for 10 sec. t: }% ]$ V: |
if A_i=A_leave then send to die, ]; a$ l" u* u0 h
else inc A_i by 1% u) u" s0 L; S9 `# `9 k3 C* Q
end0 i- m/ V" a/ i# k8 @1 ~0 b E
end& V/ ?" f0 `+ q- p1 @, x7 V
) G' H k! P' r. F- y) K: { H
begin P_pick2 arriving$ G; Z. e* k J" S
set A_i to 11
7 p' F6 r) a; l ?, D move into Q_induct2
& Y% h4 g! a m! N7 d$ q0 v$ @ move into pickaisle.induct27 Q& {: G9 [2 m9 @/ w
while A_i<=30 do begin
# L8 R- e# m* P, Y travel to pickaisle.con(A_i)6 B4 |% a$ s$ I" t0 L1 n* m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 K; d! I4 f) g; I, I( D: A
else wait for 10 sec7 o C! ~+ }( L: i% W
if A_i=A_leave then send to die
6 T3 I" b+ P$ O4 k7 d/ r else inc A_i by 17 |& u& [; A. Y1 }6 G( w1 K$ x) D
end* R; v9 I: Z" g6 w& C
end
( G$ h8 g8 F! v0 T# q% O
5 y$ P8 `8 n2 J, B. Mbegin P_pick3 arriving
/ c- I$ W1 F. {% {- b set A_i to 21- v6 S5 H* x1 q2 }, i. I1 u
move into Q_induct34 ?4 }# D- x0 R2 m
move into pickaisle.induct3
; R6 k8 j8 W, [" D% I: J# ? while A_i<=30 do begin
3 t6 `, @" \/ j& j travel to pickaisle.con(A_i)
, o; k/ w- {$ d- f3 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- M5 Q$ h# f! `& A- v
else wait for 10 sec$ V6 F# P' b$ L6 o) f" S) D- k v
if A_i=A_leave then send to die
# r: y' j( D& z% i# a, c else inc A_i by 1& B5 C! v9 {# W( A4 r" m2 @
end
: S0 S4 D' G. v0 r% 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,其它按你的 ...
|