|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, Q5 I4 }3 O. K6 _. g8 p
/ E; ~) L- Z Y7 I0 c7 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中的数值,不知道会不会有什么不妥。
8 P( [1 A( H7 q8 h7 E2 } q0 N" h, F% _
/ u# }* y) [6 P; O; nbegin P_read arriving
; ?# a$ K+ E: K3 P+ I while 1=1 do begin
# ~! o5 D% J( u, w# A, K* ~ read A_tote from "data.txt" with delimiter "\n"
: b2 F8 D. b" O, Y$ {7 w read A_time from "data.txt" with delimiter "\n"
$ O1 R' C( J: O4 k8 R9 J# o# a% i8 c* Y read A_leave from "data.txt" with delimiter "\n"
% u3 W: t5 A9 m. o read A_picks from "data.txt" with delimiter "\n"8 \9 P* N4 p, w7 g
set load type to A_tote- ]1 j4 }/ R! G: I
if A_tote="tote 1" then set A_induct to 17 H- y. ?( W- M b: ]
else if A_tote="tote 2" then set A_induct to 2
) B5 O0 f) ]3 @1 `) G7 h4 ~* S else set A_induct to 3
1 l! [# I. I9 Z set A_i to 0/ |. r! }8 Y2 h# F: Q K3 x" g
clone 1 load to P_induction
! Y- P+ e$ z* h& o% m wait for A_time sec y, D2 X( F4 [8 s0 A1 w
end* p5 \$ p/ x8 ]
end5 ]5 [ x, r/ @# o+ N
3 D4 D# v) h( y7 G0 _
begin P_induction arriving5 n8 [! G' D! v5 a, G3 O ^5 }
if A_induct=1 then clone 1 load to P_pick1
/ X0 |7 |5 m, H& ^ else if A_induct=2 then clone 1 load to P_pick2
+ N0 m1 S- @1 b+ t- q* N# t- C else clone 1 load to P_pick3" k- Y; H) d0 [) @, H
end9 s8 j" X% |) B; X* n
/ T2 O1 P9 H7 _. o* e' p
begin P_pick1 arriving
+ W( w* t. }# D( h set A_i to 1
2 ?9 i ~5 {; W1 R, p( y move into Q_induct1+ ^, J: m7 ^' \" I
move into pickaisle.induct1' m; a" p/ S# Z5 s
while A_i<=30 do begin
5 j+ P7 D( ] ?4 G8 } travel to pickaisle.con(A_i)
( f8 l6 t- O% l X a! ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& v! K% C+ n6 ~) @7 X else wait for 10 sec& Z: I" C* [) |( w1 r$ V& C
if A_i=A_leave then send to die: g' Z% h0 R& v2 x" K5 [* `
else inc A_i by 1
- u z$ G+ ~$ j- g end* B& ?3 W x1 ]2 R+ M- i1 ] ]
end0 s4 g! u; c; X( {" l5 d0 v7 m
; i6 ? [" J# abegin P_pick2 arriving8 e6 G S1 u/ i& U/ {$ y) n( [4 r
set A_i to 11- X1 T# P2 ], F* d# t: \
move into Q_induct2
& F5 X# q; P5 f. {2 P move into pickaisle.induct2. {" V% I: u1 f1 n! }9 a3 c, a
while A_i<=30 do begin+ P( D. G2 O5 n% ^
travel to pickaisle.con(A_i); s9 _3 i# N8 A- n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 r7 \; \; V- w* }( Z$ e else wait for 10 sec
; f! y$ c8 W6 I7 s0 _6 c if A_i=A_leave then send to die
8 ~8 p: l* j1 ?3 {' _- E: Y- H/ r else inc A_i by 1
! k+ g* T8 n6 G/ n$ {" B end$ o. C$ ?4 l* f
end( }8 r& ?: G: U4 S- E% [8 e
' |5 s$ K, ~2 y4 Y/ @
begin P_pick3 arriving
" j/ g7 A |& Z, ~4 \6 c set A_i to 21. ~( c1 m& ?* ~8 J
move into Q_induct3% A* v- D, b# @: Z
move into pickaisle.induct3% ~; J9 Q+ S5 f: A5 d5 p" W
while A_i<=30 do begin. `) b. g7 w! w6 U1 v; V# B
travel to pickaisle.con(A_i)4 _5 A9 J1 S$ A) ~' H( x8 Y0 l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! N2 s* n; S9 B. }2 ^
else wait for 10 sec+ k8 k, N- a% {0 J' j- p) t
if A_i=A_leave then send to die
/ B) [. V, B' y- n) e" [7 ? else inc A_i by 1) f3 w; g) i9 ?+ H$ J
end
- V" X) s7 E) f! e! e$ {/ Dend |
最佳答案
查看完整内容
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,其它按你的 ...
|