|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 Z9 f5 P$ l0 r; t a$ B, c/ c
- ~' R' Q% |& v9 T6 R/ x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 D. A* e6 m9 a3 H) `9 m+ C" P5 z( x
, J ]; X) H! [9 A
begin P_read arriving- J; ~# E2 |% U, Q3 }' g% a
while 1=1 do begin. g( g6 d9 ^# N( h8 [
read A_tote from "data.txt" with delimiter "\n"* V. ]7 y0 x& a4 d3 c1 d# [! T
read A_time from "data.txt" with delimiter "\n"
& [+ }, e, l6 t s& U read A_leave from "data.txt" with delimiter "\n"8 P7 f3 E" q1 U8 J+ t ~7 L
read A_picks from "data.txt" with delimiter "\n"# d y8 G+ v+ M, h- t
set load type to A_tote
+ i0 @9 D" o: [& Z if A_tote="tote 1" then set A_induct to 1' j _" J' W' \- |5 s4 ]' R- y
else if A_tote="tote 2" then set A_induct to 26 d4 b2 i$ j8 H: n) H' l
else set A_induct to 3 % v0 V% J/ o. G8 Y
set A_i to 0
1 w s2 z* z, V' U U" P$ Z9 A clone 1 load to P_induction
1 r* C: E6 g; E/ y1 I wait for A_time sec* j( v& } l0 k1 g: y
end
0 ?( h8 v6 M0 h, u( j g4 Vend
4 @9 L3 w$ N$ v$ c6 ?4 O1 K: b% i
: @8 J" A$ d# C5 t+ Ubegin P_induction arriving9 V6 u s( `( \. _" r' O
if A_induct=1 then clone 1 load to P_pick1
: i/ E0 e- ]% {9 [ else if A_induct=2 then clone 1 load to P_pick26 y- k* l5 n* `8 @/ S
else clone 1 load to P_pick39 ]3 g3 H$ t2 Q& |, s
end
1 f/ T W3 _9 o" M4 \5 j
! w0 w N7 E# Z, Z: S1 f% ?begin P_pick1 arriving7 d, z- S6 Q) s A- ~
set A_i to 14 z W$ X4 I/ `, d: @0 \8 G! o
move into Q_induct1* w/ N) h( J# M E6 i* K
move into pickaisle.induct1) I8 E- z3 y. Z6 g% G/ b. p
while A_i<=30 do begin
/ g$ E# \9 S8 K; a travel to pickaisle.con(A_i)
4 m7 A% l. ~, d5 H3 ^8 |3 x9 I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec l7 t' `! g! F! D; i8 B' j* ?
else wait for 10 sec
8 V$ A% p) J# i9 D4 l' g0 D4 U+ e if A_i=A_leave then send to die
. q( {/ M" r( `" I* Q9 P. l else inc A_i by 1
; W& j, T- k# E0 J9 _- w: z end
4 @8 }- ]; K1 d# Send
% W1 g5 a, Y3 H& E" n5 G
, L D: ~! U$ W% P$ y0 c {begin P_pick2 arriving
! d) s% o$ N/ p3 `3 p9 s2 C set A_i to 110 p5 u. r) c2 ?5 ^; D4 }4 w$ Q
move into Q_induct26 F8 }$ M: \& U* R. C
move into pickaisle.induct22 X) j$ z/ U% F/ ?4 L" a
while A_i<=30 do begin" l y. Y) @5 \0 W" V
travel to pickaisle.con(A_i)& f# h6 E$ D6 V/ _. p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- R4 H9 v% x+ w" x4 \ else wait for 10 sec: ]7 f M: r. d" u# I$ \6 k. e
if A_i=A_leave then send to die
3 M( x9 f9 n3 t' z. ~3 d6 C$ r8 [ else inc A_i by 1
+ f0 s2 e$ T H) d& F N end4 J, T6 ]2 p. R: e I( o" P
end/ h' E; b' ?% x7 P
& N; w1 O; ~; S( x& V3 B
begin P_pick3 arriving, q) p! s) {, _
set A_i to 21 V' T* a6 z! }2 R @5 \
move into Q_induct3% Y" [8 H' h/ L: {
move into pickaisle.induct3# Y- p* Y) ]3 [7 V9 |
while A_i<=30 do begin6 r& ]; P9 N9 i# i( w% [6 y& b
travel to pickaisle.con(A_i)
, m8 C8 N2 Z% Q# C- _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" e" B7 E$ p4 Q" ~0 H( t
else wait for 10 sec
. Q4 ]4 b: S9 _" g$ b5 u% O if A_i=A_leave then send to die
3 A) W2 Q8 \2 Q) W5 W: A4 c else inc A_i by 1
9 h; d4 C, _8 I- z/ e n end
; ^( f# L. M+ g, 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,其它按你的 ...
|