|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 N* B3 g; C7 x* L; d ^
8 b, N% `3 [3 o/ n$ e我的问题是,在每个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中的数值,不知道会不会有什么不妥。# j, a* r9 G% S
9 D( ^7 w. C# S" t" D' h
begin P_read arriving. `1 m/ q3 N; _: D ^
while 1=1 do begin
: q0 s4 E8 r' ` read A_tote from "data.txt" with delimiter "\n"
* t+ H, T7 n. L+ X0 ?+ Q% h read A_time from "data.txt" with delimiter "\n"& q1 s9 T. h( t7 B3 I
read A_leave from "data.txt" with delimiter "\n"; N0 O; b" ~- `3 c8 ~9 _
read A_picks from "data.txt" with delimiter "\n"
/ R% j9 C0 J+ b: u' | set load type to A_tote- y1 k% W! l+ A4 c0 v
if A_tote="tote 1" then set A_induct to 1" h* P$ F2 o: r4 \1 r# Y
else if A_tote="tote 2" then set A_induct to 2. Z6 j: R8 e# u, l6 A! f" a; U
else set A_induct to 3
j9 M( Q d5 t1 { set A_i to 0! B& F6 \* V- X$ B* T
clone 1 load to P_induction
& X. l) }3 I$ h, F3 [3 y3 L8 K wait for A_time sec
# ~0 o9 I9 o4 }9 P9 n end
8 A/ b; k$ _" k4 ^& t9 Iend/ h" [; r* W9 Y- h0 V
" W, q& |; w4 m7 wbegin P_induction arriving7 g) Z2 A8 c O# ^
if A_induct=1 then clone 1 load to P_pick1: _ H# o! w* d' A# X) Z
else if A_induct=2 then clone 1 load to P_pick2
0 V( T$ d8 z* Q, c+ C6 n8 y) C else clone 1 load to P_pick3$ {+ j' W$ k6 r2 \5 B
end
; f% S# L, j+ B' S2 ?: G# W* B; F/ t$ ]2 v' Y& X
begin P_pick1 arriving
P# z+ N8 A7 h- k+ p/ O! [ set A_i to 1! _! R, `9 R: B+ \' g
move into Q_induct1, [( x8 g& X/ W' J4 D) e0 U) p$ G
move into pickaisle.induct14 @# s$ N# B7 @4 q2 m6 _, b
while A_i<=30 do begin
* N- N) K9 Q2 D& s$ s travel to pickaisle.con(A_i)$ j% D( g2 e. ?) b$ H4 P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ z: L! V0 z d& x
else wait for 10 sec) W" _% Q$ n* J% N* m
if A_i=A_leave then send to die% `. p4 Q4 H8 k# Z7 x1 Q$ @
else inc A_i by 16 K, x* l# r7 I, b7 _' C. g1 {
end
% Z1 O! \& M, fend
j2 I0 Z% Y/ |( y0 T' ~# E6 ]* q8 T* \: @
begin P_pick2 arriving) j( w, c9 `( g
set A_i to 11
) u/ ?1 B% d0 A4 ~0 O D move into Q_induct2. t7 M, r+ e5 Z8 H7 ]8 l( v) \
move into pickaisle.induct2
+ f# x1 E; ]4 J# [. b* ~4 o! { while A_i<=30 do begin
; R& J3 \& O9 [' \ |) t$ R travel to pickaisle.con(A_i)( `7 g* ~ K1 t! w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! _( T: P6 l# @" f" Z else wait for 10 sec
3 X; J- C8 O% ~+ m9 }1 d2 B if A_i=A_leave then send to die
U6 x7 }0 M6 f( B else inc A_i by 1) r' U: {! u; P* v
end+ B& p! z$ ]. L( @- g4 G7 x3 y' K/ ~0 j
end
2 V7 Z7 ~- J, S7 J) C7 u3 B% ~
) _7 B: f9 I, Tbegin P_pick3 arriving
& K; W& o" _$ s. ?9 ]: c set A_i to 21
0 A- ]: \6 X2 A; i- ` move into Q_induct3' n' z, b- x1 E1 S
move into pickaisle.induct3- ^* E# b, V2 A& X% J0 F3 V
while A_i<=30 do begin0 o! Y, L; k( g6 l0 `/ d/ O2 a
travel to pickaisle.con(A_i)- L, o* n6 b8 G2 G$ w' k# q% m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ B$ w2 A' t+ l8 g: h' @0 |: x8 G
else wait for 10 sec
9 K! q" Z2 B' i' G if A_i=A_leave then send to die& i6 x1 y) x* K
else inc A_i by 1
. \ j% y& j; H2 w. U end4 @; s) a" O# l: Y( G4 D
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,其它按你的 ...
|