|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. d- u8 e: n' o" [' L+ u' t5 I
0 R6 Z( Q( s" L3 t, ]. p我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 J) J' _' C S' }
# j) x9 k. S) a! H9 Nbegin P_read arriving" j- M3 A8 H, f
while 1=1 do begin/ ]. o! N" L( ~+ Z) ~
read A_tote from "data.txt" with delimiter "\n"3 C8 G: ~ c \# I5 X% {; n
read A_time from "data.txt" with delimiter "\n"3 V* B4 j1 ?! j2 a3 [7 s
read A_leave from "data.txt" with delimiter "\n"7 g2 G( ~1 p- p3 u) J$ w- E* Q( W
read A_picks from "data.txt" with delimiter "\n"
7 ]" e1 m! S( o set load type to A_tote
% G n' U' S9 G if A_tote="tote 1" then set A_induct to 1
6 L- M6 S9 P8 X. Q0 s else if A_tote="tote 2" then set A_induct to 2; N8 D" U; J5 C5 Z
else set A_induct to 3
* v% e# z$ k- J! k* ] set A_i to 0
) X; Q3 A) {; y9 M. d clone 1 load to P_induction
' q* D* S2 b; m+ h2 K: U wait for A_time sec
. `' [) p( n/ f4 G end- k3 w' R8 n4 w9 M9 Q: R2 J" s D6 y
end* o; e. A' `, z- @
2 F9 f/ R6 s) ^9 \/ g8 O3 H
begin P_induction arriving' f( z' c. h2 B& s; O; K2 X
if A_induct=1 then clone 1 load to P_pick1
) t2 ~7 U! g, W$ j; D" Y else if A_induct=2 then clone 1 load to P_pick2. J) A! _6 M c7 Y$ @3 W$ F
else clone 1 load to P_pick3
) o5 f7 [) q1 {4 P. F. Oend+ h+ P5 G! R }& g4 `/ N2 z2 T. `6 {9 o
0 J, l) x* I( g+ cbegin P_pick1 arriving5 n1 r8 P, r4 J, g+ |8 D
set A_i to 1" B$ i2 _" [' n
move into Q_induct1
) s7 b& c1 A! \- U( w move into pickaisle.induct1$ N |& `! a- g3 q s
while A_i<=30 do begin C V% f6 P4 s) S' j/ n1 D. W
travel to pickaisle.con(A_i)! b8 f D0 y$ y6 n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- g J, ]% X# l else wait for 10 sec
' ~# A! d3 b; e0 o, I! O if A_i=A_leave then send to die$ x. b: X% x3 @7 b
else inc A_i by 1# k) `& |2 n& O* k
end
1 U: `! g5 y' R# ^ A! m. @end
8 b. y. \; t1 y3 n7 G$ p5 n7 T$ R% l& f" K) q/ c- y
begin P_pick2 arriving
8 d; q3 y- W. a: y& Q& p! t6 ? set A_i to 11
. a( l3 ~$ z: t) l move into Q_induct2* @9 U) s# A9 x" G* ^$ B; r
move into pickaisle.induct2
* P y/ f& B& ~$ I while A_i<=30 do begin6 V# t+ N7 v% a- O) L* j- H
travel to pickaisle.con(A_i)
; A) a% J0 \( B# i; o& g% j9 [8 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* Y. _# u! E! F9 k! W2 ] else wait for 10 sec" B% N6 i- {6 p* f
if A_i=A_leave then send to die
. Y7 Q0 ]1 g; v. w2 y2 y. s# L else inc A_i by 1
; y0 i3 ]) \$ I8 g6 W% i end
% X! J4 g* e, C! S: Bend
0 c* f0 R# S3 {9 N6 x+ e0 a
9 p; l8 w4 Y* b5 I7 W* r: y2 vbegin P_pick3 arriving8 n3 x& L8 |' V$ E
set A_i to 21% a- V0 l9 [; a; E7 ]
move into Q_induct3
" Z3 J7 u" o& |# M# H4 `4 R6 U move into pickaisle.induct30 e# v: \; o G
while A_i<=30 do begin J- h- X( F5 m) {) }
travel to pickaisle.con(A_i)9 Y4 }8 t9 e* B2 a6 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 U# s0 P9 |. y* R# p- l
else wait for 10 sec
. G4 p5 J& `9 e% H% O: X" I if A_i=A_leave then send to die7 a* Z2 s4 f3 ^: X {
else inc A_i by 1
8 Z+ o& B0 x# j1 e* q2 F, y/ w) [4 ^ end$ S" u- W+ [/ R" H7 X
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,其它按你的 ...
|