|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" C" l/ {; R3 \ {8 n! R, a) t. W
. j) f7 b$ `# j) ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ }1 h8 k8 f2 g" d. A/ R7 B" p
' J {6 T, E3 i2 ^. l9 p, ]begin P_read arriving
2 O. M8 g; X3 K& z, P: C while 1=1 do begin
* Q4 J z- s l read A_tote from "data.txt" with delimiter "\n"* Q1 U3 {' ~% ~2 Y
read A_time from "data.txt" with delimiter "\n"
( \8 A! g8 r0 y+ R$ y6 t read A_leave from "data.txt" with delimiter "\n"+ i' B$ b7 C" g( p# i: g
read A_picks from "data.txt" with delimiter "\n"
: X. x0 H! u. s! {8 { set load type to A_tote8 |4 {$ d7 Z) y5 m7 Y2 j; \
if A_tote="tote 1" then set A_induct to 13 x+ o8 E) V' q% e
else if A_tote="tote 2" then set A_induct to 24 `) B& k/ {7 n5 w
else set A_induct to 3
) {8 v) g6 \2 z set A_i to 0! q' j+ g$ m: E" h* T! h$ |
clone 1 load to P_induction" i; M. M3 f4 j) Z! o
wait for A_time sec
! v5 _- r$ l$ W7 e6 j3 N% S end$ E( a* D7 B$ F! h* Z+ W# w
end
( C) b1 | l3 l8 c2 X3 h% }# P
5 A! {* ~& z* r: l }- C1 {) zbegin P_induction arriving
! s: {! G2 K' ^4 I5 j$ M if A_induct=1 then clone 1 load to P_pick1
+ [$ S w: E% o+ }! w9 Y7 C' h else if A_induct=2 then clone 1 load to P_pick24 ~7 g+ y% s; I) y! h3 N
else clone 1 load to P_pick39 J$ W1 `5 r* h4 `/ ?( a
end
( u/ @; w& k1 L+ _5 ]/ z8 `1 B
* Q1 N7 Z( M' C) |- e) x% g/ kbegin P_pick1 arriving
& v4 g0 }3 t4 O0 W set A_i to 1
0 m! `0 |: S4 Z' ]( c& \+ x move into Q_induct1 D8 X, j- ^+ H* ]9 E
move into pickaisle.induct1
5 `& }) L& ~5 N) J$ C while A_i<=30 do begin. i8 h, b0 v1 u
travel to pickaisle.con(A_i)
" B! `- ]" g$ W1 D' `. g/ c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 {3 S N/ {5 c, o: @3 @ else wait for 10 sec
0 F' | `: o' L7 Q- u1 x. g- M if A_i=A_leave then send to die
3 u; X* x2 q( U! w else inc A_i by 12 V2 V, f- @) z' x
end" ]3 X- J1 Y" n; I
end/ @, T1 V; A& V) D
4 I# \ Z8 j7 Y" g' Z$ _
begin P_pick2 arriving
6 D% o# c& ?& }2 s+ u* m5 ] set A_i to 11
; a! L( I( p% X/ h% Y; _ move into Q_induct2
) |- z$ y% v: e* j) b! H0 e9 q move into pickaisle.induct2
: I/ O2 `) ~2 [! B while A_i<=30 do begin! A! E& _" b j) X' @7 g
travel to pickaisle.con(A_i)5 M6 M! a3 C5 `9 z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 U' K+ `1 V# A$ l/ B" O" p( e7 Q9 }
else wait for 10 sec* m* x% g4 U3 @- Y
if A_i=A_leave then send to die" k, T" S! H' O* i5 C3 k9 O0 I8 l
else inc A_i by 1
5 ]1 L. w4 f4 t/ R& x/ R; c' C end6 J" V2 V4 Z" c9 U, h
end# }* W- h5 I) G5 ]1 w, `1 @4 a) c
T; ]: m; A0 d
begin P_pick3 arriving
7 Y/ T6 n) B+ i$ E' p' p- D5 i9 | set A_i to 21
& C" D! V- b4 z0 ^1 L move into Q_induct3) S l' e) R# L; w3 }
move into pickaisle.induct3- N6 {$ G- Q! G$ l" `
while A_i<=30 do begin
6 ]! k2 C) j8 {' `; ?7 r' ^7 N/ @5 M travel to pickaisle.con(A_i)
1 q4 L& u; P0 l% _ u5 Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 {: N8 [1 s. o* K- v+ I3 a
else wait for 10 sec
' G/ ]7 R3 e9 R& r if A_i=A_leave then send to die7 r) S7 ?% C. X1 z
else inc A_i by 1$ S4 C6 E9 O! @ C+ d9 W) _
end' d r( _" G3 v* \0 s
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,其它按你的 ...
|