|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* b4 D5 D: }! S0 ?! U# F2 e
7 X' g0 N4 J# w3 r) d我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ s, i/ |, ]! Z7 q& i2 `1 Q" c7 k. j
begin P_read arriving" @( G0 C1 M, s( v
while 1=1 do begin8 J" {+ p& I# i! ~) X6 A/ b! r
read A_tote from "data.txt" with delimiter "\n"9 v. K. M8 x' n1 |* ]3 k# r- R
read A_time from "data.txt" with delimiter "\n"; G/ e- b2 V6 D
read A_leave from "data.txt" with delimiter "\n"' w6 m3 f5 G {* P3 {
read A_picks from "data.txt" with delimiter "\n"
/ T( p) }- e6 J% ]0 } set load type to A_tote; A2 J0 w0 y; S0 \* F' x
if A_tote="tote 1" then set A_induct to 1
4 B O7 d1 j: f# J: A, f else if A_tote="tote 2" then set A_induct to 2
8 [+ {& w. K8 J/ y else set A_induct to 3
$ X3 w6 ]: T1 _/ G: \( h7 u0 G set A_i to 03 M: V4 ?5 u' t8 k; f$ |
clone 1 load to P_induction" V8 J% [0 m: z4 P
wait for A_time sec
: {8 X z0 W$ y' R8 x/ f7 S5 T end* m& p+ `. c" r1 l4 X Y! N7 S
end
$ g6 V! i) J' |" r0 K7 G' j! M, v' T+ \: N
begin P_induction arriving4 S& a% Z7 Y0 \6 j3 U" w
if A_induct=1 then clone 1 load to P_pick1. @' B9 a3 v6 I' e
else if A_induct=2 then clone 1 load to P_pick2
" h9 `$ w8 @6 i$ o) J8 u. G else clone 1 load to P_pick3
- ~4 z8 U: ]9 R! |. Jend
. j) [# y5 L' s/ @
) G- Y( b+ L% i7 o' y/ ebegin P_pick1 arriving+ f2 [/ ?* Z9 C
set A_i to 1
8 Q! t% G. W# r move into Q_induct1& M. V/ C& P4 C( y+ o) C z
move into pickaisle.induct1( Z# Y4 f0 g; }/ z9 k/ H3 |
while A_i<=30 do begin
% n) a; p# S' U3 m travel to pickaisle.con(A_i)
* { E! T+ n3 y! x" i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 l: k$ u5 ]0 R n" ^) L8 O
else wait for 10 sec
' g$ W% O5 s7 y( o if A_i=A_leave then send to die
3 i& V( r Y1 k' M. F% n else inc A_i by 1
5 {0 s1 A. M" {7 a3 ` end
# a/ k' ~) ]7 Q6 eend
, y1 T$ I# I6 Y* [* v: t/ k6 N6 j% W6 h9 ~& h9 t
begin P_pick2 arriving
/ ~$ G9 X: y! e9 Z set A_i to 11) {$ |; n/ k3 c2 \! c) _3 N
move into Q_induct2% o" _, u- R% ]9 }- ]6 e! z& x2 r! V: _
move into pickaisle.induct20 ]2 f! q: V% X+ {# p
while A_i<=30 do begin2 o1 }7 ?( J- S7 c' R8 Z3 }
travel to pickaisle.con(A_i)
7 m i2 w( v. x* S, e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% u; q* z. {- V
else wait for 10 sec5 c. a: o2 a' N
if A_i=A_leave then send to die6 Q6 s6 `4 G; [" a
else inc A_i by 15 `9 R$ }! h; X4 k9 x
end. c2 D% K0 `9 V
end
7 M, d) r7 a L2 K7 ^7 a5 V. Z( s+ @: Z; U. \
begin P_pick3 arriving: ^1 T7 v& T, y: r. F
set A_i to 21# ~+ r% y, ?/ z1 w
move into Q_induct3
9 @5 R+ e" k8 _9 H0 P move into pickaisle.induct3
* y1 u8 I3 v' G0 x while A_i<=30 do begin
0 V) u( a* d; r1 r, l% a travel to pickaisle.con(A_i)# t# s( C/ S) ~% v6 N. `1 E! U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: w. N. P& \8 M, D; z# t else wait for 10 sec
% @! H% {$ l' V if A_i=A_leave then send to die) V" j2 N6 o# Q* S o
else inc A_i by 1& ?' {- @5 w4 L2 V
end/ t8 m. j$ f$ B2 ]: ^' t U( l
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,其它按你的 ...
|