|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 I+ S4 \0 S2 K$ Q8 J
+ T9 h d$ }+ W我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& R2 \ C; n: z4 K9 _0 \" B5 i( q6 h' l+ n3 m
begin P_read arriving/ m+ l! O0 v# B7 D9 ]0 |* b7 `; z
while 1=1 do begin8 t. X1 D5 C1 F! t: h+ C7 o$ `
read A_tote from "data.txt" with delimiter "\n"
& N, h* @6 b( d$ X& m read A_time from "data.txt" with delimiter "\n"6 Q. f; \! x8 T! F+ |
read A_leave from "data.txt" with delimiter "\n"- t; y9 t' L+ P& \! T) K V
read A_picks from "data.txt" with delimiter "\n"
. | ~1 ~# A6 u8 Y set load type to A_tote) w$ N: N' S# d+ X
if A_tote="tote 1" then set A_induct to 18 n) Q- n. M: l. Z. d
else if A_tote="tote 2" then set A_induct to 2
}& r) S! p- F& r: P else set A_induct to 3 ; M7 Q; H3 ? H
set A_i to 02 s$ R' S4 g: `: c: C
clone 1 load to P_induction
% R0 Q' C; o% H7 Z) t- g* e- V6 } wait for A_time sec
; A" X9 \- ?) Z) v end
$ W3 @! X- f4 i% L5 F, v! y" Rend0 o2 {2 u7 R4 I1 L. y
, O+ |3 D, h1 O+ v* o' dbegin P_induction arriving2 u' i* b! j! W8 D& B9 f
if A_induct=1 then clone 1 load to P_pick1
& ?( ?: |+ O5 E else if A_induct=2 then clone 1 load to P_pick2
4 D" k1 a' p; N: L3 L else clone 1 load to P_pick3
/ t6 u& Z5 Y2 L1 u0 Q- k, S) Gend
* k6 J+ e R* ?' Q% }: {
/ ]8 g+ f, l" @! @) |begin P_pick1 arriving* J9 O$ D/ H6 ], j
set A_i to 1/ e; R8 E/ b# U A
move into Q_induct1
3 K; f i4 G) d0 @ m+ N+ I" s move into pickaisle.induct1
0 g) A# [$ \6 a0 I- S while A_i<=30 do begin* ^& }" b d. p
travel to pickaisle.con(A_i)5 i, L0 g( M5 r: c" d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 N3 h) ^& K5 t( X8 ~6 F' i: c else wait for 10 sec3 n2 f7 o1 W, n9 O2 t, n
if A_i=A_leave then send to die9 k7 I3 S. c7 _) U( E
else inc A_i by 1
* B! j, J$ `6 J4 P end' h' f }2 R( T2 `: F
end0 P! |+ U2 B. S
( c7 ~2 W8 C$ A
begin P_pick2 arriving
+ {- j3 w5 j3 w. A. V6 Z+ x" H set A_i to 11
0 w; F1 c! P- | move into Q_induct2, u' |5 @! O3 P
move into pickaisle.induct2% K+ `$ |2 U4 M# }8 ~; [
while A_i<=30 do begin
* T) t- h3 q- z1 ?. _0 c: V travel to pickaisle.con(A_i)2 h Y6 B4 J; O2 V" K2 B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 [$ I% M$ V$ k else wait for 10 sec
8 T4 |& L; }/ p) u if A_i=A_leave then send to die
1 q' [+ l' E/ ]9 s; @. D: ^ else inc A_i by 1
8 E$ @: B7 J9 a S0 b end
1 p* k: w, r; Oend, [# _/ s" r4 q# }- f6 k
2 f1 X% E! T# }begin P_pick3 arriving
! { q6 m" n! m" [; E8 c- c. X set A_i to 219 Z8 M% ?" l+ D$ V
move into Q_induct3+ G0 N: u. H: ?! K& t2 @
move into pickaisle.induct3
# E) V7 Y# Y8 d" v while A_i<=30 do begin
. j' u7 x1 T! |" w1 i travel to pickaisle.con(A_i)
3 O# p& N. H, k1 h6 O2 n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 d9 S* Z) r1 L z9 |$ e else wait for 10 sec
7 i2 u4 X" W3 p3 j. \: r# v if A_i=A_leave then send to die
1 y6 x+ x* D/ o r/ s else inc A_i by 1
2 W: S. l+ C+ L end
! k; c9 X# L6 n& qend |
最佳答案
查看完整内容
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,其它按你的 ...
|