|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, }+ K2 r( C+ F; X
G$ g F [) E8 x* V2 K我的问题是,在每个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 B2 a: w7 U4 K8 X- F+ @
- _" y5 ]% q6 U$ R8 }6 _begin P_read arriving1 M1 z! |) c, v
while 1=1 do begin
& h' s$ `2 k0 H8 m* _( ^5 o2 D! a read A_tote from "data.txt" with delimiter "\n"
, q" B8 I3 V( w' @8 b. X read A_time from "data.txt" with delimiter "\n"0 F' d8 s, \, r; T7 ~* |/ M5 C2 X' z! u
read A_leave from "data.txt" with delimiter "\n": \5 `+ q/ S3 X% S" m" F
read A_picks from "data.txt" with delimiter "\n"
1 g8 R% U. w$ T. M set load type to A_tote' _. f7 _$ b- H; e
if A_tote="tote 1" then set A_induct to 1
( ]# A# m' s O else if A_tote="tote 2" then set A_induct to 22 F+ f v2 m/ X5 k# T* {+ I
else set A_induct to 3 / d9 x8 W: r+ h2 d8 \. A* z
set A_i to 0
" m( P8 C) k, V( S! G clone 1 load to P_induction: \& N: {! T; j; g6 V( s
wait for A_time sec
# s0 g" A* K7 t end: L' ]9 O9 `# Y* }# Y: o1 w) E
end
( U4 W& p/ x1 ?: J
6 Z1 t0 m% A, @& i% Y8 W# qbegin P_induction arriving
; u, j3 N/ f8 Y& m if A_induct=1 then clone 1 load to P_pick1
# S; `1 D4 H0 P$ _; R( Y8 p else if A_induct=2 then clone 1 load to P_pick2& b% S( |, ~7 @, L
else clone 1 load to P_pick34 M: L2 ~/ M4 e2 M. W7 F, ~
end* c9 E+ g6 p2 Q
% s& \/ z9 m) X/ j1 @- t0 F' C
begin P_pick1 arriving
0 ~' v6 H4 R; ^% G" J! n set A_i to 1; R6 s v& b7 i+ {/ Z0 L
move into Q_induct1
" A( v, H; J0 T+ L- j move into pickaisle.induct1& r" X$ y7 X$ K4 S" l* M! I
while A_i<=30 do begin( u; X5 I% S; f8 g( d- |
travel to pickaisle.con(A_i). ]7 S, U( ~& k# Y" }0 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 y$ Q! j" m( m6 |& f9 {
else wait for 10 sec6 b% s5 l8 ^7 M" S& G# O/ C
if A_i=A_leave then send to die
" ]4 P* K. C% F else inc A_i by 1
0 t, f H) U0 s end# z+ i4 S1 c. }+ a
end
! i5 K4 b3 m* F. q; G* I2 s- s9 f5 Y# i: r$ r! J5 N% P
begin P_pick2 arriving
& D4 k$ d/ R, f8 F, O set A_i to 11
% J% Q& |5 @5 D9 z7 A- v/ w move into Q_induct2 l" d8 n9 q7 K, F0 W- g9 s
move into pickaisle.induct2
A- H% w: I) z/ E0 Y$ u6 P; {4 p( d while A_i<=30 do begin
, G- i9 { W. i& P3 I travel to pickaisle.con(A_i)
! e5 w2 G. o+ [# ^% p* z* } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ t! S% j6 A& S+ Z! n" Y R
else wait for 10 sec' D) j- Q, f- S
if A_i=A_leave then send to die
7 F9 L$ v+ }. O2 ^( M! ~ else inc A_i by 1
7 w7 g }/ l+ K; N+ z+ D end: h- q% S. W# L
end; l2 E4 Y9 {( K' r% F
1 R; y# @9 c1 g( z5 [2 hbegin P_pick3 arriving
! r$ k7 l; x. V! p; D) ]" P2 o set A_i to 21
' w% z. Z# z9 g move into Q_induct3
0 Q+ W/ E# I: E) U ` move into pickaisle.induct3% x& a1 `9 Z O" G5 Q9 b
while A_i<=30 do begin
1 S9 C8 ~' T( l% w travel to pickaisle.con(A_i)% T- n' r! \. y. k7 ^1 x8 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 [( q; H% I% R2 Z- ]: w$ |3 R else wait for 10 sec Y, Q0 q5 c! l0 A
if A_i=A_leave then send to die/ F# J& @! J# H0 C) `
else inc A_i by 1
% }5 k' O$ L3 n. B7 o% s end
- I( g* S9 D8 \5 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,其它按你的 ...
|