|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 K# C' C8 a; |5 O2 f8 I$ M/ _
, V2 k# W2 U8 H- M" f M! s& `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) Z1 `8 e. h' o$ z& o% L$ d2 e
# f \3 g: Z8 X+ a; P5 Dbegin P_read arriving
& N6 ]0 w) a5 ?- {' {2 g( [ while 1=1 do begin
0 y, C9 e6 T k6 c3 t! a6 p read A_tote from "data.txt" with delimiter "\n"
3 ?' U( H! H2 ~/ _; g; Q4 Q read A_time from "data.txt" with delimiter "\n"
/ \1 \5 R2 Y$ g4 i' Q: e4 @ read A_leave from "data.txt" with delimiter "\n"
: v9 N$ U& V: k read A_picks from "data.txt" with delimiter "\n"' R4 i6 F' B5 C: U: ?( g
set load type to A_tote
# w% o1 [- M' {4 U3 _% M# u' T if A_tote="tote 1" then set A_induct to 1
' H6 l; F1 w0 V+ V else if A_tote="tote 2" then set A_induct to 29 @7 D4 y2 [( v3 R$ T, \
else set A_induct to 3 . F7 X8 J" z) L% t" y2 q
set A_i to 0
4 F5 e; Y, p+ n clone 1 load to P_induction2 K' O. _0 k8 k
wait for A_time sec1 q% G8 c0 K% s) w- a
end
2 B }* E2 x: a0 j+ P* t- `end" y2 z$ e+ L1 x% D) P0 V4 H. J
1 y8 c9 N8 Q/ z- D( z" Q/ T$ o. [$ x7 |
begin P_induction arriving
3 Y: ~( X; u: Y# ~ if A_induct=1 then clone 1 load to P_pick1) l" X' V8 S+ e1 E0 p: k
else if A_induct=2 then clone 1 load to P_pick2
7 }2 Y9 e' g( Q8 ` else clone 1 load to P_pick3
; P+ g( S% V& a( k/ s. i# ^# K% Dend: M3 T+ V. ~$ I6 ~$ L D7 M j2 [9 q1 h
; H. B' h- N/ {- Z! \+ I5 f, A
begin P_pick1 arriving; N p) N0 Q$ D: z6 E) B
set A_i to 1
; m9 v/ z: ?, y; a3 M move into Q_induct1
j2 `4 [. Q; K6 ]; f6 m! [$ s# z move into pickaisle.induct1 R& ~) p* z# Q% H0 W3 L* ?! T6 k
while A_i<=30 do begin L9 P8 f& p, u3 _/ O+ C
travel to pickaisle.con(A_i)) \: P+ x" ~' Z8 g1 j5 f9 L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% r8 r0 J2 ^+ l% f0 }7 z
else wait for 10 sec X# ?0 p: o: W
if A_i=A_leave then send to die
$ e+ B4 R' Y- U" g( B else inc A_i by 1
5 n2 U4 X' U5 g- w5 x end% c& f3 I: V' h) P) V
end8 z K4 v1 Q4 h! I- G4 ?1 L9 t
2 w" i- q* u2 L Ibegin P_pick2 arriving+ j9 R+ a+ w0 y* @/ _ s% f
set A_i to 118 y' `' q) } M
move into Q_induct2
; A0 c9 @. A- h) T% v9 i% n+ k move into pickaisle.induct2+ R& Y I/ m. Z g- X, ?
while A_i<=30 do begin
9 P0 }2 e, ^% S( p1 j- ~6 H travel to pickaisle.con(A_i)
& H6 f1 t8 ^, t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ t- Q6 k6 d( e) b: u
else wait for 10 sec1 H& Z) j" u' n$ ?! P) J" x
if A_i=A_leave then send to die8 M( b7 B' o' N5 A4 @
else inc A_i by 1
1 R. u% k" R' q% V6 G end
0 R+ a W' i/ W/ S2 n$ ^end
! X* _& U+ F6 {9 a' E
$ i! \! P& A7 r4 V3 z. B. \begin P_pick3 arriving. G* Y- l5 {: p# x
set A_i to 21* y; `% ~2 i7 U' d) V4 q, O
move into Q_induct3* d0 e/ [- N! l8 N9 a
move into pickaisle.induct3
- v, Y( n! M3 O2 k8 t while A_i<=30 do begin
5 C3 b5 R. g9 P& ?' m& T travel to pickaisle.con(A_i)5 G/ N, ?: j( D4 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ s- d4 U, x1 [ else wait for 10 sec! E! p6 ?4 t; V8 s, ^
if A_i=A_leave then send to die
" f3 I: \- b) Z, u9 N else inc A_i by 1# M. V: G$ f! R4 O, U" a7 v* E
end2 V2 d/ I! M9 U# N g
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,其它按你的 ...
|