|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( e. K& N/ e+ {- O2 E" Y3 H$ W4 ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 O- }! |! t8 M0 }
# t. G% v, o" E( [begin P_read arriving: t' {* B) T0 Q
while 1=1 do begin
' T% Y4 A+ k7 n$ T/ Y# M9 Y4 f read A_tote from "data.txt" with delimiter "\n"0 ?& w6 M. P0 V+ ~7 Y& H( O
read A_time from "data.txt" with delimiter "\n", Q# O/ T: _% M" M- E7 z% q" U
read A_leave from "data.txt" with delimiter "\n"! q' e: Q& K& a; C
read A_picks from "data.txt" with delimiter "\n"
+ F! n' V9 v7 h* x# x set load type to A_tote
( U/ u9 v. u( ]# K, c) ~% W if A_tote="tote 1" then set A_induct to 1
& Z- o# S- f9 \7 Z9 L: f j else if A_tote="tote 2" then set A_induct to 2
& d3 A7 l& o$ |; O else set A_induct to 3
% T4 n- S- z% K( U% C9 B) w6 X set A_i to 0
( A! V, p% X) e clone 1 load to P_induction8 b* n0 F' ?9 Z- t2 ?% M! d0 P Q+ o
wait for A_time sec4 X" V: z5 x1 U( O
end! y' P/ |% h" ?' d) {2 \- h
end
0 j2 F0 \" y6 X! ?. M/ y- n% i0 s0 l. _7 d0 v- ?0 _2 P
begin P_induction arriving% ?9 k: C# M; Y: B
if A_induct=1 then clone 1 load to P_pick1
2 ^# J6 H$ j2 [+ x4 _' Q8 ~4 B else if A_induct=2 then clone 1 load to P_pick2
' {2 M. ^/ W) F6 H! a/ d9 e+ H else clone 1 load to P_pick3
' {$ Z$ c# @1 {+ Mend
& Z5 p% w/ b* \0 o* J+ s' }/ A8 `+ Q$ k
begin P_pick1 arriving
" s( |, L5 c3 Z9 V' W. r set A_i to 1" M1 X# X. o* O
move into Q_induct1# n1 ~4 H4 S& u$ m, E
move into pickaisle.induct1
# H R7 A4 b& ~6 G while A_i<=30 do begin
0 G$ z) ]' f& R% E d; n2 w travel to pickaisle.con(A_i)" g$ n ~. ^1 u7 X5 Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 o. D" L0 C- h6 j' d; y else wait for 10 sec
& X. v, s( t2 }& Z' L0 }4 K8 D. f if A_i=A_leave then send to die
4 e0 ?1 i. T- H; m# P6 f, b+ E else inc A_i by 15 e( m' A) ]$ v# E
end. ~0 v! [( `, m& V; b9 a, q( r# a
end' A3 F0 ^# m8 S& n* j
1 j, M9 r* q; `' _begin P_pick2 arriving" o; j N8 a" Q: A. C7 `6 R
set A_i to 11/ F2 a5 }! w2 A! a. t0 o, N
move into Q_induct21 A+ r& H N, V2 J5 o- ]
move into pickaisle.induct2
* l( c1 n# t7 y/ W( `6 d while A_i<=30 do begin
1 G8 f7 R& S4 r( y9 ]( A travel to pickaisle.con(A_i)
+ O3 B2 A1 ]# [6 F8 V$ z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, y% ^, S5 R" Y. g& q4 o else wait for 10 sec
: W% ^& Y, {2 S6 n0 ^; { if A_i=A_leave then send to die5 K6 _2 t3 K* l1 x b
else inc A_i by 1
8 ?+ F6 a1 z( D) O end
7 P. V; P9 S+ Q) j& b1 T6 Eend
% `1 c, p. t" g7 _: E% \. I7 ?+ d' i
begin P_pick3 arriving
8 {7 _% v; i0 g( @- n set A_i to 21
1 D! w1 G# Q! Y/ ~- i move into Q_induct3
D- f8 s" T0 @1 l2 Q f move into pickaisle.induct3+ z2 q* G2 i. c5 @/ R- X' R5 {- T1 g/ S
while A_i<=30 do begin6 |; v; b# i; R0 ^6 r
travel to pickaisle.con(A_i)6 Y% ^2 N0 Y: a9 W5 J, c/ Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 P( a( Z2 i: ? else wait for 10 sec
# O, C1 x! K7 _( x; ? if A_i=A_leave then send to die
2 \! ?4 Y8 L1 x B7 z! h/ D) E- r else inc A_i by 1+ n2 A! z+ Y& t
end+ @ n4 G" x( @ s, z3 x
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,其它按你的 ...
|