|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 Q- o' T* I: G
# T, \6 `9 |& l3 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中的数值,不知道会不会有什么不妥。
( C% ~, D' B F( l: e/ M* Y6 T' z$ b" M5 t& R; q
begin P_read arriving
- J& e! B- u6 q" W5 n: I0 k" U. D while 1=1 do begin- s9 G" G2 |5 \. H6 b4 J' g
read A_tote from "data.txt" with delimiter "\n"# i" V, E$ x+ {. x- c; R
read A_time from "data.txt" with delimiter "\n") B3 u8 X4 ~) C z
read A_leave from "data.txt" with delimiter "\n"
: s! B) R/ h6 P7 E$ ~0 \ ^ read A_picks from "data.txt" with delimiter "\n"
( |9 R- C. p% O set load type to A_tote, {( R- j! ?3 N' M5 T
if A_tote="tote 1" then set A_induct to 1$ K7 V$ c1 |- l, n
else if A_tote="tote 2" then set A_induct to 2" }: ^8 }) i; O' ?
else set A_induct to 3 8 w7 S' y/ W: g, z4 Q$ N" M
set A_i to 0
! E: B, G; ] \( x clone 1 load to P_induction$ C C% G$ i- D! i. L
wait for A_time sec
+ z3 e$ P5 L' j# g0 ^0 p! P, L; } end
% \) e, ?2 E0 c3 vend
8 z% F; x1 y! T* f: \
! d, h: k7 F: J0 |' a4 o [$ f0 }begin P_induction arriving7 B- y; N7 I9 g* b- a
if A_induct=1 then clone 1 load to P_pick1; _( j% |1 p& m
else if A_induct=2 then clone 1 load to P_pick2
4 l+ h" r4 t1 n% O% | else clone 1 load to P_pick3
. O" {( d! N" h) L5 M, aend4 d# y- ]6 g# `! M* m
$ O+ h/ k, M4 M3 H7 ]: S
begin P_pick1 arriving
. @- {4 z9 W- ~8 j( f set A_i to 1
4 R! ?! C! G& \- x& E move into Q_induct1+ @+ ], K2 i6 _
move into pickaisle.induct1
% G' E3 K5 s5 }2 O) C7 W: [ while A_i<=30 do begin
# A; a$ S' W% @. i, ?0 f travel to pickaisle.con(A_i)" l' ?) J; B5 q# ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 L! l& ~# j" V# w K0 |( t3 O* K else wait for 10 sec% `% i) O9 @3 b4 m
if A_i=A_leave then send to die; E7 B$ G( P* H. T
else inc A_i by 1 ^" C5 U8 u; k* @# S: V+ L
end7 P* o6 L* k+ b# x3 J5 a6 x
end8 S/ c( ^/ j, N
0 [) I' Y5 u L+ B' g$ V `begin P_pick2 arriving
; K/ q6 N, l' I4 m set A_i to 11
. S* L% v& A# A5 O) ]" _ move into Q_induct22 N5 H; ]* i9 q. W( @4 R5 T
move into pickaisle.induct2
( B1 j4 ^: ?5 }3 J! o/ ] while A_i<=30 do begin; N1 t2 B! T, e+ G2 _% k7 _
travel to pickaisle.con(A_i)
% Y: p* z+ C4 b* i3 b* _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ b, N& H" c' |, g+ v else wait for 10 sec
+ ~7 S( b1 _- ]" U1 } if A_i=A_leave then send to die
( x( @3 ~) W2 i) g4 j5 d; H2 n else inc A_i by 1
6 s8 \1 y) s# Q4 L( g+ L( j% q end
( c# V+ I% N/ _- D: M2 ]end4 R4 |, I/ @) } ?' \) L5 y
- k' X7 k5 c* |4 ^& e" e. Pbegin P_pick3 arriving4 L& m2 J! x" y$ `( f9 l5 K* K
set A_i to 21
) _9 J# i6 H) u move into Q_induct3
( g/ J R3 Y7 E' ^9 }4 f& K0 B move into pickaisle.induct3- d4 }' z% z, X4 a1 S" G* |+ u5 @7 o
while A_i<=30 do begin2 v7 `2 ^4 S# Z* g! S( f
travel to pickaisle.con(A_i)
' F8 J) I1 E! a! j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' j! o, ?$ Y1 o else wait for 10 sec
~; r4 b6 n1 w# y3 E if A_i=A_leave then send to die
& A2 ^0 @* _; x0 N else inc A_i by 1
3 N! Q4 o6 l, d- a end
; `, O! s1 A8 _! ~7 X9 a" ~8 j0 pend |
最佳答案
查看完整内容
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,其它按你的 ...
|