|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: W9 f: q! g+ v) j3 }
; v; D; D: R2 H% D我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ @4 ^2 W9 r/ @2 Y, G# G) ^% I l( I. q9 L6 m4 W6 r9 J
begin P_read arriving9 @' ?5 ?+ J3 T6 V: a" c
while 1=1 do begin
S3 ?9 ~0 ^) v. d read A_tote from "data.txt" with delimiter "\n"
( _, ^8 [* `" F8 I8 y' o7 u read A_time from "data.txt" with delimiter "\n"
; E$ s' `* {+ ^$ T3 A read A_leave from "data.txt" with delimiter "\n"4 d" Y; A% W8 [ w5 c& J
read A_picks from "data.txt" with delimiter "\n"0 z) e7 [/ ]- j
set load type to A_tote+ ~7 o! Q( V8 L1 Z7 P/ |
if A_tote="tote 1" then set A_induct to 1) c* H) w; g& P8 T- s( e0 a- F
else if A_tote="tote 2" then set A_induct to 2
9 t L9 K, r- S C( l) G else set A_induct to 3
! R2 A) h# c$ n$ B5 m/ Q9 I* S set A_i to 0
, @0 t" @; d4 J! E% g& f4 {. k9 G clone 1 load to P_induction
& {/ g* D1 g; @% I2 e wait for A_time sec
7 e! F7 h7 L1 i z& Z5 Z# U end
+ h4 t6 C, F( gend
5 f" p0 I! {! m, Q5 c
2 c% V* I) N4 _4 b- k& F3 `begin P_induction arriving/ q7 t! D7 p: q$ h3 h$ p, y
if A_induct=1 then clone 1 load to P_pick1
n# V8 l, M* |0 ~4 f else if A_induct=2 then clone 1 load to P_pick2# B7 V S: @8 ?
else clone 1 load to P_pick35 t( |' k) s0 V o+ z: R3 u1 G6 [% Q
end4 C" ^6 M5 b, D# r
1 X ]6 T* x9 \( J' K0 r6 I( c9 R
begin P_pick1 arriving
: O; y8 O5 N& T& o) ` set A_i to 1
: u" t$ I9 j9 i: R# ` move into Q_induct1# A @5 ?+ A$ ]3 r
move into pickaisle.induct16 V1 G. p! e! A
while A_i<=30 do begin
5 b1 p3 R3 s! j) l6 K' B8 V7 t travel to pickaisle.con(A_i)
2 Q3 \2 _3 u6 J2 w. q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: w k0 ~2 w `, }. |, }
else wait for 10 sec
( K# u( B2 C: k: D0 m if A_i=A_leave then send to die
; A1 g8 Y1 L' S/ \8 S else inc A_i by 1; v3 S+ l# L& M% w% E. c
end7 |, ?7 B- r" A3 g' l r; B w6 m. Z
end
% r$ Y0 c g, z5 ~9 E: v: \$ _' n! Y. j6 i' [9 G H& `) N
begin P_pick2 arriving ?4 o8 C; o% d8 S
set A_i to 11/ x& u) c. D& `2 t1 t
move into Q_induct20 i L1 q+ {* W# d0 l6 ?
move into pickaisle.induct2
% ]/ k. X" _2 x* [! m1 ?# {$ D" ^ while A_i<=30 do begin
( H$ M3 x. ]" z/ s7 O travel to pickaisle.con(A_i); T7 Z. Q0 j( {! F% O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 a; p: H* m. L7 c" b: U9 W6 P
else wait for 10 sec M$ L6 q4 O: T* ]' R. q7 d
if A_i=A_leave then send to die
1 A( k, S* h' t else inc A_i by 1
- c! i% k0 s1 h' V. W0 I8 q end
# ?1 M$ x, F& h9 A8 e7 Aend% z8 x9 [% _+ l1 d9 v- W7 C
& d& N* g2 a+ e% ]begin P_pick3 arriving% t3 E1 B n) {7 O
set A_i to 21
# [: B3 ?# N( J, E move into Q_induct3
% L: }; f+ m: K& Y d- ? move into pickaisle.induct3
6 X2 q" P4 D& J while A_i<=30 do begin
: U" h$ d/ f: P" B5 v- I; e3 w- s6 g travel to pickaisle.con(A_i)7 O3 Q2 x3 s2 [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ p, M! Y% S7 }' k9 t0 N else wait for 10 sec
# k% r# G4 w! x/ L9 B: z6 M4 h if A_i=A_leave then send to die- d( ]' U! G- J1 X, w% w
else inc A_i by 1
; u* u* H6 U/ h* V end
1 v- l( Z) N! f+ P# hend |
最佳答案
查看完整内容
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,其它按你的 ...
|