|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, w# O, j& z0 F, Y( s1 ]8 n1 V4 ?7 T5 x o4 |7 j( S0 z1 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中的数值,不知道会不会有什么不妥。9 S1 t& h7 B% R- J" M
, \5 I7 ~2 t/ Gbegin P_read arriving* s5 R2 ~. y) X: y$ ^4 h
while 1=1 do begin) o3 X7 t' A0 ]& P7 G0 N+ u
read A_tote from "data.txt" with delimiter "\n"
+ j1 H' h" G3 j% G; S- ~6 E" b read A_time from "data.txt" with delimiter "\n"7 _; X1 y, R1 U1 I3 P' f8 {* y
read A_leave from "data.txt" with delimiter "\n" W, j( ~2 e0 p" Y B' r
read A_picks from "data.txt" with delimiter "\n"
1 Y! V# ~3 o8 @ K, o% J/ ^: j set load type to A_tote
+ M2 x7 v0 s, |8 s1 j" }8 P if A_tote="tote 1" then set A_induct to 1
. T0 l6 W# `- o7 c7 Z( S) K else if A_tote="tote 2" then set A_induct to 2
: X3 ^1 u) r# k% @ else set A_induct to 3 8 H' g9 h! Q& I! h' `& y* {
set A_i to 0: a5 \4 b# ~3 H) X; z3 d! I
clone 1 load to P_induction
- B! n+ w" O8 ]3 q! ^ wait for A_time sec- \; Y3 w6 V, h- S C( ^( }5 z- N) Y
end
+ e& L8 j) a, U1 y& Send, K/ r/ E" n! D* o# r
8 ?# a( n' Q* k6 v
begin P_induction arriving+ y( R0 c: h" ~0 e5 u0 h
if A_induct=1 then clone 1 load to P_pick1. R6 o8 d1 t- k. y
else if A_induct=2 then clone 1 load to P_pick28 C% n7 W Q, {. B5 d5 ^
else clone 1 load to P_pick39 c0 c! N' _2 }- }, G" D7 V% z
end
, D+ t9 a! I, P, r# b$ S" `
* D$ }1 T! ]: Z# d( i, Ubegin P_pick1 arriving
& A" F3 |! @3 z* |) [4 W- [ set A_i to 1; {6 U* ]5 t' u' \) L* `
move into Q_induct1
# L) o5 V7 u3 u move into pickaisle.induct1
5 U3 X, A6 y( n- E while A_i<=30 do begin
+ P" v- a' U& S5 w4 { travel to pickaisle.con(A_i); `) T# N1 @7 V+ c7 p w* r5 c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: t4 ]1 a/ d9 [" J {
else wait for 10 sec
9 E" \' `# F3 a2 E if A_i=A_leave then send to die7 h7 g+ I4 k6 @6 Z$ g4 d; d3 Q
else inc A_i by 10 L3 K+ \# H, o( c
end
& d! I& ]9 \+ u) W( f8 aend2 S1 N$ s/ W( g- R d
6 S* S; e, K& a2 `( f0 j& K& W0 R
begin P_pick2 arriving
& O5 N2 o+ c, I& p& ~) ?- n set A_i to 11. r% ?: a. o+ r
move into Q_induct2 `- u. w7 v" w1 z4 A& c1 B
move into pickaisle.induct2
+ j- G, x3 w2 o/ T0 L while A_i<=30 do begin7 G2 R* x3 h* P7 \. o8 M
travel to pickaisle.con(A_i)' Z$ n+ g2 M. p+ [1 P) e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 ^4 n2 s; e0 O1 ` else wait for 10 sec& T! J a( C/ ~4 v% e; P/ L: @* J
if A_i=A_leave then send to die
- {# ?5 \( v8 D4 E4 a/ x else inc A_i by 1
5 E& ~0 {9 a% ^2 u* p8 d1 e end
5 @* e7 d0 O% A Qend
1 g" o# Q' ^, l, P, `! ^/ I0 Z# F/ j. ^ T; d( t4 j- t
begin P_pick3 arriving$ W* Z. y/ [: Y& W2 Y: q
set A_i to 21
( L/ k$ t" I: f* q& O move into Q_induct3 E7 ~* I% O0 n0 {2 n( ^5 f
move into pickaisle.induct39 U" g5 S2 s* L* `' D
while A_i<=30 do begin
4 y2 A C3 C. [ travel to pickaisle.con(A_i)
+ a& I W9 \( \$ Z& j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 R- @) A: m' C7 \& x+ m1 u
else wait for 10 sec3 x+ l( Q! d9 G! f! J) n
if A_i=A_leave then send to die
, b( d- k" v) W: c else inc A_i by 10 ^) K! F8 ?0 s3 i/ W2 I% Q
end. e I' L1 s; K; n/ r
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,其它按你的 ...
|