|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- E" ?0 x0 g+ K5 O0 s
* c" v4 j6 Y* J9 q0 x, y* 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中的数值,不知道会不会有什么不妥。; O8 ]* Z8 S: p. u7 [: i" s
: N: h \& P) dbegin P_read arriving1 C, @/ S! e* C. ^* ?
while 1=1 do begin: W+ H: h5 V0 ]7 Z3 T
read A_tote from "data.txt" with delimiter "\n"' @+ t3 K/ v0 s: o2 M; q" j: x
read A_time from "data.txt" with delimiter "\n"
( }8 J( V8 L3 f' W' l+ s+ T, F read A_leave from "data.txt" with delimiter "\n"
3 J& k+ w1 x4 M read A_picks from "data.txt" with delimiter "\n"5 t( e( r H$ `1 h8 X( Q
set load type to A_tote( M: b( g. b/ N$ |; N. a' }
if A_tote="tote 1" then set A_induct to 1
+ x ]# x r* p \1 q) b else if A_tote="tote 2" then set A_induct to 2
; a# ]4 K4 v- t- f8 G else set A_induct to 3
% f$ Q: K' R# S$ } set A_i to 0' _- n3 S5 |! }$ F& |
clone 1 load to P_induction
8 }! w: Y. n: X! L wait for A_time sec$ g3 m6 `. u! k" Z4 R
end
3 t& s% `' P, N, x3 I; yend- X4 Y4 ^# b" U9 ?' U5 v
- g7 J7 k+ n3 |1 J7 p# G7 e
begin P_induction arriving e, n8 I3 ~# v* L
if A_induct=1 then clone 1 load to P_pick1
5 X5 d, r1 M! P# t else if A_induct=2 then clone 1 load to P_pick2+ B% d9 H j* Z: q
else clone 1 load to P_pick3. |* u! `1 A' P2 e/ w, J& ~
end. D0 f1 S/ m5 G- r3 R
9 r2 X2 r# x/ V+ R
begin P_pick1 arriving x8 J6 g& E7 ]( `/ ]% E. _
set A_i to 12 [/ F: ~' N4 m/ c5 ]4 q
move into Q_induct1# ~9 j$ f. P/ \4 \5 E
move into pickaisle.induct1
4 w* r" B) }; h6 B! u' r2 L; n5 v# ?3 e while A_i<=30 do begin) S* |7 b8 r& u9 |9 f4 d
travel to pickaisle.con(A_i)2 M$ u8 d# E$ ` Z: ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: D. x$ C! d p% y
else wait for 10 sec4 C$ B* |) u! f; N% m
if A_i=A_leave then send to die9 X8 E# g+ y& V& w @; e
else inc A_i by 1" `1 ]8 x8 l, l |
end) ]8 N0 c8 x" A0 q/ t- U! }" `
end8 |- M; j, e& z3 }
! s$ ^* Z( p: @% r
begin P_pick2 arriving9 ]8 Y; D7 M, f# ~) m% ~
set A_i to 11' t* s$ @1 ]9 z: |1 C
move into Q_induct2 K) S+ N) m( f9 F+ R
move into pickaisle.induct2
3 k1 B' j* L2 k; Q; I) x while A_i<=30 do begin5 E# z& w. p w5 g' S0 Q A
travel to pickaisle.con(A_i)
0 U+ J! t; W$ f4 F* {- R. n4 K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# b( e: s! c4 @7 c- |
else wait for 10 sec, r7 N" Q* ], @9 o& V( p
if A_i=A_leave then send to die
$ |' j. {' j% A- Z4 P else inc A_i by 1- E0 \0 s2 h3 \; r8 h4 q
end6 h5 q. F1 N9 \, s d' |
end7 j" K' W& S7 X) P2 s
+ I8 r* _9 E: I( `2 N( n- s
begin P_pick3 arriving
% k; _2 L" j; e ?" l set A_i to 21
j7 G* [0 Z+ u8 ?1 s move into Q_induct36 _/ I- D/ l0 i6 N G. ] B; ?
move into pickaisle.induct3
+ ~: `4 w6 M% j3 m9 A8 H+ G8 } while A_i<=30 do begin" h: H2 \+ [8 q4 ?6 o; `/ l b
travel to pickaisle.con(A_i)
7 k# D. x& k, A. c5 [- g% N: q R7 s& Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. e& C- {" b( z5 S u Q& ~5 _9 ^5 n else wait for 10 sec7 A& T* s7 n6 H y. }
if A_i=A_leave then send to die7 o7 V; z7 |+ v. ]
else inc A_i by 1' z9 W5 \0 I: [
end
$ A( m9 A8 ?0 B% x- L! P h6 ]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,其它按你的 ...
|