|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 @! L- S% }8 Y0 u W) \9 b. ^2 X) O- T2 _; }0 z* [5 J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 Y' e) S, C9 Z2 @4 D* y% g1 A# @, n5 A
( L& k2 d6 K8 r0 p6 ?
begin P_read arriving
7 a0 T8 y/ O- U3 H* g: | while 1=1 do begin2 ~, z5 g1 A4 u6 u* [; C) w8 {
read A_tote from "data.txt" with delimiter "\n"
/ [! ~! J Y. v# t% f+ W' } read A_time from "data.txt" with delimiter "\n"
, V0 N! Q5 C) {9 S9 Y f" q: j read A_leave from "data.txt" with delimiter "\n"9 d8 q/ h' u( i
read A_picks from "data.txt" with delimiter "\n": h) {. o% e" J. }- M6 Y
set load type to A_tote
! U1 }1 g( \- b% b. x4 H, j$ { if A_tote="tote 1" then set A_induct to 1
4 z: x( `- |0 P: i8 | else if A_tote="tote 2" then set A_induct to 2( Y# }9 m' Q, W& \5 N3 G% [3 b# O! m
else set A_induct to 3 " v3 N+ [# ?6 n* x2 V2 m
set A_i to 0
: T" i( j" ]+ A, l clone 1 load to P_induction0 @" t' Q9 R+ b6 ?! v
wait for A_time sec
8 l; f( ~" c! g* d/ i8 q end
4 \/ s) w. @( o4 d+ A% b! E7 p% wend
: X$ u9 J, h+ E: [5 F% H4 M' p/ ]1 w0 L. Q) w0 a; W& N
begin P_induction arriving1 x" p8 [0 G: _$ r0 r
if A_induct=1 then clone 1 load to P_pick10 R* r( f" g# ?
else if A_induct=2 then clone 1 load to P_pick2. ^4 ^( _! ~5 U- ?0 ]! Z$ L- C9 e
else clone 1 load to P_pick3
) ^6 ^7 U9 h+ D# N0 ~4 _end
9 Q* e" x) [8 |# F9 F, `) L: h0 M) n( O6 D1 v1 q7 ]$ R
begin P_pick1 arriving) K. F- D4 P, X1 @
set A_i to 1
" p2 U7 y# {. H0 S4 k move into Q_induct1
6 M! F' E3 C7 A$ A% K. G move into pickaisle.induct1
# h) L+ o5 g- a" K ~5 a6 }! Z8 n while A_i<=30 do begin7 u0 w. x8 @) z9 ~( s$ w
travel to pickaisle.con(A_i)
# {" j* o. q: z5 q U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; r$ Y& c7 U) m) ?3 [7 ~6 h9 Y+ K
else wait for 10 sec
3 P: l5 \+ i8 i2 s5 U if A_i=A_leave then send to die
+ k9 H! l" N9 w8 v. l7 j7 e9 i& h* X else inc A_i by 1
; m8 g4 O" r5 @ end
2 L& Y/ c+ g- M& M: j, ^end
5 H+ ]) Y$ X3 r( m5 s
$ ?# j z1 W) _4 o* P+ i. ibegin P_pick2 arriving% J- A! n; {# [; e) \- }
set A_i to 11
5 c, j0 {: B$ E- v5 z% N( J move into Q_induct2- G" e& y, B& Q
move into pickaisle.induct2+ t* R. Q, h$ \; O3 u( D2 |
while A_i<=30 do begin; v7 v7 M* m5 t. o
travel to pickaisle.con(A_i)& I# Y8 R2 D$ t# X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, D$ }6 Z' Q4 r) w# {: s
else wait for 10 sec" L7 m! o3 b5 R0 }' q: p% G
if A_i=A_leave then send to die; @- r; p0 F! P
else inc A_i by 18 Y' _1 v, |5 j4 ~
end
5 w( G) Q5 N( L- g% v& Kend
0 p, F0 F+ ~ a) H0 s9 g: X) }" P: I6 z- v9 O$ \
begin P_pick3 arriving
9 P& {4 P' f5 u0 @ set A_i to 21
- r* h! x* \- C move into Q_induct3
# k0 A1 H: k3 _+ n/ L move into pickaisle.induct3
9 g" M1 X7 P9 E while A_i<=30 do begin
5 T# E! ? D, G9 N5 N0 T travel to pickaisle.con(A_i)
( S$ V) ^4 |; n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, S+ n) i+ j3 A5 V4 B
else wait for 10 sec
# i: a" ] s4 R4 R if A_i=A_leave then send to die1 H0 S7 R( d9 D/ x+ J; l5 t
else inc A_i by 1 _0 S* ?5 p, o! }" G" `
end$ @7 x2 e; y* k L2 E7 ?& 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,其它按你的 ...
|