|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ L! U& L2 ~# h! V) Y+ i6 \7 r o# U6 n" M" o: N% B+ n) g
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" M. ^' w% w0 D( a. }
7 f4 i3 d ~+ g3 g {
begin P_read arriving
% ?) e9 d. D# V& I while 1=1 do begin
7 M- }' H( ^8 W% g( O2 s. ?+ \5 c read A_tote from "data.txt" with delimiter "\n"
! J g O5 o1 B- I b read A_time from "data.txt" with delimiter "\n"
3 `5 V/ }8 A. ]2 ] read A_leave from "data.txt" with delimiter "\n"5 Y& i! _% B" a$ ~+ H
read A_picks from "data.txt" with delimiter "\n"7 A: ?1 a9 A9 |+ C4 y3 Q
set load type to A_tote# O6 z3 o. T7 D' n& s) x. g
if A_tote="tote 1" then set A_induct to 1
. F2 \$ q8 y0 [3 ^6 s else if A_tote="tote 2" then set A_induct to 23 t* l: Z: m2 k1 {0 ^1 @3 J$ V
else set A_induct to 3
, w& p F- d5 O5 c) j/ o set A_i to 06 @# V! b# P* v V
clone 1 load to P_induction
4 ^: c8 N. n8 r% K+ L wait for A_time sec
' H& v" A2 a* R) u8 n5 N end
6 ]; k) |+ k1 d) ?& L& I4 iend+ A1 ^8 T( G5 b8 q
: N8 g: x' o4 q( Jbegin P_induction arriving# l% P* l! Q9 D5 D: B1 @
if A_induct=1 then clone 1 load to P_pick1, t" p" C: ^3 A+ y* k8 @/ b
else if A_induct=2 then clone 1 load to P_pick2
- Z: D+ A4 C2 b1 A" \ else clone 1 load to P_pick38 ?) [! C, @- p6 X
end: ^1 O0 a% k5 O; v
1 w* e- W9 Z( `" b6 C& W
begin P_pick1 arriving
: Y0 T. ~8 m3 L. } set A_i to 15 K; t7 N) f2 @2 y; _; A2 A
move into Q_induct1
8 s( n/ d4 H* W1 O Z5 R5 e" C8 e" [ move into pickaisle.induct1" l3 A6 Q( ^7 o8 J9 j; n" s' F
while A_i<=30 do begin- _. i _0 {. g: N. S8 f
travel to pickaisle.con(A_i)1 _% D1 u1 C4 V$ N) d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ c; H# _& V! R
else wait for 10 sec# H* V9 T" Y6 w$ L" C6 r
if A_i=A_leave then send to die
& w: w3 g, Q- x0 z3 g else inc A_i by 1
% Q" b+ k0 f. ] end# d; X( W! p& O8 f8 |2 P
end
; d7 r+ T1 m; u% M7 A8 e
8 I6 d' H* k9 y& Q W2 ^- lbegin P_pick2 arriving; O- J8 B8 ~! r# u2 g- \/ _% D
set A_i to 11* M/ u% U1 [! r
move into Q_induct2 J: |0 A$ V6 Z, J
move into pickaisle.induct26 _/ A- e- b! g& c# u$ C
while A_i<=30 do begin: g/ p8 f# ?: v8 y
travel to pickaisle.con(A_i)
6 O- D3 c _0 L( B, o7 X" @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 _) h2 a& V! w/ C) |/ R
else wait for 10 sec; N. _0 |3 s) w2 f. Z# B* j
if A_i=A_leave then send to die( F- `6 P; t3 k9 g$ D
else inc A_i by 1- [1 P6 w W) n6 z
end' r! v8 V/ f# E( [
end2 G n& T8 D+ k8 J: |# x
, T+ \! K$ x! d* b7 `0 z" w
begin P_pick3 arriving
& S5 M7 n: B) a3 \/ L# C+ O set A_i to 216 O4 u. l, x! F
move into Q_induct3
; o' D7 {. i A( S* T, T; V0 u move into pickaisle.induct3% y1 e/ Z* F2 `4 c0 I( s. t) K. f
while A_i<=30 do begin+ ?# ^" x3 [/ Z% u
travel to pickaisle.con(A_i)1 }3 ]' s0 K% k2 P5 `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' d2 U: `$ v; N0 ~1 B else wait for 10 sec
2 t* d/ w I* \1 U: b$ w3 h( P& m if A_i=A_leave then send to die* f, r @; a# r0 Q$ a$ d0 m9 S
else inc A_i by 11 Q2 h7 l) N# ~1 |& }. W
end& e Y7 y* U+ @& Z7 E( |
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,其它按你的 ...
|