|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# G; z7 j0 F, O
" i. S! V. z6 e- f; V6 l+ i$ 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中的数值,不知道会不会有什么不妥。# R5 M: j) K5 I Y( o
7 j4 j# T" T q6 W1 ]+ m3 w1 X6 l9 {begin P_read arriving$ H; d7 \7 y$ J6 j; ~
while 1=1 do begin
# A9 l9 a6 j' q# O; l6 {7 k read A_tote from "data.txt" with delimiter "\n"1 X! J+ n2 b* F
read A_time from "data.txt" with delimiter "\n"
* Q# o" ?0 }: {* x& r: a read A_leave from "data.txt" with delimiter "\n"
r2 A1 o) M C7 Z/ ` read A_picks from "data.txt" with delimiter "\n"$ u2 a0 ]' q! O9 ?$ w0 K( G a
set load type to A_tote
& J8 ^$ x! H) G5 f if A_tote="tote 1" then set A_induct to 19 F" f$ G6 L5 h
else if A_tote="tote 2" then set A_induct to 2+ |) |: Y) [+ ^$ Q" Z! n Q
else set A_induct to 3
) H. w& z J v* O4 @6 a5 D* l set A_i to 0
3 o' T8 v9 t( e i6 M- B# | clone 1 load to P_induction
3 ~% k7 _0 z% `% u( g3 Q wait for A_time sec$ S+ B- u8 ^+ h$ H9 W1 @2 }
end+ i: ^/ T4 _+ y5 e7 m; e
end& J% \7 Y* a+ x/ q1 g2 L" h8 P8 @
X2 K& P* D, e8 w
begin P_induction arriving
/ n7 b' c+ a0 [ s4 c% M if A_induct=1 then clone 1 load to P_pick1
* ^3 } ?' a6 d1 E! ?5 F3 @& H else if A_induct=2 then clone 1 load to P_pick2
$ n7 J& B; r: q. {3 t% \( U; K else clone 1 load to P_pick37 o4 ~( s! ^" D$ P
end+ A8 S7 h. R- t- m/ N: f5 ?3 @
( F! d3 t: k7 s
begin P_pick1 arriving
* p5 Y. m1 O- y8 p( K% G5 F set A_i to 1, b( l+ y. }( b/ m5 I! P5 Z
move into Q_induct1
) G$ z+ w9 K) o. A& x move into pickaisle.induct12 p% R8 e; U4 m/ o
while A_i<=30 do begin- D- \8 q4 U) N! D
travel to pickaisle.con(A_i)
0 G3 C% l ~: E* ]4 Y! p; H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" k) N) b: e C$ n4 v- M
else wait for 10 sec
+ Z1 N" W2 D5 \9 l0 [ if A_i=A_leave then send to die
# r5 P& W* d" w+ K/ O0 z3 V" l n else inc A_i by 17 X3 q9 r9 d, f1 U
end( M- E& k6 U& ^4 }. G7 |
end- w3 p9 z+ g0 Y: Y
/ n- ]2 [6 Q; d* n
begin P_pick2 arriving
9 `! N: V$ M8 X0 M7 H set A_i to 11% Q2 O! Y# _- I [
move into Q_induct2
- K' ^8 J% m$ P, D/ e/ D9 Y4 V move into pickaisle.induct2
! c; R# Y; W! O3 S( B7 U2 E/ n! p while A_i<=30 do begin7 B: W9 F: Y; ]! ~3 q
travel to pickaisle.con(A_i)* Y* d7 R6 U# w+ x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" h7 O6 k! D3 I6 A, [. ? else wait for 10 sec
$ G& M* ]3 ]4 x2 k# `0 h' k if A_i=A_leave then send to die( I4 P) x x& u3 Z" q6 X
else inc A_i by 1
& Z. j5 M* F j% ~7 n9 M end
2 }& h$ H) y: Y! Fend7 f( h: \$ `" h
: O0 u1 k$ D2 R- ^: [! G, xbegin P_pick3 arriving
9 R4 O7 {+ U; z$ @, a8 Q set A_i to 21
, ?$ k a) T- y2 n; X4 W4 y move into Q_induct36 E5 C, a1 ?4 e
move into pickaisle.induct3
* S2 u; Q2 _3 F( [; ?2 z* R" e& e0 _ while A_i<=30 do begin
9 a. ~: P% Z5 U8 u( Y6 G# `1 z4 { travel to pickaisle.con(A_i)
# w* z _/ k& D1 h" G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ X) m1 W( F% [1 M# _ else wait for 10 sec: K! q+ i0 t* q3 T/ x
if A_i=A_leave then send to die
) Y: I( Z" U @ else inc A_i by 1+ Z7 W/ ]% _8 Y# V
end
7 V2 u, h, ^2 b2 [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,其它按你的 ...
|