|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ t6 k+ N! i- Q( I2 g) o% m
: D9 D. c5 A/ _" G4 u: 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中的数值,不知道会不会有什么不妥。; @7 _8 c9 ], o
* B' L) O' Z9 K. }
begin P_read arriving4 p1 b8 a: Z- f' C6 E# i8 V
while 1=1 do begin
, k9 P+ k) S' E" r' D8 w read A_tote from "data.txt" with delimiter "\n"2 O4 [8 c0 L' R& b
read A_time from "data.txt" with delimiter "\n"
% \8 N; Z/ |7 @ read A_leave from "data.txt" with delimiter "\n"5 i: T* o0 f2 d6 [
read A_picks from "data.txt" with delimiter "\n"
! H' F+ s1 V# g! @6 y set load type to A_tote. w3 f2 G5 P; x z' I& ]1 d% s
if A_tote="tote 1" then set A_induct to 1
v! \5 E7 {" R else if A_tote="tote 2" then set A_induct to 2
5 Y$ x \4 G5 \7 ~/ c else set A_induct to 3
' E- ], a( Y7 X9 ~9 [ set A_i to 06 M& ^/ v5 v( ~
clone 1 load to P_induction5 W! y4 e/ [: o% H6 X7 I; c( o
wait for A_time sec
l. H! V0 T3 Q% o( f9 Q end' K) w" A- T. Z0 P
end$ G; G/ r5 j4 {! F
6 D7 }4 r) J4 N7 X& A; }' |
begin P_induction arriving
8 u) @9 F9 v: o+ ^2 L if A_induct=1 then clone 1 load to P_pick1
; |, u& r4 F. I0 M6 W9 z* `: d, _ else if A_induct=2 then clone 1 load to P_pick26 o% {2 F' U( T- J3 e
else clone 1 load to P_pick39 f' D. z6 h7 w& r& L
end' a2 \0 J* Q" U3 N! ~
1 D- L Y& I/ t/ dbegin P_pick1 arriving3 s, B! ~$ P M; G: _3 y8 L
set A_i to 12 n" ~, l0 c. L l' F9 K6 \: G: q
move into Q_induct17 b2 m' A' A3 N; ]/ R: x
move into pickaisle.induct1
; [% \8 l0 M4 A" Z6 E' W, X8 G while A_i<=30 do begin
+ e( K* a) k$ _4 {2 |. r travel to pickaisle.con(A_i)
, c" _. Q& o) H; J! a) p4 E+ c# n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ e' Z. s E% k$ ^1 |& f else wait for 10 sec! Y }5 s0 Q: F: }& Z
if A_i=A_leave then send to die
. U" b1 W& `& n2 W! B1 O else inc A_i by 1
0 Q1 A. `, h' u/ J, l: n end1 Z; m0 A& M& C$ [9 E- P" s& J
end5 A5 K2 C4 K2 a0 B2 `
* g$ V: W# @! V1 e/ \: v+ vbegin P_pick2 arriving" M, L- d. T& \6 ~; M% B
set A_i to 11
0 ?- F# t, J& u4 W* M move into Q_induct2% [: _( q. f7 v$ V9 N
move into pickaisle.induct2
3 q+ g* }) p& o9 g7 X% F* t while A_i<=30 do begin( W+ [6 L, o7 }5 B) H
travel to pickaisle.con(A_i)( Q! D$ i; D% x2 R4 l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
_5 {. R' m& v( k) ` else wait for 10 sec( X" r/ K; |3 m# x' n+ a
if A_i=A_leave then send to die5 _4 w O. J% V4 a
else inc A_i by 1* g* L; Q- {5 _0 ], x( M
end0 n& T* ~; e4 C% h2 G
end
* F# _8 f1 o3 Y& Z5 E. b: b0 {& }! A( [5 f7 c
begin P_pick3 arriving. J# c, e: m+ U% h0 F3 }: `- M1 \1 @
set A_i to 21( C% u9 j2 l4 h0 O
move into Q_induct3
1 e: O8 I5 w! t move into pickaisle.induct3
}8 e% |- h# w* Q$ C while A_i<=30 do begin# ~$ a' |2 O0 v: ?
travel to pickaisle.con(A_i)
7 S$ { M" ^( L. g4 D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" G1 j0 H5 v- U- Y
else wait for 10 sec3 @, ~7 ^$ X3 H8 _1 T9 |( y9 _' H
if A_i=A_leave then send to die1 M- x' ~# W- N2 D/ y0 A4 @& j
else inc A_i by 13 R! o) z8 u2 F% _
end& s8 d* i# S! s, Z3 ~: D) T, H& D" M
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,其它按你的 ...
|