|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 k+ w2 [' n' [
- Q9 n! R+ C, g/ 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中的数值,不知道会不会有什么不妥。
1 z7 Z% i6 Q. E8 }1 |+ q- D2 H" _8 s! W* M" Z
begin P_read arriving! `; b2 U4 b7 L, R
while 1=1 do begin, W4 Z1 g$ f9 g, X% C- x# `
read A_tote from "data.txt" with delimiter "\n"+ I8 k) q+ f v0 I
read A_time from "data.txt" with delimiter "\n"
) \& a: h" U5 _- l" d& D read A_leave from "data.txt" with delimiter "\n"4 e; o* V$ D" s: Q
read A_picks from "data.txt" with delimiter "\n"& p2 _: a1 l+ T
set load type to A_tote8 e/ x3 x7 J1 e6 {5 L
if A_tote="tote 1" then set A_induct to 1
- P. H6 g# ]8 z+ U: } else if A_tote="tote 2" then set A_induct to 2
: U8 r1 y: n/ m4 O! [& j else set A_induct to 3
4 y1 a! \+ Z4 L, l; J6 V set A_i to 0/ ?* M) J# u; v' z" Z0 \5 r
clone 1 load to P_induction
: F4 O' a+ k. L" z: x wait for A_time sec; X, \! S# f, ^$ v v$ K
end9 r3 V5 B! F; B! `4 g
end' r3 ?4 C! w2 N" \/ j6 g
8 y* L+ V( U O3 Q+ Pbegin P_induction arriving% Q5 F T# y& ]1 g, d2 X4 a! ]
if A_induct=1 then clone 1 load to P_pick1
( z! ]2 f W1 m* u0 l else if A_induct=2 then clone 1 load to P_pick2
$ [+ A+ d8 [" E) j6 f; _6 P else clone 1 load to P_pick3
/ g3 a& e3 @" D7 h; {1 |) i; V6 X8 Rend2 ^3 \; i$ L: n! P7 _7 b: t# X
8 ^0 p( l; X+ [' c
begin P_pick1 arriving; @% Q2 r" E6 i* W5 L9 n7 E
set A_i to 1
2 i' Q1 V( W5 a1 `3 | move into Q_induct1
9 ?& y0 [& r2 Q: l move into pickaisle.induct1& S8 c9 D+ x( N( L4 [2 B5 U7 q
while A_i<=30 do begin- c: ], H, i: _% G8 ~
travel to pickaisle.con(A_i)' }( N0 G3 @7 \! @$ Y7 a' m+ m; S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- _% v- U0 Q' b1 H! y
else wait for 10 sec) R1 J! _. p! |: r1 s2 _) f+ e
if A_i=A_leave then send to die5 ^! o$ t( c- C8 d( f4 e
else inc A_i by 1
0 k* m% d( |1 Z/ N+ k5 B end
3 |' A' ?0 o& t) _/ Aend
; ~! [ R( O) p7 b+ [
- b" h$ I+ H! U- q/ p/ q6 A0 i; cbegin P_pick2 arriving
& }; F6 i O$ |& G4 @! v) Q' U set A_i to 11 G5 r/ x1 a9 h2 V* `
move into Q_induct2
0 O5 I) w4 W$ ]5 C0 J move into pickaisle.induct29 n3 R A7 I* @- V5 U
while A_i<=30 do begin" M2 {+ A2 o: _$ d u
travel to pickaisle.con(A_i)
G# o! N* T3 q4 |& K2 X/ O8 z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 O! Z" i+ C( w* `8 j
else wait for 10 sec
5 g3 B2 J% @* F' N$ v* L3 X* A/ M if A_i=A_leave then send to die
1 s( Z v: x; H9 w4 J0 Q; |* Y else inc A_i by 1: i, ?8 ?. d, D: w: ^1 Y7 W
end% w4 P2 f9 ]! `
end* |( J1 ]1 T, Y. j% }
/ L- B1 L6 b8 u6 { M4 |begin P_pick3 arriving- W F5 u; Y. I9 j
set A_i to 211 ?+ j7 I$ Q7 h- G& | e2 _
move into Q_induct3- U. q$ l/ t; z- h7 S! m% |& n9 t9 W
move into pickaisle.induct3
# K; J2 j( H; T* P$ Q- r) ?% ]" x while A_i<=30 do begin' |4 ~" `; W- _' `4 _
travel to pickaisle.con(A_i)2 d, l# H6 w3 E4 d: p6 q# l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' c" u+ ~7 P- l) L else wait for 10 sec5 N4 Q: }' {+ j: h, T3 e
if A_i=A_leave then send to die
( r9 k j3 L( R; H; t0 x else inc A_i by 1$ Q. `" P9 w! b( P3 _9 [+ ^
end
. I g \% O: zend |
最佳答案
查看完整内容
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,其它按你的 ...
|