|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ r$ b& F4 u5 z# G9 ~
: c& Q$ Q0 `1 I% _$ V) k" r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( e, ]" T; ], j. w& a! d- j
4 r$ @4 J6 p/ H; ]begin P_read arriving
; G2 t9 e. v$ d5 d while 1=1 do begin* ^3 u- Q7 {/ E. V0 Y. x
read A_tote from "data.txt" with delimiter "\n"2 R( o' A! t* p- G! k% b, f
read A_time from "data.txt" with delimiter "\n"
" ^6 N2 f) k- ?* ? read A_leave from "data.txt" with delimiter "\n"+ ~8 {$ o l. `9 _; I/ x4 @
read A_picks from "data.txt" with delimiter "\n"" l- W9 K* W1 \5 [" u8 _, z
set load type to A_tote
1 t1 o& Z- f% ]; a; V if A_tote="tote 1" then set A_induct to 1( i* s& \6 O$ ?; y$ m
else if A_tote="tote 2" then set A_induct to 2
/ W. I/ Y0 Q" \* _. Y0 @0 n else set A_induct to 3 " m( q( {$ @: m% @/ W1 F' o
set A_i to 0
7 X$ \. J0 U9 z0 I$ Q clone 1 load to P_induction$ w& v1 |9 X5 `- i; _
wait for A_time sec
0 L) W0 M ]+ m' R) ?8 c+ m+ W end, E( S- K2 f+ B6 b3 q V
end
% a, U+ a- R, B: x; X5 l _, Y0 e. X, `+ N' c' w9 Z6 [
begin P_induction arriving
# E0 }* B; q0 T$ h& F% F if A_induct=1 then clone 1 load to P_pick1
0 S% V6 r4 C( z! ?9 \ else if A_induct=2 then clone 1 load to P_pick2; z4 v! x; ?) M- L2 _
else clone 1 load to P_pick3+ ~8 I1 F# O4 ?: w0 u
end
- n' k7 C; h0 i1 g1 u4 b) s5 K! K4 l3 ~1 @6 @! i1 c* }
begin P_pick1 arriving
0 C4 A0 I' P; V) [5 X% R2 c set A_i to 17 W6 p$ e' \9 i) Z
move into Q_induct1
8 O5 I: j1 f2 d. M V move into pickaisle.induct1
+ C* n! e2 o% J$ w. ?. P w$ R while A_i<=30 do begin
! t- w9 u( j: h% f7 W" ] travel to pickaisle.con(A_i)
. N: f* z7 l8 ]+ G. r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! M! a S$ ~5 r
else wait for 10 sec7 x/ o+ q! j9 u' a& O2 G- W* z
if A_i=A_leave then send to die
6 h- @: I3 d; E! j, v else inc A_i by 1
+ o% E y+ ?6 D$ ?, q& X end
: r% N9 T7 t, `4 }* [end
; `! M# [$ J* V( @$ N7 I% \ s
" f$ W: \8 ^2 t) m( D$ Sbegin P_pick2 arriving
: E! B; R, {& C7 s set A_i to 11" u9 U' M5 w3 U+ u
move into Q_induct2& r8 a. S$ C! u
move into pickaisle.induct2, ~" T4 R6 K/ i& E+ K9 d
while A_i<=30 do begin m* z- D4 |) F) t
travel to pickaisle.con(A_i)( n) w. y$ ^( I1 H/ W) e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# E" r- [6 I5 M0 @& N
else wait for 10 sec
* `1 Y+ |1 E7 a& x8 Q) E/ ] if A_i=A_leave then send to die
8 o; q4 U8 Y: J& i6 {8 q else inc A_i by 1
' V8 H, B( \9 r# f( ~ end
4 o4 O O8 A, } Zend4 ^0 s0 p( c6 r- f1 C, P
2 P6 T2 B% R/ q$ b B' a
begin P_pick3 arriving
P) v% u; {( l set A_i to 21
3 T2 i8 f$ A: G" K! s5 M! j' i6 e% q& q5 K move into Q_induct3
1 k( D, ]* n. r. G- G+ R move into pickaisle.induct3
. P" c$ I1 j# m& T4 r4 b$ F5 E while A_i<=30 do begin
7 d* R$ P& ^# A1 `- x travel to pickaisle.con(A_i)
; z9 M t; C6 m0 p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ f, M7 D7 O+ R. g" m, G9 q( a
else wait for 10 sec* U P# a3 m/ \, F/ J( ]
if A_i=A_leave then send to die) h4 [: z8 T! W' O
else inc A_i by 1. k: z- f* C; A, r; I
end
$ D7 c; K9 c' @4 u2 G9 w |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,其它按你的 ...
|