|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. n/ L7 P2 `+ x7 G0 `# j
- V5 S9 B+ o) f: b, G! 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中的数值,不知道会不会有什么不妥。) q( j9 a* y/ Q) W
5 Q! J. J( I hbegin P_read arriving
* a) t/ T+ n0 m* D3 N6 s# H while 1=1 do begin
j+ ?8 h) e' D: Q5 L' W read A_tote from "data.txt" with delimiter "\n"# t8 g7 R" V5 I1 H
read A_time from "data.txt" with delimiter "\n"
4 U# b3 V1 m9 l7 y read A_leave from "data.txt" with delimiter "\n"* M$ T5 h, c" o. V3 g7 Y
read A_picks from "data.txt" with delimiter "\n"
: W" |5 T; W' ] set load type to A_tote2 a) }1 {- g, g8 K3 I& g. V
if A_tote="tote 1" then set A_induct to 1
$ ^( ~ z9 o2 o n0 \% a else if A_tote="tote 2" then set A_induct to 2
; P1 N6 M8 `& V* l4 T5 e8 D5 o& j else set A_induct to 3 . V! t/ X5 U4 n j; V
set A_i to 0
1 X* u) p, ?+ A7 k/ \ clone 1 load to P_induction
: a4 h; c# v0 q$ }# Y7 c, l wait for A_time sec2 y; D% [, J! w3 Y' s; m
end
8 r% c5 t7 t( H# T1 i7 n2 ]8 tend
, J: k- y& n8 B* x3 D# L+ \. y3 c$ |2 K$ ~* Q6 U, }, ]
begin P_induction arriving
- j# r; V$ q1 o: r# @ M. [ if A_induct=1 then clone 1 load to P_pick1+ {0 _* r# G2 J6 x
else if A_induct=2 then clone 1 load to P_pick2
3 Z: V4 E4 ]+ h; P: z* E- [ else clone 1 load to P_pick3' C5 l K3 E% {
end$ x! c2 V L8 ~" W) y! T; _ `
# n( `* @% O; ^* g1 C
begin P_pick1 arriving
& R, F( ~* u4 K" a% k8 i1 O/ V' J; x set A_i to 1
2 T5 a" f7 ]3 W" q! [- e move into Q_induct13 h3 l6 v, Z* l- |$ X1 V7 C
move into pickaisle.induct1
! [ O$ L# u$ q$ e$ w while A_i<=30 do begin
{! N" z. m5 I1 a travel to pickaisle.con(A_i)0 V; P* b) a- X7 E3 m8 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 B" y" e9 ~; y0 N% ]' Z6 f6 Q else wait for 10 sec& }$ o/ B* s: b, n
if A_i=A_leave then send to die
! _5 h O S# x- n else inc A_i by 1
) X- f0 y6 ]$ [, y8 s end. k z5 v5 w6 I$ a5 Z2 T1 y: x
end; M/ V, ~+ I9 c7 x
0 n+ B3 ~) r |9 l' b' s" lbegin P_pick2 arriving( a( c& X" H4 |3 u- F/ }
set A_i to 11 Y. I2 z" j6 f& B- e' ]- @2 ^$ r
move into Q_induct2* l/ j: d/ J& ?, O0 c6 {% e
move into pickaisle.induct2# u& G \$ M) L7 F1 h2 B
while A_i<=30 do begin+ `8 z7 o+ j% m* c
travel to pickaisle.con(A_i)" L6 b! T* N8 J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ Z& f. m2 R7 O* C( k else wait for 10 sec
7 c9 y: | J" K4 P0 ] if A_i=A_leave then send to die" b [0 F* a0 @3 N' n
else inc A_i by 1/ y, Z+ w5 {3 z9 p
end; a, j& D% |9 o p
end! ` n. d' l1 n4 Y' @& u3 O h
% l. R7 L4 t, h" k% l
begin P_pick3 arriving
$ T! E/ b5 X1 {0 S- F set A_i to 21
) |; ]' s0 z1 I move into Q_induct3$ e+ e' M- ]' l, ?5 A" p
move into pickaisle.induct3: Q/ b8 e1 f1 T" c( `
while A_i<=30 do begin
. @% | T/ e1 M) Z0 M travel to pickaisle.con(A_i)' v2 Z4 R9 H% q. C0 V9 d! s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 \# F9 C2 l4 ^: M# D2 V* g' u else wait for 10 sec) \$ ]+ B9 z8 m( |1 h$ ~* c1 N
if A_i=A_leave then send to die
% N5 d+ q* Z4 f( q" f3 j8 p% S5 ^ else inc A_i by 1
; Z! C7 v5 ~, l; Z9 } end+ H4 @( ^1 W5 c( d* B
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,其它按你的 ...
|