|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 S3 I% G1 P N+ |# I" r
6 ~4 ^; V ?' b' a; x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( m. ~! j& _" V' W: T6 j/ z
$ R4 @/ y) Z% s3 X, \begin P_read arriving; s$ S* G0 B& F, V
while 1=1 do begin9 W8 _; \, s$ L% A. b
read A_tote from "data.txt" with delimiter "\n"
% ^( v, }$ P, K) I' c% H read A_time from "data.txt" with delimiter "\n"
7 b% w* C! g+ P7 d. ] read A_leave from "data.txt" with delimiter "\n"
; p* k1 N; o4 k8 L& [. l+ { A read A_picks from "data.txt" with delimiter "\n"
- y, a/ u1 @5 D set load type to A_tote8 Z! q* h; S3 ^3 d# D; w9 k
if A_tote="tote 1" then set A_induct to 19 H! R& `! Z Y' M- w! P# x
else if A_tote="tote 2" then set A_induct to 2) }' x) B+ t4 B- m- ]$ D: W
else set A_induct to 3 : p9 s+ M+ S N1 L
set A_i to 0
5 o3 i+ |1 \6 V+ U clone 1 load to P_induction8 Z' ~% p2 d( S2 Q; F3 e
wait for A_time sec
$ s6 h/ w) x4 c9 { end
/ U- V# t! T5 |" z1 J- n z0 hend/ T0 K+ g+ R$ q& }
8 z$ K% I* D0 xbegin P_induction arriving
. b' p/ ^/ i% H if A_induct=1 then clone 1 load to P_pick1
- `" ]% X2 E2 g# _/ t7 E. I else if A_induct=2 then clone 1 load to P_pick2
4 o; c& ?% t5 L else clone 1 load to P_pick3
. o+ B8 K+ L- |* `: ]' Jend
0 M6 e+ a" Q6 i1 X, `
- K( r3 ^9 G; K9 ~1 S: y$ obegin P_pick1 arriving
& g* o8 D" J4 h! s3 T; |% g0 q3 R set A_i to 1' h6 y+ K- \: G [, J
move into Q_induct1# _8 S& X. c: {2 [0 t2 B" F' C
move into pickaisle.induct1' ]$ g5 j G) u; F- l
while A_i<=30 do begin
; s- T+ ~ B! V | travel to pickaisle.con(A_i)
# F; [- q$ N) q: G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _) ]8 E5 i9 I3 o9 ?% F
else wait for 10 sec8 V3 V. S( X: U
if A_i=A_leave then send to die
; h, E, N5 T* E' R5 d( g) o else inc A_i by 1
2 _ h% T' n% `5 [5 O' ~/ b3 T8 I end
" S! c) o) {& jend
8 I( o( l- m$ p* V: G8 j, N& [! A0 l ~
begin P_pick2 arriving
+ e, @4 h ~. {+ J4 i9 o) | set A_i to 11
5 u, Q( b0 B# v move into Q_induct2
2 S- N7 W+ m" t7 o move into pickaisle.induct24 v/ ^" j c6 h% J3 L/ k, X
while A_i<=30 do begin
: y& Y, m X: k0 I9 c travel to pickaisle.con(A_i)% C) a0 ]0 W" ~; c/ S! @ m- \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, N3 u( [* H9 i( V E% k
else wait for 10 sec
& f- s$ F0 e P: {' W if A_i=A_leave then send to die3 l9 h. E5 [4 s* t* m/ L
else inc A_i by 1
; o: R* s4 ^1 v- T8 \& a end; o; P j `! I% {% ]( T
end6 I. A+ r. J5 v0 c, s
; N2 F# t `( n' Sbegin P_pick3 arriving
0 V+ i7 I; _# f set A_i to 21
; b) E% b0 O: @" y$ D4 s7 a$ @3 J' T* Z move into Q_induct3
4 `% G% }" z4 r, Y7 Z4 x: c/ p move into pickaisle.induct37 J# L8 o/ U6 S, b* ~
while A_i<=30 do begin
9 k4 I( Y9 r, n+ f: p) m travel to pickaisle.con(A_i)
3 V; p& K' x8 ]' ^% g: g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ _& L7 @: [: f7 V5 L else wait for 10 sec
2 T" ^9 [. \" W if A_i=A_leave then send to die
: T2 g' i5 q5 \ else inc A_i by 1& t6 R# _2 Q# S. m
end8 I, x6 ~8 G; a7 b. |$ p5 ?
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,其它按你的 ...
|