|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! G: M! L$ ]" h2 Q
! |! k! p+ l; r h) A我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ T! S/ f/ o, U$ z! C4 ^
- A3 c+ Z$ a6 W: t+ j
begin P_read arriving# H/ v$ E1 @7 A4 u1 I2 V
while 1=1 do begin ~2 _0 @% V4 Q" l
read A_tote from "data.txt" with delimiter "\n"3 n! ?! W/ j1 W! m
read A_time from "data.txt" with delimiter "\n"
0 ^# x8 ?5 J j" H read A_leave from "data.txt" with delimiter "\n": X) k2 H* K6 b \8 _' A
read A_picks from "data.txt" with delimiter "\n"
% T" y* f$ K) j4 t4 I5 ]9 m% n set load type to A_tote
4 T+ i7 _. x. q1 x) x% Z8 X( a if A_tote="tote 1" then set A_induct to 1
1 \# f2 ?( I1 [/ r1 A8 \& Q else if A_tote="tote 2" then set A_induct to 2
7 e4 v6 C% R$ k0 y0 x M& n else set A_induct to 3 A! H& \" u: x; b7 m6 J7 R
set A_i to 0 k( n. I8 V. `% r- n Z
clone 1 load to P_induction' T; \ q! |' D9 A
wait for A_time sec( s6 } t( W# ]& T2 ]7 J% m
end! S8 q; S% t9 t0 y2 K
end7 j$ F+ x4 [; h
1 f# l4 {( R) {- a, r D* Obegin P_induction arriving% V0 N. y6 f. T1 \
if A_induct=1 then clone 1 load to P_pick1) x9 H4 p, T8 h6 C
else if A_induct=2 then clone 1 load to P_pick2
& m4 R: y8 O) ^: [5 y0 t1 @ else clone 1 load to P_pick3
3 R* D( ~2 n& jend
# R9 y0 }9 N2 Q0 r
P% f$ Y( _, p% f6 @" O sbegin P_pick1 arriving* z; W( |2 |7 O& O" N1 o6 @. Q3 N
set A_i to 1
1 W) T7 d3 E3 E; W! ^) I move into Q_induct1
1 M; G3 z) E( `* A3 O4 T; ` t move into pickaisle.induct1
4 D M1 B4 s0 `+ R7 H while A_i<=30 do begin
7 r0 C) l ]' q. g. x( k travel to pickaisle.con(A_i)
7 n, w; s/ S w9 t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% d7 M3 o7 Z7 Y: ^4 Z& L9 G, i else wait for 10 sec
8 Y1 `$ X8 O2 ]. Y$ f8 M# ^$ n if A_i=A_leave then send to die4 m7 h; s4 m2 \( P2 X7 F
else inc A_i by 10 m4 l) b4 d2 g
end5 e# e" U5 a1 W) a' P, C
end
: C+ `3 { ~& y5 N) _* m! [& `% t$ P! O" {4 v% N5 ]0 u
begin P_pick2 arriving
" Q$ L7 N5 N: s% o5 I% ? set A_i to 11' g5 L3 B, C5 C$ v/ {# ~
move into Q_induct2
+ ~: |! m7 `9 w9 |' z) c+ y move into pickaisle.induct2+ L* Q. P5 M' c4 F: O
while A_i<=30 do begin
7 o6 x9 f' x6 }3 l' C8 ~4 i* f) o$ D travel to pickaisle.con(A_i)
. k) w( a. R( [% i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# m H( t: r4 _/ _+ }2 U. I- V+ a else wait for 10 sec+ G+ N2 n2 ^: u: e1 F
if A_i=A_leave then send to die: j3 I$ g+ m# R9 @
else inc A_i by 1
' I7 f& M2 D! k+ N end6 _4 ~: f" L& [$ _0 @
end b# X6 c5 l/ p N1 H, V0 v0 w
4 u" L2 [3 L0 }" @6 _$ y
begin P_pick3 arriving! {; O% i* j7 P
set A_i to 21
3 ]8 Y9 ]+ G: U* J9 Z move into Q_induct3" p; W4 l8 ^9 Q% {/ g; S) W" p
move into pickaisle.induct3$ [# c* D7 K: ^3 i
while A_i<=30 do begin% U7 ^1 {: u7 c- l2 ]
travel to pickaisle.con(A_i)
7 |$ t7 \7 Z% M6 R5 T7 \! { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* e( ?; |5 n0 O* p else wait for 10 sec5 A# b% h4 T2 | `* \; I
if A_i=A_leave then send to die0 k3 v9 x4 K8 H) {
else inc A_i by 1
) p( v- S2 u; d# ^ end
2 X! P% D( [# h* E7 `& ]& \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,其它按你的 ...
|