|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; g. Y/ g# o4 N/ G" p
( a2 d8 K/ @3 l- F* K7 g6 x我的问题是,在每个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中的数值,不知道会不会有什么不妥。. P. X. C+ \( I7 P: O
2 W7 L) u6 b2 }. V8 k
begin P_read arriving5 q/ p9 I" f1 h ]
while 1=1 do begin1 D/ R) b" _" d# l, y; L
read A_tote from "data.txt" with delimiter "\n"5 W3 X- \5 I0 y! Q) ]. {
read A_time from "data.txt" with delimiter "\n"0 i- e0 E& }& B8 j* v0 `) b4 U4 z
read A_leave from "data.txt" with delimiter "\n"! r1 k! E1 k0 A& n, E
read A_picks from "data.txt" with delimiter "\n"4 C( E* P9 h: L$ |: |2 [
set load type to A_tote S0 s: z( j* L, n1 [! ~
if A_tote="tote 1" then set A_induct to 1' _4 P0 @' z, t9 k) `% M
else if A_tote="tote 2" then set A_induct to 2
- Q0 g3 F: f: z$ W4 q" _7 E else set A_induct to 3
& R+ v8 c6 z" L4 |( k6 X set A_i to 0
3 i; X2 `% ^1 x5 C+ c clone 1 load to P_induction
2 A; x: E' l+ Z8 H wait for A_time sec ^( Z6 x! ~3 C& F6 k O6 u {
end+ O$ Z" h* K3 {) N$ l
end
% `1 E3 C: ~ \4 e* p2 ^* |) n
9 T }3 k$ P/ H3 p1 s# c' y5 a0 D Ebegin P_induction arriving
! w0 A" X I% ]; ~! n if A_induct=1 then clone 1 load to P_pick1
! c$ u' J3 b: ]5 s% ~9 i else if A_induct=2 then clone 1 load to P_pick2
, i! ]4 z' o3 U: U* z else clone 1 load to P_pick3
f! S$ E# p" f% Send( B5 e0 D4 }; \7 ?) P8 ]
5 v) N M+ M( X* c
begin P_pick1 arriving8 N: V/ }; o: Z, F. r. g
set A_i to 10 D/ k- o7 v8 U9 ?. Q
move into Q_induct1; t2 y$ K3 N/ p% V' i+ l. k
move into pickaisle.induct11 M: \3 M+ ], F# E2 x
while A_i<=30 do begin
, W* I) r1 c5 ~% x% V travel to pickaisle.con(A_i)6 K$ C) A7 w$ Y& w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- a) i% b, y+ W; N2 a
else wait for 10 sec$ c) U s& f* v$ R
if A_i=A_leave then send to die
# t9 f8 i9 @2 i/ D% p4 A5 B0 ]. y else inc A_i by 1
- _( _( H& p+ y7 R& n end
8 W4 @. T8 E# D# U& A9 f! jend& J( ?" c8 @: O# F' O9 y
* W0 u6 J! {, Q7 o% r& q- Q9 }: }
begin P_pick2 arriving3 n0 G8 y0 c6 J% h7 A0 _
set A_i to 11* j" R+ C1 }9 |# ]
move into Q_induct2
: S4 k4 W5 B3 K2 w8 X move into pickaisle.induct2
6 q& Q, V q' W while A_i<=30 do begin' O1 C* G& [& m# N) s) k$ R
travel to pickaisle.con(A_i)% u R& e% ?* D; G/ Q% Z9 \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 b# V' V) f8 a7 Z
else wait for 10 sec
6 Q0 E0 q5 h X, q) k3 L V if A_i=A_leave then send to die
! ]: l6 Z) f4 Q1 S# V7 J else inc A_i by 1! n* `- v% `- x& v j
end' @) f3 T5 `) V) U" o& r
end2 h3 P- M! o2 F3 F) O0 V( U( g
( |: M: Q' g( v4 r; |/ i/ j* N6 bbegin P_pick3 arriving' I. ?7 w0 A' p3 t
set A_i to 21! R& o" R3 r. \0 s# @! c
move into Q_induct3% o! y+ J9 {$ L5 Y; x6 i
move into pickaisle.induct3
, Y# A f1 `+ ?3 f: e while A_i<=30 do begin# _# c, W4 {& m' K
travel to pickaisle.con(A_i)6 V1 q( c( V* n V0 I! a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) E& {3 }% |6 s% G+ ?
else wait for 10 sec. I; A+ C8 B7 b* `" E" G" r( W
if A_i=A_leave then send to die9 i2 i/ h, R3 ]' |% q% e
else inc A_i by 1
3 }' T9 y, i* |& u0 G$ c end4 D8 a+ l1 }& [. `. m8 H
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,其它按你的 ...
|