|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, g( e( ?) n G$ k9 n1 C0 s s
5 ?* ^1 U! N$ e% s) I
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; w. _, \: M- `" N: U4 J" M6 V
; I* ?1 |) Q7 X3 Pbegin P_read arriving2 r l; G0 Z5 t
while 1=1 do begin
$ k. a" l0 |" c6 b7 k& d read A_tote from "data.txt" with delimiter "\n", }9 l# X$ ~+ I# Q
read A_time from "data.txt" with delimiter "\n"% b1 _6 e& J$ O( \" R9 A# G& H
read A_leave from "data.txt" with delimiter "\n"
1 C: H& ]& u; I" Y* }+ q read A_picks from "data.txt" with delimiter "\n"
7 m& K5 \2 i: k) J( X* m- D set load type to A_tote
: M) W; Q) g' S& u if A_tote="tote 1" then set A_induct to 1# L8 f+ d$ P; F) q0 E9 f
else if A_tote="tote 2" then set A_induct to 2* A8 t* j4 {( f/ S: s2 X
else set A_induct to 3 ' D0 N. m ^) K( b8 }) |
set A_i to 0
7 S; T! U! _; H T0 _4 Y: Y clone 1 load to P_induction
, p! w* j$ T7 m5 _* t wait for A_time sec
7 a; O i: x4 f4 _/ H3 ?9 T end5 _" R5 y! z' V% e5 i3 T* ^
end
( e, ~1 S2 k5 z" S3 e3 w8 u1 Q0 o, x* T. N* N ^* ]0 e5 B
begin P_induction arriving
7 [' G( I4 Q: Y if A_induct=1 then clone 1 load to P_pick1
3 I- |! I$ U7 x% C _ P" O# Z else if A_induct=2 then clone 1 load to P_pick2% L" i* W W0 H' Y1 [9 w
else clone 1 load to P_pick34 N: C! Y. W: K
end6 W7 J |. ?3 t& ~/ J
9 o) ?' |# g3 \begin P_pick1 arriving+ K. K' s2 R9 d( i/ z) o
set A_i to 1
7 ]8 n8 V! F. r( @. j move into Q_induct1- a$ s2 T' o4 J( x
move into pickaisle.induct1
: _: h& a( o2 m* t while A_i<=30 do begin9 V- ]- Z8 Z5 l5 b6 s* s' J; j
travel to pickaisle.con(A_i)& H/ ^( k& j. k: D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ \/ w5 X0 f1 R6 t+ I( y
else wait for 10 sec- d, t# L# w1 r! c4 c- P
if A_i=A_leave then send to die* ~, z1 [8 _) `% B4 J: O# l
else inc A_i by 1
) B7 C- A1 v N5 f! x: A' p: N end
2 f7 n2 s3 b8 n# C) oend( j# g5 R* S1 j: N
3 }7 _6 i) y$ C) A. l
begin P_pick2 arriving
+ d/ s# l7 V7 N6 _4 j: Y2 `2 X set A_i to 11
! X0 I( A1 O+ q move into Q_induct22 R1 p) {. u! E: S5 V A% u1 G
move into pickaisle.induct28 T' @7 G, ]$ c
while A_i<=30 do begin
0 a" k7 C& R) t |. X. E" x& e travel to pickaisle.con(A_i)
2 i4 h8 X, t* A5 k& s: k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 O4 t! J/ N! a1 z$ V% F
else wait for 10 sec
8 u) m4 \8 Z' n9 `! L if A_i=A_leave then send to die9 I$ D1 g/ w1 F: m- W/ J
else inc A_i by 1
' V4 _: [: A" E end" }: N* {: @6 |) L2 c0 B
end
7 R2 ]3 z& o/ g/ T. |" Q$ N, z) G9 u8 Y& k3 c4 ]
begin P_pick3 arriving
1 A- ]: W7 u: x% B6 W8 ^2 ~ set A_i to 21
+ {, S$ K! Q0 S) R7 J- v9 ` r( H move into Q_induct3
f$ a! a) F/ T( K$ ^; ~9 z3 h$ P move into pickaisle.induct3
4 ]. r+ e. W. `* M) @ Y3 U while A_i<=30 do begin; w( N1 @/ K s2 p/ q5 Y
travel to pickaisle.con(A_i); y$ K7 h, k. c6 o( W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. K$ N" F, a* N8 G
else wait for 10 sec8 G' b7 A+ j {! L0 K: R+ |3 v- o1 Y
if A_i=A_leave then send to die9 J8 `! H! G" \! ?2 l& k
else inc A_i by 1/ D8 _" c- w9 c2 i
end
) n/ Q; _9 H3 L& k7 o7 M$ K# z! F* send |
最佳答案
查看完整内容
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,其它按你的 ...
|