|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* ^+ O$ J; _( U( ^6 j/ E$ N1 l& Y6 {; g8 K5 t4 z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 X* G1 P/ d% x# E0 g2 y
5 r( G7 k! z( m! F
begin P_read arriving
4 C- G: j' C% H while 1=1 do begin6 \% b" A% ]; Y$ [
read A_tote from "data.txt" with delimiter "\n": Y8 i' U' F( u) P8 S; b, x( W' [9 s( H
read A_time from "data.txt" with delimiter "\n"
: R# |( v: P$ V3 t# I/ ^ read A_leave from "data.txt" with delimiter "\n"( I1 Z2 M8 ]7 G- E
read A_picks from "data.txt" with delimiter "\n"1 ~! W7 r% M3 f$ m5 t+ s) B
set load type to A_tote
: Y/ |2 M& K( B) ~) F if A_tote="tote 1" then set A_induct to 1% h' {& X) {) w7 I) i
else if A_tote="tote 2" then set A_induct to 2
o- u! B6 ?8 W# ~ else set A_induct to 3 9 n* y! q; I9 ?1 I
set A_i to 0: q4 O! v; l V5 O: |/ n
clone 1 load to P_induction6 c8 j4 q! m* m
wait for A_time sec
O$ v1 g1 x7 n' ~ end7 K1 ?6 }. e8 p3 w
end N2 Q$ f* w* p' X* Q9 Y
& }) R7 i; k K0 B
begin P_induction arriving' Y2 n: ]5 t! Z( X9 ~" v
if A_induct=1 then clone 1 load to P_pick1
& s4 F* l8 g; F3 S% x else if A_induct=2 then clone 1 load to P_pick2
3 `7 O$ W5 i- j2 X0 r3 w p3 m else clone 1 load to P_pick3+ V7 {5 Q' r M$ F2 g9 x5 j
end B- R5 g# j* K$ W
8 D% G3 v# Z5 I Y4 R5 k; f
begin P_pick1 arriving- R5 O2 W! @& S
set A_i to 1$ v2 G5 Y# x/ D& k
move into Q_induct1
3 L1 b6 g2 O2 X( X* [ move into pickaisle.induct1' x- Y* R' Q0 _. H) N2 X
while A_i<=30 do begin
6 _: g2 X: L; z" ` travel to pickaisle.con(A_i)) h$ B2 Q6 O7 j1 r& k$ E( z O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 A9 \, r! P: P& r+ E else wait for 10 sec
+ M( X, Z- d& J- X if A_i=A_leave then send to die" Q2 @6 g4 _ X2 J. @; D
else inc A_i by 1
k3 u) Q8 r0 s; n$ H) `3 | end
& b/ \. Y$ h( W# i# uend
2 u6 M' C& o6 Y( D3 w( l2 ^5 O: H( d3 q" T
begin P_pick2 arriving- q; q% Q& q! ^. B
set A_i to 11; i) t1 a! t- D% ?' K+ L- [
move into Q_induct2
% O+ @5 |! B7 G; X+ C0 d) K' B move into pickaisle.induct2
0 a/ i+ L; G; G2 ? while A_i<=30 do begin( V6 E- m; q8 q/ Y: w' u( q+ v
travel to pickaisle.con(A_i)
# a$ Z6 s' ^. Y( ^9 {& y3 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 X0 k4 G! G4 J8 T/ m. q, ~ else wait for 10 sec# R2 ?4 c$ U$ E, \- V. I- T# C
if A_i=A_leave then send to die# p( A; S, p/ R6 a- D
else inc A_i by 1. | N! {. _/ e1 h
end
8 z! `, B5 N! h5 e7 y# g* Dend5 J) H2 d* I w
4 R) P/ V& \0 K/ F2 ^# Kbegin P_pick3 arriving7 P% i8 X, x6 m& G" a
set A_i to 21
. B5 t! m* F/ @7 K move into Q_induct3+ I- [( x1 l2 J4 @3 F
move into pickaisle.induct36 r8 m! @( w0 r, s8 O
while A_i<=30 do begin4 v2 ]" g; a: E- h, _1 R$ a' {5 ]2 k
travel to pickaisle.con(A_i)* @$ c$ F0 M8 j; M) Z4 D" T6 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% }5 f1 ~+ m1 _ else wait for 10 sec# ^! t; W8 E) @/ p6 J
if A_i=A_leave then send to die
" R3 J& j" c7 u' o0 h else inc A_i by 1" V2 K# P! s, W9 Q- r( `3 V$ ]
end4 D4 V' u( e1 p8 \1 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,其它按你的 ...
|