|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 z" K' T! H; H: p7 w6 g: J
/ I- i: w. Z8 W3 B* k7 G% j! K- k/ S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 ]% C2 R: s& o. R) l9 c# ~
% b3 k# n( c; |0 b2 S) gbegin P_read arriving
8 z$ I& z' z+ M6 B7 q( s: y7 E0 o& v while 1=1 do begin6 B: e2 \. {' r, B: a
read A_tote from "data.txt" with delimiter "\n"
' u' R5 n( z* C1 e3 ` read A_time from "data.txt" with delimiter "\n"
, U6 g7 T2 k3 D4 p4 V0 F7 i read A_leave from "data.txt" with delimiter "\n"
% |1 H* T8 g! k4 m/ X; q# _$ W read A_picks from "data.txt" with delimiter "\n"
* {/ \+ r5 `, ]3 U; L3 m Q set load type to A_tote& [% V2 O9 b& Y% D
if A_tote="tote 1" then set A_induct to 1
. O/ S) \! X( ^ U! c else if A_tote="tote 2" then set A_induct to 24 d4 z& ~* g) Z! n
else set A_induct to 3 1 ?, n8 B* a* g7 U
set A_i to 0
! G+ W+ x, R! h1 [% L1 h clone 1 load to P_induction" V# E# i. C8 V/ {% N1 d
wait for A_time sec7 b2 Y) U* O! i8 P+ \2 A
end
' i1 S6 p5 H$ @) W3 F5 Qend
g4 [- p7 L% W8 Q" g, A
7 A) C- G: T/ i9 [3 M" [- [1 }+ Nbegin P_induction arriving
4 Z" A) c0 _! w" e if A_induct=1 then clone 1 load to P_pick13 r% r6 [4 |$ ~
else if A_induct=2 then clone 1 load to P_pick2
8 M# H3 K8 f/ I# o) O$ g4 K. r else clone 1 load to P_pick3( v1 k# R% }3 U' n
end" d( X: x) c9 k* D: Q. D" ?* X
$ [0 L7 |5 L0 z2 i, n
begin P_pick1 arriving
: ? A$ d$ z" T k: V; i* e% Z set A_i to 1
) o0 E: l7 t% J move into Q_induct1
" t, i p8 C. R! \# W9 _ move into pickaisle.induct19 k6 \$ h7 b0 a
while A_i<=30 do begin7 [! n L! u9 H
travel to pickaisle.con(A_i)
; ?: c6 Q: {. c; V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' Q$ R. P( l9 i, ^2 e
else wait for 10 sec
+ {% C# f$ ~: B7 [ m% M if A_i=A_leave then send to die
[. p2 _( q) x6 ^ else inc A_i by 1
4 }- h! ?4 n- g* c/ S end4 I8 f( x8 _+ `/ l+ J6 i
end, N+ X+ b3 J2 _) a9 ~ `% S; d5 n
; K) R/ L+ G) Q0 u5 N& ?
begin P_pick2 arriving
0 x- k6 E* v9 R7 y- d" _: X set A_i to 117 g6 u3 |: E! N( ~3 e! J, N- Y) A
move into Q_induct22 B4 [1 T' j; _+ r g" t6 Y& W/ o
move into pickaisle.induct2
. v2 k2 v6 A. s( T2 \ while A_i<=30 do begin* h5 w$ G' z/ l9 D. u
travel to pickaisle.con(A_i)$ H4 o$ o5 B8 D0 f8 D0 s- p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) A3 g; u! _ y( L3 `# X+ [ else wait for 10 sec5 b2 A# E- l" ^4 r) w) a6 v
if A_i=A_leave then send to die( \3 Y! T$ {/ o
else inc A_i by 18 w: M" i% R4 k0 ~8 t
end3 t* o5 P+ v% M
end; s( M, ]% R5 ^9 Q8 E
3 k Z ]+ V( \" \4 `! K
begin P_pick3 arriving( F+ B* M8 J) U+ g2 x8 V3 y E. ~
set A_i to 21+ y# h8 }0 d2 r% x/ h1 S$ G `" G1 o; X8 z
move into Q_induct38 C9 Q& V% B- M6 o
move into pickaisle.induct3( ]; b' i4 Q3 T7 l! u
while A_i<=30 do begin' g+ v, F8 R' ?! J% t b
travel to pickaisle.con(A_i)
c/ H6 e, Q/ [5 j/ ] H9 D2 H/ g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S' U) D& q5 P
else wait for 10 sec
& E* K- \4 z; u if A_i=A_leave then send to die
$ z" e! C8 c8 U3 D else inc A_i by 1
3 L8 G. @; F' y1 |; u1 `7 { end
% d) E$ |, j. n$ x0 Qend |
最佳答案
查看完整内容
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,其它按你的 ...
|