|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: T( b$ t1 X9 s% M6 V3 C; W1 f& ^: B$ n. ^( w# Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( L6 W/ ]" z" P
K$ ]: x2 q2 u+ t1 M/ b8 pbegin P_read arriving, _; ^2 @! v9 u- ?
while 1=1 do begin7 c: p8 B) S1 @
read A_tote from "data.txt" with delimiter "\n"
* F9 m% I5 u8 _* @ _ read A_time from "data.txt" with delimiter "\n"
3 J) A! I7 p, q3 x) u5 A read A_leave from "data.txt" with delimiter "\n"$ N: Q9 x5 C; o9 G4 P- X/ y
read A_picks from "data.txt" with delimiter "\n"3 S$ V3 \* X0 t) [
set load type to A_tote
& O3 E* [- T# J4 L6 ] if A_tote="tote 1" then set A_induct to 1
8 X. K5 M8 S. K else if A_tote="tote 2" then set A_induct to 22 }% p4 f' Q( i `) u. {" c" z
else set A_induct to 3
+ d5 W5 A% C1 M0 s4 `: i set A_i to 0/ y, A2 d+ h, J
clone 1 load to P_induction
& ]' R4 X) B, u wait for A_time sec" p. r' Z2 I6 g4 x! b( l& @, Q- x
end
. J& e% |' C6 V' i- {% w( nend
$ Q* Z& W: m. K7 [9 y2 X( i( I0 A7 A3 J' T! g, E* G# e G9 B
begin P_induction arriving
. W9 X7 Z3 l6 S2 F if A_induct=1 then clone 1 load to P_pick1
$ F; g8 b& j [2 c t, X% } else if A_induct=2 then clone 1 load to P_pick2
, {) V( k# R, }2 `, L1 ~ else clone 1 load to P_pick3
/ D! _3 O4 `& ? L: l3 x1 nend( z$ v' l/ F* _3 F
' h' E2 N; r9 G; c3 Xbegin P_pick1 arriving
2 w0 C6 s) x; _2 H1 F5 M) ` set A_i to 1
$ J7 Q5 `+ a8 f) k* @: `! g move into Q_induct1
+ R g5 A6 ?- B* _ move into pickaisle.induct1
* E8 t1 z/ b4 I$ v' ^ while A_i<=30 do begin
# Z0 Y: s1 V# {( n# v1 i+ C travel to pickaisle.con(A_i)# x) s( b# Y( F; V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& s5 m' w. v: V' i9 l6 C R else wait for 10 sec
( r! x; S0 i" W& _# ^2 Z if A_i=A_leave then send to die8 L$ }& L/ S+ B) j1 M% p% ?
else inc A_i by 1( s8 Q6 o8 ?2 e" t
end7 a0 G( `( q& N# a6 o0 D
end+ d9 v0 ]3 m: T8 c& g# B! z
% Y4 R# }2 E, f8 S. m' j nbegin P_pick2 arriving
1 v2 ]4 Z, g9 N' f2 j: i" J$ l. S set A_i to 11
0 o$ |7 P) ]: e6 B3 r* m move into Q_induct2
4 p! E( a2 l5 r+ t8 l1 c+ t( w move into pickaisle.induct22 j0 @% n: I5 U3 t5 B
while A_i<=30 do begin
; h. o2 D3 E# E travel to pickaisle.con(A_i)- v% S2 Y, [" X0 {1 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 V% S# N6 c5 w+ o else wait for 10 sec
( O# W8 r) d2 W2 Z' z9 Q; @$ O if A_i=A_leave then send to die
( G M. Q5 N7 m8 B else inc A_i by 1
8 F$ s( z8 t. z* j; C end B# W% Q3 A0 t1 n# `
end: E9 O3 A H( z4 U
( w7 M" k( R C3 ~4 s+ Hbegin P_pick3 arriving+ H# u: u' d9 I c
set A_i to 21
, F- i/ u- N5 G% F) o" V move into Q_induct37 ^, Y; j0 ]$ l/ Q. C) a- }: k
move into pickaisle.induct32 j; H7 K: l4 X( R! j
while A_i<=30 do begin1 \# K1 |) E0 u8 b8 f, d
travel to pickaisle.con(A_i); u& y- S0 q5 g+ S$ W9 R4 E- l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ R5 a3 i8 z! R3 q. v# z else wait for 10 sec+ \ ?4 o/ S4 `' {- Z1 D
if A_i=A_leave then send to die+ x6 O9 a u! H& r* Z$ w8 ~% q+ Q, Q. [
else inc A_i by 1
" r4 h1 W& D s5 D end
3 O5 H( }% o9 send |
最佳答案
查看完整内容
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,其它按你的 ...
|