|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: e J) U( T' u7 G7 j
: D x: r- L+ a, s; C$ j8 n# y" ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ f% Z( A& s: v/ @/ a ]9 T: W4 K; G9 v) u' R1 q
begin P_read arriving
( T8 z( T0 z3 z9 r while 1=1 do begin
! f6 [8 _1 m- }6 W read A_tote from "data.txt" with delimiter "\n"1 S4 ]3 c v8 t6 E5 Q
read A_time from "data.txt" with delimiter "\n"
* v# B' Q9 m; D8 }' g read A_leave from "data.txt" with delimiter "\n" E: A; c! F K3 ]8 }
read A_picks from "data.txt" with delimiter "\n"* ?2 c: A1 w; Y1 B- N
set load type to A_tote3 L( T. F% Z- |# B6 }! d
if A_tote="tote 1" then set A_induct to 1) o2 g! F- ]$ H
else if A_tote="tote 2" then set A_induct to 2: M1 ]. u, _% S4 Q ^- a$ F" ^
else set A_induct to 3 ' P2 b4 h- b; j* ]& ~; {; D
set A_i to 0. I. o% {6 ? l/ \# V
clone 1 load to P_induction
' D& U( w: f2 L1 {8 F wait for A_time sec
: q8 \$ |# y. ^0 ~* H' A8 M) T' Z end
, \4 h/ n. e9 ]0 }0 ]/ V$ Cend* {4 J' Z6 b9 N
0 e% p! o8 u2 q
begin P_induction arriving% K. x9 _# l- c$ F' n3 e' A+ A
if A_induct=1 then clone 1 load to P_pick1
9 l$ ?9 z2 W, k& K) q; Q1 |- T else if A_induct=2 then clone 1 load to P_pick2
8 P6 E4 C. W. m* Z, k else clone 1 load to P_pick3
' Z. n7 L8 }7 e6 J' d% F# k4 ]end( Q% j* r1 {# {. F: {. j4 @$ {6 q
7 O( p: G' A% m/ g4 q2 X1 k" {- pbegin P_pick1 arriving
" G1 N) s; S+ h; Y8 j2 Z" T set A_i to 1) r$ x* q/ Y- Z2 [# @+ ^1 v
move into Q_induct1% ~* y' z0 m4 v9 v! d) a% s
move into pickaisle.induct1
, Z5 `& n) [, W ] while A_i<=30 do begin4 y2 C: j! P6 ^
travel to pickaisle.con(A_i) n/ `, w6 J& G* O1 l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ `8 ]+ n( G0 q/ U4 D else wait for 10 sec
9 l& ^0 B6 w# w8 C+ }% _; a6 B if A_i=A_leave then send to die
+ ^3 O* B, ^: A& T: Z else inc A_i by 13 B" y- e1 I3 L/ F2 W
end- U* N$ j$ p- [, _
end4 y( ]. h- M$ }# x. Z' |2 d9 R
. u9 G: ?1 V0 b
begin P_pick2 arriving
: J6 b, ~& f& V% Y" j' N set A_i to 11
0 X# ` ]1 _5 k/ @8 p9 { move into Q_induct2
' S' S# h4 C2 f$ F9 ?/ ? move into pickaisle.induct2
* X/ ]4 T' \2 D L3 X# E1 L2 M while A_i<=30 do begin. b0 N+ O& P" E+ x
travel to pickaisle.con(A_i)
# ^! e* x$ ~" x' |; ]! r! m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# f# @5 E1 a7 B else wait for 10 sec
1 O% m8 [6 ?% r8 G5 _ if A_i=A_leave then send to die: d+ d( B" F5 V; }
else inc A_i by 1; z. o1 @, a! M) w
end
. y8 @) A P; |& Aend% R3 M. }& i% E+ F$ d* |0 X) |+ O
7 B4 ~" m, s, X! n9 f( H
begin P_pick3 arriving( \& B" B' `$ G* O, d% Q
set A_i to 21$ ~ X" y% ~6 l
move into Q_induct3
$ T) U: `# g6 j( E move into pickaisle.induct3& Q% U9 L: d V
while A_i<=30 do begin
4 I0 u) _, y4 x: F/ y; Z7 e1 v travel to pickaisle.con(A_i)
' W; f- U- g" l7 N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# B3 c1 T* p, r( N8 G% j* M v% ? m
else wait for 10 sec3 x( V8 B1 S* i; ?7 w
if A_i=A_leave then send to die
9 n2 D, u/ a5 e* A Q" T else inc A_i by 1) L9 H- V1 i9 n2 g: }7 P3 ?5 k
end" Y: ~* {% q' x
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,其它按你的 ...
|