|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( ]4 a/ s' g* W5 x+ s; g1 F
1 D' v# l+ `! F* f3 b+ L( i我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 Z9 h% a3 u6 q$ J! S3 s
& j& r7 v2 T# _3 Qbegin P_read arriving' @: F' L5 Y* z2 `) Y, `1 m. J
while 1=1 do begin# s6 q- a: x3 B L$ [
read A_tote from "data.txt" with delimiter "\n"
' P! Z3 Z. @# N! k read A_time from "data.txt" with delimiter "\n"
+ e. A" W! I3 Q& Y! w& \1 H read A_leave from "data.txt" with delimiter "\n"
' n/ g4 w2 q8 ?. Z$ y+ d read A_picks from "data.txt" with delimiter "\n"
2 s! s; B: G/ \& d: ]6 P% ] set load type to A_tote2 q- z2 C1 \- s4 s: e
if A_tote="tote 1" then set A_induct to 1
u2 f7 p& c% s h0 t3 U else if A_tote="tote 2" then set A_induct to 2" j* s. Z I( h: c- x5 f( h
else set A_induct to 3 8 d% h! S# M- c! [- T
set A_i to 08 c w- d- ? f0 T( ?
clone 1 load to P_induction! N: U5 m5 X1 {$ S
wait for A_time sec) r7 f# z# q3 t: F, e
end8 f0 f W! X" n: O
end' X+ {! i, w5 ]3 p- U4 }: c& g
. l- X0 R5 h; r6 l
begin P_induction arriving
+ P, C2 N/ I/ I if A_induct=1 then clone 1 load to P_pick1
- M; o- t T! D/ y else if A_induct=2 then clone 1 load to P_pick29 l1 N3 j% Y- m8 B0 g' X% T
else clone 1 load to P_pick3 K9 ^0 f9 y7 u& o" E: {
end
( H6 X. @2 R& n0 Q- w& R
: y) Q+ q0 D. a' {' V+ dbegin P_pick1 arriving. T; b5 P: P6 \2 O1 r) _
set A_i to 1
$ m7 e, R/ [2 s# _" d move into Q_induct1
' }) Q3 g& X# z2 N+ Q6 I move into pickaisle.induct18 a3 q/ n& z& W( @9 p2 u5 M0 ?
while A_i<=30 do begin) Y1 D3 x) i/ s: }5 I$ W4 A, n
travel to pickaisle.con(A_i)2 m* s' s: i6 K2 ~/ a! N) a- ]. E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 a, n* F1 Q& m
else wait for 10 sec) i5 V7 {" Q" y8 u( b, m
if A_i=A_leave then send to die0 V k( m% Z% a4 h- i k- I$ S& S
else inc A_i by 1
$ H! I# V( y& k end
3 G7 _5 \6 o1 Yend
/ B# y1 W, D' D7 x! t! s0 {. Q- C( a( \( E9 P3 x5 z6 q9 o4 ]
begin P_pick2 arriving
3 j6 A6 W5 }, @' T% m. q set A_i to 11
+ t" B4 x* b- b+ S. N+ b move into Q_induct2
) ?! i3 o; G9 z move into pickaisle.induct2
- v- g& a7 D' M0 ?6 Z# ^ while A_i<=30 do begin
( ]5 \7 t0 v* A travel to pickaisle.con(A_i)
- P L# H* w3 R5 g, r, w u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 |3 P* h" g( R; c3 E1 L2 A5 d
else wait for 10 sec
7 R- y3 B+ x/ l; o4 v if A_i=A_leave then send to die
3 G9 y" M; F8 \% x* I) O else inc A_i by 1
. o- j1 W' E) g2 @+ U end
! [" i2 b, E2 l2 z6 H4 k0 m" jend" D. P/ I+ s$ R T% g8 O
/ D8 ~4 P& L' R1 w4 Abegin P_pick3 arriving6 `5 x, [$ Q# }: B) n, r9 o9 {, w
set A_i to 21
9 N' Y, T$ J* u% }5 U move into Q_induct3: ^ g6 q1 X! W9 D% U
move into pickaisle.induct3+ }! m, @" h* `$ c! |6 e
while A_i<=30 do begin
4 a6 M' T, H Y& H* B: n7 Y travel to pickaisle.con(A_i)
# b+ w. O$ ?; X* B+ d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 k4 e0 A' u2 ^/ A% m
else wait for 10 sec" u$ c; ^! a. A, `2 ^# l3 k
if A_i=A_leave then send to die3 b4 p% f- H {* {" ]
else inc A_i by 1
+ y" h" }' G& [4 L. p1 j0 o end% k) `0 B! _3 w+ V) m, C
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,其它按你的 ...
|