|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* L9 x) P# a$ z |5 v
/ |( F1 |. t/ W7 y0 `- H1 h/ \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' v; v$ ^) M5 M7 o! x: e& \+ |9 x2 \( i' u6 ^8 |
begin P_read arriving
# ]3 U+ H, W, R9 t while 1=1 do begin
, ?8 a6 x. }2 O$ E read A_tote from "data.txt" with delimiter "\n"$ J& J: Q- ?: f$ E# j, w' P& d
read A_time from "data.txt" with delimiter "\n"
3 A8 J/ E' Z% o: k# |0 C0 } read A_leave from "data.txt" with delimiter "\n"
|: D, l4 n* J6 h& o7 ~ read A_picks from "data.txt" with delimiter "\n"
+ S+ s# X& z; E, Z4 S% d set load type to A_tote
/ B( p! Z1 r, e& n9 Q0 l if A_tote="tote 1" then set A_induct to 1# k+ h Z8 g/ E v
else if A_tote="tote 2" then set A_induct to 2
" k: Z! m# ]2 Y) G4 y else set A_induct to 3 p6 A/ U& o9 p/ b- f2 C
set A_i to 0
0 z" O7 y/ |" z( b clone 1 load to P_induction+ H. x8 ?8 q" Q8 s* v* l. `
wait for A_time sec; x0 ^: Z+ H! J) O4 f
end
3 M) r! o! ^ z2 l0 N4 Dend
2 `0 v N: v3 O. V& I
9 k X. C% u; C% L; U0 Mbegin P_induction arriving+ Y6 g$ |, ~/ v
if A_induct=1 then clone 1 load to P_pick11 P y3 Z6 Z9 O1 w1 N' R, I# `
else if A_induct=2 then clone 1 load to P_pick24 D( O& ^3 n1 z
else clone 1 load to P_pick34 a' e& b X8 X3 x# K2 Y- L
end8 L" J: ]% @, u/ ?( a1 m
0 f, p% c \3 r2 L" n0 x Xbegin P_pick1 arriving0 K7 T/ E2 L7 m% }- t3 Q
set A_i to 1# H: S+ M7 |5 e
move into Q_induct14 H7 h: Z0 ^/ Q6 }9 L
move into pickaisle.induct1/ W% B. W# P l3 d
while A_i<=30 do begin
0 T% U7 [- K" ]$ F0 B0 | travel to pickaisle.con(A_i)& m/ r e. x; D# D: o' b9 [7 C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 Y; a! l: ]8 C, a$ _ else wait for 10 sec
6 G, [8 N3 K W: y/ P; p7 | if A_i=A_leave then send to die
" Z! N1 j8 q7 U3 Y. q else inc A_i by 1
2 a# Z* N2 ]% s& y& x6 u end
. Z' y; X4 C# d$ hend
, O5 V8 b8 }. M+ T
; P& d6 s5 L# |& u: V5 f0 ~7 cbegin P_pick2 arriving( a( l+ W9 P8 j( |: s
set A_i to 11
0 _( z' f9 S) T8 _; ` move into Q_induct26 c2 |/ s/ v' G. Z5 h+ o# W
move into pickaisle.induct27 |8 r: E; R' {& V2 r% `% F, g
while A_i<=30 do begin4 {) v2 L w/ X. I
travel to pickaisle.con(A_i)2 H, F# i! h$ Q4 O2 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ P* a! r& C; }/ Z4 C" x7 K
else wait for 10 sec
; Q; v; s- K) ]: B- P. N4 e4 c" H& V5 d if A_i=A_leave then send to die
, }- N4 C: o( H+ }( i else inc A_i by 13 S+ }+ m, W* m* Q- B+ h$ ~
end
+ F+ h2 ^/ k1 `# `end
4 W K, W0 Y3 K* D
0 ^+ P% U2 u) d! ?5 [% Vbegin P_pick3 arriving. x+ C5 n9 n! Y$ s9 E" ]2 r5 ]
set A_i to 21
7 H) b+ M4 k( G; n/ r3 C move into Q_induct3
% d# u; \$ i, U' A( b9 r/ h move into pickaisle.induct3
/ J% D4 r, ^2 x; E( c, D" N while A_i<=30 do begin
& l8 V o4 ^, D7 l. e7 `2 v0 J: l6 E travel to pickaisle.con(A_i)
+ i+ V8 z- o8 f' t& t' ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 Z7 t. R! O2 {$ Q' q else wait for 10 sec
) W) q: r8 S! d. B; Z; t if A_i=A_leave then send to die3 _' ~+ c' c- m& K
else inc A_i by 11 `1 t6 Q4 S; ~0 p. z
end
% A* \ R3 |# k4 h; D- s- Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|