|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- L* O8 Q' C$ a: D) C
) u. g( ]3 A+ h% j( N我的问题是,在每个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中的数值,不知道会不会有什么不妥。) h$ j# g1 k( K7 x' X# o$ Y: B( f
% k0 Y7 _* \, _
begin P_read arriving# A, h' j' l( }5 w" N3 Y- z
while 1=1 do begin
" V- z2 [. F0 P" m0 K read A_tote from "data.txt" with delimiter "\n"; I( I _, w# ~$ [1 U9 q- B: D
read A_time from "data.txt" with delimiter "\n"7 W8 F: k4 _7 d
read A_leave from "data.txt" with delimiter "\n"
. b7 }) a8 D9 _7 y- T read A_picks from "data.txt" with delimiter "\n"( F1 N- d- ^- _
set load type to A_tote) V8 G; t3 x. E b7 D% c/ Z
if A_tote="tote 1" then set A_induct to 1
: R0 R" S% y% r5 Y7 Y else if A_tote="tote 2" then set A_induct to 2
4 o! M, [0 m" T else set A_induct to 3
$ f6 b5 F, R# @2 m set A_i to 0. }; M/ g! @/ h( M8 x& ]
clone 1 load to P_induction. H; k: n( n* |9 x' {
wait for A_time sec9 C" T/ ~+ `- d* g; P+ y
end
* z" i% ~7 p# Z. hend u# p& `' ~- z3 P f" L" ^
! Y# n& J7 x5 X8 T
begin P_induction arriving
% L7 c0 K9 z! Z/ o x+ Y+ g if A_induct=1 then clone 1 load to P_pick1
, N% n$ {, _3 B: Y5 C/ R$ b else if A_induct=2 then clone 1 load to P_pick2
. t2 `/ k/ A" _- n& T else clone 1 load to P_pick3
+ R* s1 p4 X5 {9 H% Pend) \6 _# k# l$ y* f
# n: l ?' r! ?: T$ g
begin P_pick1 arriving, b* W& a( {: X" Q/ J' ]* c! C3 u% M
set A_i to 1
9 z' E1 f3 \ X move into Q_induct13 O. E$ ]5 C" V6 \& t( g X' {) s
move into pickaisle.induct18 d$ M' D% \ I3 a# O- w: i
while A_i<=30 do begin
9 t, A2 `3 k1 y- \ travel to pickaisle.con(A_i)
* L: k, G- s! e' t" ^/ {8 s$ k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 B/ M2 _ W/ r# w! I else wait for 10 sec
! @- c; w& b+ _) t8 r4 E8 v8 K if A_i=A_leave then send to die3 b! J' M; C9 x9 F! J4 q
else inc A_i by 1, e# ]4 g6 Z6 A
end
% j4 _, ?$ [; u5 X; b% rend9 f6 W3 y" O) ?& Y
. ]( l. r1 R, n* |begin P_pick2 arriving
' I; B1 a/ J _3 D set A_i to 11
- l3 f; r, x2 s0 M p move into Q_induct28 b @8 g2 ~+ @. L6 x1 V
move into pickaisle.induct2
9 V* s- u6 r9 m* Y while A_i<=30 do begin
; W+ L* ?5 i$ u& H# T1 m8 o% U travel to pickaisle.con(A_i)
' ~0 A) A- _. V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 {& F% I- ~+ ]* K
else wait for 10 sec
6 G5 G9 H4 c0 L) h2 w* M$ ` if A_i=A_leave then send to die
$ M' ~0 Q) o u0 f4 r else inc A_i by 1, O- O6 p; u0 [% N3 |
end
3 \5 C& [- r0 _end
4 @- n- p& [" M* G5 X' V! a" G- W
' J2 S& X' u( x; F, Z+ d2 Vbegin P_pick3 arriving3 L" z7 Q0 c$ R6 r2 o4 U' w8 W. W8 V
set A_i to 21" G' X3 v: ]( Y% D6 A* Y1 R& w
move into Q_induct34 c& x" G! x; ~ |6 E- y r
move into pickaisle.induct3
0 p: J" ?: ~; l' c while A_i<=30 do begin: g/ [7 J6 t1 O3 B/ z; x& P
travel to pickaisle.con(A_i)
! |8 i7 Y- A+ @! |+ c! Q4 Z% K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 c. C" g; ~) H: L: p- p
else wait for 10 sec
, @" Z, j% d0 j' x" B if A_i=A_leave then send to die, B( p6 ?- a- i8 a$ G7 F$ l+ e+ C! W
else inc A_i by 1
$ g) S( R0 ^ a; [) }" u end0 u" U5 K" t! E2 m0 `
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,其它按你的 ...
|