|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' v' @( R# h. T( D9 b4 P" @
5 \0 b! ^) h& t& S# }+ s: 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中的数值,不知道会不会有什么不妥。. j7 u- u2 E, }0 y' `4 ]9 a t$ ^
6 i( j [/ I$ k) F
begin P_read arriving
7 q- Z* d( ~# ]8 V& p) T( b while 1=1 do begin( O9 V+ N' j3 r
read A_tote from "data.txt" with delimiter "\n"* T; I7 y6 z0 n. g( B6 r
read A_time from "data.txt" with delimiter "\n"# [2 x8 p7 B1 A* n! b' P
read A_leave from "data.txt" with delimiter "\n"
0 D+ e6 L' G, O0 c3 r read A_picks from "data.txt" with delimiter "\n"
* u8 K/ P( _0 q' ^* I set load type to A_tote
/ |" R( \! w( m. @) z2 V/ a if A_tote="tote 1" then set A_induct to 1
) l. v5 W# c- R else if A_tote="tote 2" then set A_induct to 2+ F! u/ Y3 N9 w% A: G3 x4 I
else set A_induct to 3
: P) Z9 {, ~0 M$ B N set A_i to 0+ @5 F# Z0 I1 C9 T
clone 1 load to P_induction' ^' c ^8 h& A
wait for A_time sec( k7 |" j/ ^8 g% _
end
$ k, A3 L- x0 o; k7 U; I0 t7 _+ ?end* k' F" Z1 q( l H
& W5 Z' Q. Q% r2 x+ j8 a; M' Gbegin P_induction arriving
) o% Q5 I9 f8 M- c" H# T if A_induct=1 then clone 1 load to P_pick1
$ e }3 ~- {$ Q, I else if A_induct=2 then clone 1 load to P_pick2
) C# n4 p7 `4 o, n' _" Z else clone 1 load to P_pick3
3 | g9 G2 k3 kend
# J5 S; D# K j- A# G* T' l$ [1 t6 J5 x. R1 ?
begin P_pick1 arriving
' [& ]2 A1 W9 p" ` set A_i to 1. G9 V& G0 i6 D- S% }
move into Q_induct1# V+ ]: V' s( f/ I6 Z, E3 {
move into pickaisle.induct1
8 O3 n$ z: P- r2 `( e2 u& ? while A_i<=30 do begin
7 T2 Q/ F4 I! L. d travel to pickaisle.con(A_i)
; ]" {" ?7 [' B( B" A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ i- m' M6 G9 J3 |& { else wait for 10 sec) _* z( R1 W' V
if A_i=A_leave then send to die
3 V* ~4 ]% i2 Z, J1 s) V else inc A_i by 10 Y! d! H1 V8 b7 L& e
end
8 H. O2 P8 A$ k7 I5 L6 ~end8 A1 n0 ?! K8 k1 m3 t& p0 b* Z$ ^+ u
+ I! d' Y5 k2 a7 P# H. @. O) [begin P_pick2 arriving3 I0 p+ P8 e( v. Z
set A_i to 11# V1 J& w* |* g: S. P
move into Q_induct2
W- @. K+ S# g% }, |- U move into pickaisle.induct2' O6 E7 S' I g" z% |% m/ C
while A_i<=30 do begin
7 Y. j" D- w. |# t4 r6 u travel to pickaisle.con(A_i)
' Z: e L+ M' M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% r! G: f' z- J. X8 b else wait for 10 sec
- a g5 l% @+ l, c: Z0 K if A_i=A_leave then send to die- t8 f6 F. r* b$ q- _
else inc A_i by 1" t+ v. S Q, t" F! @ g m8 w" U
end7 j! N: [0 \ V) V
end
# @8 N& W0 Y# j" I. K
m3 l0 \, L/ B) ] x: s; V' Kbegin P_pick3 arriving
m1 H/ z) C) q& ^" H4 `1 k" \ set A_i to 21
/ e. r! W" W/ s9 [4 C move into Q_induct3
% ^# n1 t) P, W/ s: J move into pickaisle.induct33 T/ U" H7 a9 @$ x, Q- z+ Q: ?
while A_i<=30 do begin5 A/ @3 _! W% [* o: [: B
travel to pickaisle.con(A_i)
7 _( _1 [/ q' |/ B2 O8 }2 I# [# W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% P6 z+ e @. S! T9 n
else wait for 10 sec
- `: k7 Q1 O5 D" m if A_i=A_leave then send to die
, G8 J2 x% l# g: S1 U3 Q8 { else inc A_i by 1) t6 E: o" a, q1 n) |# x9 F
end4 B! D$ V5 I+ w9 p" U: @
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,其它按你的 ...
|