|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& R9 d, b: _- j- k2 B
/ X! E @# z1 o6 f我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 d! y% g- j! ? M: ?
7 s" P- x7 M) A+ F) U5 |$ q4 T: P& ]3 hbegin P_read arriving( z! v6 b5 a I1 |
while 1=1 do begin2 B4 I& w9 M. [2 }" V
read A_tote from "data.txt" with delimiter "\n"
m* T0 d0 o: x/ E- t read A_time from "data.txt" with delimiter "\n"
) F0 {0 a$ R. M/ p+ C8 f/ o read A_leave from "data.txt" with delimiter "\n"( E2 s. c" |6 C; F3 f: R
read A_picks from "data.txt" with delimiter "\n") p2 `- A8 O! u' z& y
set load type to A_tote
$ h8 T7 B) A6 T' X q if A_tote="tote 1" then set A_induct to 10 ?, Y1 r8 I( o9 p+ M! r+ e
else if A_tote="tote 2" then set A_induct to 2
, W0 i V0 u% h- e+ D( n2 l else set A_induct to 3
w( v- m3 M9 ]8 C set A_i to 0
6 I/ |' P9 ~2 L& u0 W9 [ Y) n clone 1 load to P_induction
+ F8 T. q) b5 M' u wait for A_time sec
2 I# z+ l. w4 Y1 d end/ H+ J6 i+ o7 g4 A" H: ^
end: H5 n3 O( m) H# m' ^
6 u* M6 r2 l, p6 z' P# P0 E- X4 c: A
begin P_induction arriving
9 h) o% k; S7 ]7 ^! r if A_induct=1 then clone 1 load to P_pick1$ a" K/ r" P6 h" s; d$ s( b- ?# p! a
else if A_induct=2 then clone 1 load to P_pick2: u i9 o3 n+ [! }& }
else clone 1 load to P_pick3
: N& M4 E0 j$ X: kend. n9 I$ {/ M) j0 v1 u @' z
: A! F! _. E: t2 g9 w* D0 ~
begin P_pick1 arriving( z3 O2 D) ?4 n8 v) p
set A_i to 1
# m% n% F* p+ A# f move into Q_induct1: T/ \( v" a+ R0 I3 h6 N
move into pickaisle.induct1; {/ ^2 j8 ]4 s4 F+ u
while A_i<=30 do begin& |+ l: h* m/ `# \) e2 l/ c1 n
travel to pickaisle.con(A_i)% i; N% G1 {7 p/ u+ R$ b* A' v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& m9 l4 O8 X# r) g, d: R5 z
else wait for 10 sec9 |! H s- [6 i5 f* G2 e5 S+ F. r* V
if A_i=A_leave then send to die
! y( j! u/ K) ~* [1 l else inc A_i by 1
2 \2 C# z! p+ \& O end
$ R$ I. }& m% c( S3 Iend! t: T# R' g$ [5 Y! ~1 r
; A, x; q+ [: `* p" L: x& s# q2 ^' g
begin P_pick2 arriving
- L4 k6 `! C# ?- g6 H set A_i to 11, }: D2 k; B( H0 i( b
move into Q_induct2& z) Z( m2 @$ d" Y
move into pickaisle.induct25 Q5 a6 ]( Y; U2 q
while A_i<=30 do begin
& B8 j; {+ R2 b/ g7 U/ e5 H/ z travel to pickaisle.con(A_i)
; C0 H3 f* J9 D/ Q: n5 n4 i8 R' i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 S1 L! l) W2 ~8 O else wait for 10 sec5 f1 B1 V( j) g7 J7 U; G
if A_i=A_leave then send to die4 D% K6 F- W- \- n! `0 ?* }
else inc A_i by 15 V. p, c2 u0 L# ^' K4 \' `
end; w) z3 z N" o O3 j
end& L8 Y# W+ m7 j" i7 L0 ?
! U/ Y1 V# k; Rbegin P_pick3 arriving/ r' d3 X+ ~- b
set A_i to 212 k7 [0 f: K2 i0 n! F3 v- o2 ]
move into Q_induct3
2 ]+ q8 p- j$ ?& X move into pickaisle.induct3/ e! K0 {" F H9 `1 X7 Q" M
while A_i<=30 do begin, o0 \5 p6 Q, I1 G/ z3 a" n6 K
travel to pickaisle.con(A_i) x7 ~" w* ]2 c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ E0 E- L6 e6 ^, g% L! L1 W3 u else wait for 10 sec0 b' a+ }0 o4 z J4 |' [8 r! G
if A_i=A_leave then send to die2 ~" j5 f0 v( ]/ c$ D3 Y
else inc A_i by 1
; H {$ \2 X8 k5 R end
; L* Z$ G! |4 t' \# m1 Iend |
最佳答案
查看完整内容
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,其它按你的 ...
|