|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. w# ^7 G+ w. g* l+ p" B
! S- ^5 |% o) @1 P* P) Y1 i我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ C( Q; W, C/ N, v. X( }# g1 i
f% U6 r8 v2 g( l! Z$ hbegin P_read arriving, G2 a- \+ Q8 d! U- w5 L
while 1=1 do begin
: q: l" p+ P. k/ l% x. r read A_tote from "data.txt" with delimiter "\n"- K m4 a$ W1 U C6 u: G
read A_time from "data.txt" with delimiter "\n"
5 b2 x( c/ e/ b. _1 }% H$ [ read A_leave from "data.txt" with delimiter "\n"
( S8 M; z% f7 \6 D, | read A_picks from "data.txt" with delimiter "\n"+ K$ S. @# D4 Q5 J T
set load type to A_tote* m9 j# q, G& G- n# e8 s# ~, [ s0 g+ n
if A_tote="tote 1" then set A_induct to 14 n1 T5 C+ z0 X4 B6 y0 G, S
else if A_tote="tote 2" then set A_induct to 2! i! R* C7 W( Y) c* C
else set A_induct to 3 0 Z8 ~7 C8 h2 p5 K. E# ~
set A_i to 08 r6 p9 X4 A, S5 V1 k8 U% G
clone 1 load to P_induction! M2 l4 r4 d \: L( d
wait for A_time sec* g5 h2 [8 |8 ]6 S
end3 n. @+ {8 P, }( o+ ^2 `5 z" v
end
& J: X2 L- U$ l/ I+ Y
3 ~' w( [, a3 C X4 rbegin P_induction arriving; p2 ] a7 V2 S, t7 Y/ e" {
if A_induct=1 then clone 1 load to P_pick1
- g9 c( F! R) {. X9 \% W else if A_induct=2 then clone 1 load to P_pick2- T8 l% Z4 W+ f" y3 l' h
else clone 1 load to P_pick3
- @" o' i2 w: B. T* F3 V, ^/ c% fend2 i7 x* x; k9 g1 B; x# F7 E& @
% j/ y- ~+ t4 ]2 J* u, h ?begin P_pick1 arriving
, g3 ^" K9 `7 O4 I8 A. Z1 d+ ? set A_i to 15 q. L( Y; \: V
move into Q_induct18 _* x0 J; I' a" U- y
move into pickaisle.induct1+ K9 L( h, {7 X N6 z+ k
while A_i<=30 do begin$ v$ D3 Z% b) [8 B9 K$ R6 Z& R
travel to pickaisle.con(A_i)
8 g3 x$ B, C/ V* Q0 @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% r6 X# M( ~. }# A, r$ e else wait for 10 sec
+ g, I, `7 O- w: \+ X" v. s if A_i=A_leave then send to die
6 P( c* F; |( P1 H( T) M0 _( e else inc A_i by 16 _& H6 I& O6 e Q. \, q: [
end
6 Y; s, ~/ k! k6 o3 Dend
5 `7 M" c2 R; t z: G8 N% ~8 C" l, o) _+ {* m% `
begin P_pick2 arriving# l$ V3 `4 n1 J$ P1 x% X( d* N
set A_i to 11
- D$ T2 s+ S1 s9 @9 } move into Q_induct2- f: R3 F+ Z* V" Z% v( M! `
move into pickaisle.induct2" T$ C; m& f- H0 {) A
while A_i<=30 do begin
: k" {8 m0 T, Q0 d5 z: W travel to pickaisle.con(A_i)9 ]/ M% O) M" u! D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 }4 h; d, p; Q9 g; J
else wait for 10 sec
, R) b+ E& m* U, q, G8 F( w8 V$ I if A_i=A_leave then send to die, v, K3 J3 C+ V# m! z, i Y
else inc A_i by 1
* V! o* U/ n3 ?! L& q" X end
8 Z$ k" |! ~0 n: nend1 c# Z) n/ l w4 M Z
; H% ~ v( V5 X, gbegin P_pick3 arriving7 x/ y9 `' o T. o! k" Z
set A_i to 21
1 p! |' N: q3 q4 s |; { move into Q_induct3
" T, n; T4 E6 U6 _4 E$ k move into pickaisle.induct3
) o4 H Q7 Z) R( w while A_i<=30 do begin
! H" E3 ]; a1 ^" ]2 M travel to pickaisle.con(A_i)
% V: q8 @, l7 y, w3 Z9 s) y- X) q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* v( F9 |3 I& ~5 p
else wait for 10 sec$ _- a# T: \# {
if A_i=A_leave then send to die( f4 G& ~. F$ T# s- ~5 y
else inc A_i by 1
( s6 A/ P. G, {2 n6 A, s L end" J( c4 \3 S8 s+ i- N p! {
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,其它按你的 ...
|