|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& V; I0 K6 |" r' a I @
; L% Y* _4 u# X9 K3 s2 A4 e& V我的问题是,在每个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 K( r& n2 W2 L [
# x _! O+ j5 m R1 k
begin P_read arriving4 r9 k" U/ x1 d! J, X! U& r4 A
while 1=1 do begin
' ]: V8 q& C* Z& G" M0 w6 I+ E read A_tote from "data.txt" with delimiter "\n"' R) M2 C6 ~4 g5 k7 E- \8 \
read A_time from "data.txt" with delimiter "\n"' w3 D2 G* c# y8 a# Z6 A
read A_leave from "data.txt" with delimiter "\n"' s h2 o/ g+ _3 c3 I4 s2 w
read A_picks from "data.txt" with delimiter "\n"4 w" D3 Y8 U9 b; t
set load type to A_tote
2 p4 v$ E9 X `: L8 L7 O if A_tote="tote 1" then set A_induct to 1: E# Y Y: B* P* \
else if A_tote="tote 2" then set A_induct to 26 _5 C4 h' d: f. U
else set A_induct to 3 ) A* i6 e5 m3 \2 `
set A_i to 0' t2 q) ?7 s6 r) b' L+ z
clone 1 load to P_induction# ~( ?2 s- U; N! p9 H9 y
wait for A_time sec/ y& \3 b: I- m6 ~7 n J
end0 z/ |$ D3 E) n, ^4 z! h
end
/ b: Z, c4 ^- Q
. V) b( n+ X. J$ `& G- pbegin P_induction arriving
" V( `, B8 O R; _ if A_induct=1 then clone 1 load to P_pick1
9 ~. I$ ?3 V: ] else if A_induct=2 then clone 1 load to P_pick2 w* p) y1 q5 k( x3 r' \
else clone 1 load to P_pick3
4 M& P# G1 F4 a; w4 L l" y5 S/ N" }end& {3 X5 a8 G" `- @: {5 C
/ A" S- z+ l/ q1 P% G7 A4 B! ?: h% lbegin P_pick1 arriving
0 G( W! Q1 m9 R set A_i to 1" R q9 w6 z, L/ _8 r; B9 y
move into Q_induct1
! Z8 z. ~) {# K! Y move into pickaisle.induct10 S$ I/ I( Q3 A, B, L
while A_i<=30 do begin& c T7 b( L1 k: b& H- _+ u
travel to pickaisle.con(A_i)2 L1 @2 N/ ]6 N! m9 @! C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 E& ]7 c0 v) V8 C* ?
else wait for 10 sec
) g4 z2 \/ I4 C; j if A_i=A_leave then send to die
7 G4 c0 c8 o( f. t9 ^1 ] else inc A_i by 1
/ o! e+ h2 Y6 C" J end
: f5 L5 N3 P- [8 Z1 t6 a2 Rend4 ^0 O2 J: x; t, K( J. U# a
/ \* b' q. K d. e2 R; s: x) N
begin P_pick2 arriving8 c+ q2 R( H0 K- V9 I
set A_i to 11
: y3 x3 _: l: Q9 S move into Q_induct2# I* W" }2 s! u3 _( K& N' p
move into pickaisle.induct2* a8 C+ T7 f+ w* b
while A_i<=30 do begin
# o" @& ?0 I0 |% b0 `3 x travel to pickaisle.con(A_i)
+ P. Z5 i' E5 C' @! j, V; [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 F$ o; w# U/ e6 ]
else wait for 10 sec
3 `; E* [1 l+ K4 T q if A_i=A_leave then send to die
4 s( w! s4 T: H5 t3 Y4 | else inc A_i by 11 ~$ Q: [% C3 X Z
end
. e8 Z w: v, c5 Tend! }* E1 I" a, l( v( \7 ^1 `; v
, y) [+ B6 ^: V; Y$ T
begin P_pick3 arriving9 A2 L. ?0 n2 l
set A_i to 21
& c) s& O1 w* a8 T! _. N move into Q_induct3
/ e( d2 F+ e7 f3 R' K, d move into pickaisle.induct3* W% A1 r, n4 d. Q" e4 W0 T
while A_i<=30 do begin) s; W, Z* }" A
travel to pickaisle.con(A_i)
+ X5 m- A& M; P5 V$ i9 c2 g+ P/ v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 q* M5 u- z7 h( s4 ^) m else wait for 10 sec* I( x. `: R' e$ l
if A_i=A_leave then send to die
4 n% `- |, d. ~, u2 h/ {- Q' I else inc A_i by 1
- k; q; d( F5 b end
0 x* u- o( T2 U( n$ t' Aend |
最佳答案
查看完整内容
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,其它按你的 ...
|