|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ A* x9 d6 {5 ?) E) D/ {% { P0 f
2 A. \& K( {2 e1 p$ d我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 l+ R! ~ ^3 B! w) b
1 M! I- \9 ]+ Z/ C7 I) n" Gbegin P_read arriving `! h" h5 a3 f" L5 D9 o
while 1=1 do begin" ~0 I3 w3 D/ D5 a! s0 |
read A_tote from "data.txt" with delimiter "\n") h; R" S; _0 v0 L4 ?* a
read A_time from "data.txt" with delimiter "\n"
. o% Z7 V7 G, Q! r read A_leave from "data.txt" with delimiter "\n"9 l, S- [ J* P3 B% k; K
read A_picks from "data.txt" with delimiter "\n"
2 Q: C/ U3 A9 t7 l2 y* G0 Q set load type to A_tote
0 s$ ]' _' f" Z# m6 K! f if A_tote="tote 1" then set A_induct to 19 [' z" p% \' Y- L
else if A_tote="tote 2" then set A_induct to 2: {! Y" E: Q! l. C
else set A_induct to 3
+ Q( J0 U4 v. N6 E5 a set A_i to 0
5 u& g1 x9 T& C: R) y0 q clone 1 load to P_induction' I. n" G! Y2 S! g
wait for A_time sec
+ W# C& J4 w* S- p% h% ? end
3 P @1 T- ^7 }end& x6 o3 P( N L, L* F- Q9 {7 l
Z3 E" b) G5 l" e" Z- X" y
begin P_induction arriving
& K: o& p3 T! B* z+ }$ \) `/ B" j if A_induct=1 then clone 1 load to P_pick1
& h6 c L' z$ L$ w. R% r: \5 ` else if A_induct=2 then clone 1 load to P_pick2
: E* P# w" Y+ {* f4 `, ]" o else clone 1 load to P_pick3, g% o5 x3 _& o
end$ i/ N8 [2 Z& A2 f4 Z
, {6 k* A/ t; U& B+ `1 Y; wbegin P_pick1 arriving
0 A4 I$ u5 b! Z: i8 B" [7 L$ w set A_i to 1) a h: R; q! t& t% I* x r
move into Q_induct1+ w; G3 [; C: a* n
move into pickaisle.induct1
# @ L' B& B1 U0 u8 j7 _ while A_i<=30 do begin/ ]5 O5 v' `0 e& p
travel to pickaisle.con(A_i)4 ]6 r) s9 L c0 s& g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! N0 p# L* x# o- f else wait for 10 sec3 i- D: {) E6 Z7 _ d. n. o
if A_i=A_leave then send to die9 h: G. t2 B& q. w% e3 I8 h
else inc A_i by 1( u9 b( v- H! M
end
' Z; a- {5 R" p6 G( g4 @$ dend
& p5 L1 s" L$ m1 q
! G' j; ?* m" F8 ^& |+ Xbegin P_pick2 arriving
+ Y! C8 P8 R9 K* o/ a5 b set A_i to 11/ Q6 n$ X4 B2 v9 v2 {5 x0 G
move into Q_induct2
; I; z( I3 R# C/ u! a8 e& ~ move into pickaisle.induct27 y! r- L. Z- V; I
while A_i<=30 do begin
! ]# _$ F9 }& C4 v# Y) D! Z/ Q travel to pickaisle.con(A_i)
1 j1 F- D Q* J, r1 ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" ]' J- H8 ]* ] g. | else wait for 10 sec9 b$ [% P0 i; a. r
if A_i=A_leave then send to die6 ~6 H# o2 A6 x2 U$ u* j& E- G
else inc A_i by 1
9 [3 x; T C( y8 Q0 X end
: f# \ K9 Z7 W- \end% Z9 Y9 s* W7 ~# T- w2 L" [, J& F8 m
- [3 L7 H. v! }+ ?/ Obegin P_pick3 arriving
# |- p& H% Z0 C; { Q+ T3 i# X1 M% T set A_i to 21
6 E# i' o# T5 T! X- V move into Q_induct3
* T$ E/ ^3 A. v8 C. D$ f( {1 ] move into pickaisle.induct3* J. d: {+ O6 l0 W5 o$ D
while A_i<=30 do begin
! q+ i0 l8 j1 `8 w: H- R travel to pickaisle.con(A_i)% b+ J5 Z" Z3 E( Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! W2 w! A9 b- U
else wait for 10 sec
/ j- d. j/ q, L0 K* J, N if A_i=A_leave then send to die! p- y7 Y8 v% f/ z' [7 ~+ i( X
else inc A_i by 1/ I' f! ]9 x+ x2 m0 e. q5 v4 Y4 L6 [
end
$ Y) k) l; Q4 ~) Y, t# W! k* n: @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,其它按你的 ...
|