|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' }9 ~, D( S0 l% _ t9 k: C
5 i1 I7 m- c o7 D9 ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, x A1 `; W. o9 X* p \9 G8 w& H$ A Y7 c
begin P_read arriving
3 V$ k5 B6 Y6 N& ~ while 1=1 do begin
1 f" x4 _9 ~: A5 b6 Y- ` read A_tote from "data.txt" with delimiter "\n"
/ v0 _9 {. Q& }; _$ O read A_time from "data.txt" with delimiter "\n"
6 j5 X: H: C1 n- Y! s5 A6 O read A_leave from "data.txt" with delimiter "\n"
" c: ?" A) s# y0 e: ` N. ] read A_picks from "data.txt" with delimiter "\n", ]# V. N) G2 b+ _' n0 U, J" f8 T
set load type to A_tote: ?+ ]4 S6 x8 G' S
if A_tote="tote 1" then set A_induct to 1
& e5 U1 ?2 b8 f; K" ]2 R else if A_tote="tote 2" then set A_induct to 2, _/ F" F, F; N& ~! M
else set A_induct to 3
1 i7 z4 P T' H set A_i to 0
' \ J5 Z8 b1 m clone 1 load to P_induction
; g5 e. A7 y5 N G& E: \- d8 a! D wait for A_time sec
+ \! v! o* @+ u$ N% n' l4 o% c end
7 L. J9 ~# ~( eend
0 B, C3 c1 U& n3 _' p
( h' [2 S' E* {5 ^* Lbegin P_induction arriving
* _* Z$ a8 L, D! R& t! Q! ^ if A_induct=1 then clone 1 load to P_pick1, Y1 g' O' q: ~- Z7 x. F
else if A_induct=2 then clone 1 load to P_pick2
% W: W, C4 g; Y: r else clone 1 load to P_pick3
0 U. H2 k! Y1 X. M( }end9 p7 m5 u5 P7 x; X
/ b6 G( Z3 p" ~( O5 Z+ z$ y
begin P_pick1 arriving
, }1 Q% C& u7 {1 ^: A set A_i to 1. Z0 S6 J/ _- J
move into Q_induct1% c5 s& e) W( s# Q& [6 B6 Z
move into pickaisle.induct1
z4 \/ e+ Z D% N while A_i<=30 do begin
7 y/ B4 V) l$ C5 P8 F7 s% l travel to pickaisle.con(A_i)4 M! n' ]9 u1 r5 J6 ^( Y0 k7 k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* p4 ]8 e( J$ g; {+ A& R else wait for 10 sec6 x+ k* \2 R& s& \' y: n
if A_i=A_leave then send to die g4 ~! L; a3 @- f5 y4 o+ ~
else inc A_i by 11 ?# `, k, L# ?. |. V
end& s0 _0 j' L5 X2 j8 r5 ?. f; H
end
6 @6 _8 ]" [; { N# D- |' u4 i9 M& C) o2 b# h7 }, b
begin P_pick2 arriving
( }4 m4 B8 u, c' C: m# O set A_i to 11+ T: k G# f4 y9 e m- q& {
move into Q_induct2
$ N. z* ?* r# l. u O2 Y move into pickaisle.induct2
' o( k' \- o, W6 k while A_i<=30 do begin
0 R! c! V) {5 ^5 c9 q: m travel to pickaisle.con(A_i)
- t5 e! }3 C! z# l. }! A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 c- }- U, l& p7 R1 d
else wait for 10 sec
! u E- {5 T7 j* E- b if A_i=A_leave then send to die
5 H7 V' Z+ G+ s$ u8 G& \ else inc A_i by 1
! M2 J2 o1 |3 A& I" y- o/ r end/ z. L2 i1 d6 M$ ~, R
end
K% w. y8 A3 H$ `$ Q. t) K- K: }, o F
begin P_pick3 arriving4 _0 ]4 {$ b y5 b2 L! h
set A_i to 21
, y4 |% ?% N8 T& s' u7 D move into Q_induct3
; `4 p, X+ a, M- i move into pickaisle.induct3& ^0 ^3 H% N: H* k% y
while A_i<=30 do begin6 N% \. q! s. V7 w
travel to pickaisle.con(A_i)7 H/ Q1 [+ w2 N$ M! I( F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 M6 [ W; U z5 w; F) [$ U6 z! O
else wait for 10 sec
) f4 [; k1 k* t if A_i=A_leave then send to die
* b% c F+ E# i: B6 p4 h. h else inc A_i by 1; E P9 y3 P4 X. X/ y! N* M
end; Z. e/ I9 e; q( \; t
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,其它按你的 ...
|