|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: F$ c8 U% Y$ b$ P1 I3 q. N1 m4 ~1 U: ^2 N- f4 K: p- L6 Q# n
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 \' ?/ [( Q% c; I( k+ m* l9 A
- t, q. @# T1 G/ I; {* f& Lbegin P_read arriving
4 y" P5 ]8 ~# O( W5 e( e+ g; j0 M while 1=1 do begin! M& N& |. T* s- v* F
read A_tote from "data.txt" with delimiter "\n"+ o; o5 S, n8 R4 d, ^
read A_time from "data.txt" with delimiter "\n"
( ^9 {! \9 j1 I; c read A_leave from "data.txt" with delimiter "\n"4 ~: J/ L* o% H3 C/ l
read A_picks from "data.txt" with delimiter "\n"
& Q/ ~3 O D6 A set load type to A_tote
0 [1 z- ]; M5 n0 Y6 \: F) l/ V8 i9 C if A_tote="tote 1" then set A_induct to 1; Q: n( t9 Q2 [+ O
else if A_tote="tote 2" then set A_induct to 26 a4 g( h* D4 H% f
else set A_induct to 3
5 h8 s, Q7 Q) U5 a l0 o' A' Q set A_i to 0$ P8 G% \) D# d# C/ k4 x+ D" R
clone 1 load to P_induction5 q! u9 G J- r6 }" D( y
wait for A_time sec
; P1 S4 S: \, T1 H* V- x! q end
# J4 E2 j7 [. Z$ ]" _( c$ jend e8 K! r, }: Z1 L
: G6 d1 m1 {& Z* b4 I& M" v% ]) p9 rbegin P_induction arriving% x' m4 j$ v, j% T# Z4 w/ A9 w
if A_induct=1 then clone 1 load to P_pick12 ~6 U- v* _, C" O
else if A_induct=2 then clone 1 load to P_pick2
; @! Z; y+ y" u. N6 P else clone 1 load to P_pick3* w; Z0 K8 [2 [) R: Z7 Q
end
4 W% q7 G% m+ U6 K5 \) M0 s; L3 g. ]) d% X
begin P_pick1 arriving
( b0 c$ Z5 P4 T- M set A_i to 1
2 s4 d# v O" \ move into Q_induct1
9 o: g: E7 Q7 v! O: u move into pickaisle.induct1
( C8 ]* r, o5 g while A_i<=30 do begin
4 I4 d* [9 C x& K) j9 h5 G8 I travel to pickaisle.con(A_i)% v* F9 x( X/ Y' c% l4 M+ b5 I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 \% [4 g6 ]8 P
else wait for 10 sec E4 H/ }7 k; E# h7 i$ @; B
if A_i=A_leave then send to die" ~6 D7 E6 ?- |( r- j) a( ]% F
else inc A_i by 1
" s1 O4 ?. r5 S9 D2 L end& B3 ?3 g2 o( }
end
; e: l! _& S4 s
# l/ B) v# F! ~0 o6 c0 r8 Q/ Tbegin P_pick2 arriving1 r3 m* Q* ^$ F3 b, H ]1 y" z4 U
set A_i to 11
( T+ m% y- c! O4 b% g1 I: J" r move into Q_induct2
$ ]4 o3 h; b) J$ E" ]/ h move into pickaisle.induct2
& o" U& p" Q& y. W while A_i<=30 do begin
6 f2 Y* T& d i5 m- A% U travel to pickaisle.con(A_i)$ N/ J+ ?, p4 Y2 T; z- |3 S0 w7 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
E2 F9 B1 C. o4 ~0 U else wait for 10 sec
0 Z# A* b0 Y: ]! \; z5 Q, f: d if A_i=A_leave then send to die
; g }8 |2 `/ e9 G4 z: p else inc A_i by 1
. S# C1 ]8 V+ i9 W( l* i# f end, y( y7 @4 s6 V8 @* A8 s
end
% ^5 O9 V t9 K* S2 ]' s$ q) U4 L" j# R( g
begin P_pick3 arriving
- Y2 k$ L9 a. v9 r set A_i to 21; i5 N; d8 R0 |5 N" _
move into Q_induct3( ^4 b* K% `% J/ q) B
move into pickaisle.induct3
- ?3 y4 J, V" Q3 e0 m while A_i<=30 do begin# O1 Y) l O0 F8 l# a/ D; |# H( D
travel to pickaisle.con(A_i)
/ l5 t+ L* t- B& a3 q$ W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, | B( i) R( n+ Q
else wait for 10 sec# a7 ^9 P7 E4 D" j/ ~; u# _# e
if A_i=A_leave then send to die
% O j5 `6 p0 u6 a* `- E else inc A_i by 1
+ `9 o# y: l) O end2 p3 ]! x K# A4 _) ~8 R
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,其它按你的 ...
|