|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! p8 P, e! P3 {
8 Y% p0 ?4 n4 i: ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: u0 V: `" n$ L' ~, h3 T# Z- W
0 G( Q% M) M( C: _
begin P_read arriving1 }$ p+ L4 ]4 D" \4 I
while 1=1 do begin3 [+ X! y N' f1 x: }3 }8 E6 W
read A_tote from "data.txt" with delimiter "\n"
" I$ ^! H0 ]$ a# b) c" L read A_time from "data.txt" with delimiter "\n"2 i% I+ K W8 I0 [
read A_leave from "data.txt" with delimiter "\n"
# q0 T2 z* K4 W7 o4 {2 O read A_picks from "data.txt" with delimiter "\n"6 g5 y3 h* O5 X+ b7 Y
set load type to A_tote
0 U8 c- z; I& ?7 n5 m if A_tote="tote 1" then set A_induct to 1; s5 j' I- S" q! d/ i V7 b
else if A_tote="tote 2" then set A_induct to 2
7 y8 `: H5 M/ _) e, U: Q else set A_induct to 3
* H. N" Q! D5 }" H% T set A_i to 0$ G8 p0 L; z" @5 I+ V `
clone 1 load to P_induction$ z9 k/ v& K: W, ^9 H
wait for A_time sec
# s3 y" a) j8 b" h end
1 Y, o& I7 z! N- V! Nend) w2 a; p. ~! z7 ~2 f- a
6 Y. m; h/ E, J8 A
begin P_induction arriving
; z$ A0 x1 ^, l: ], T if A_induct=1 then clone 1 load to P_pick1- _* ^5 f+ b) L/ ^/ ~ x9 Z' L
else if A_induct=2 then clone 1 load to P_pick2
2 s( b- j! v7 k+ S+ x7 c# D- j% b else clone 1 load to P_pick3+ t9 {& q, v& Z* W* Z6 G# q+ A
end8 g N0 g# ^: u8 B1 @
5 T6 ]) U0 B# I4 W8 c6 h: W
begin P_pick1 arriving
1 W4 P4 b S& o0 D6 X set A_i to 1
8 q T5 Z4 E; }' j move into Q_induct1
1 G/ D, |. G) K" N$ M& e move into pickaisle.induct1
+ `) b2 m/ ?. M4 J* H1 P* i while A_i<=30 do begin7 L* b2 T0 L: y/ q& I2 { B, j
travel to pickaisle.con(A_i)
" S/ J- V O6 S0 g/ t, c$ Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ J" V, O( S3 q' z4 I8 A1 D
else wait for 10 sec3 C2 O( J7 ~* V3 b9 @
if A_i=A_leave then send to die
# l& Z' P0 z. [$ v( g else inc A_i by 14 H& W' L& m$ S1 h
end
! _" s* h6 l1 ]) ^) M- T; Z8 ]end
5 C6 n2 m* [) Q3 o8 x8 c7 T1 j5 \% A+ q+ A) |- X( @
begin P_pick2 arriving
+ M% E0 [) U+ j7 p0 |2 e set A_i to 11
; Q! X9 J6 N7 p0 y; p move into Q_induct28 G6 R, \5 u0 `4 d
move into pickaisle.induct2
9 H& l: N& n7 R* i7 i4 Q while A_i<=30 do begin
$ z: G1 c7 u: z7 m0 H9 k9 D! Y9 q3 K$ p& M travel to pickaisle.con(A_i)
' w# B4 k9 M. f3 Q4 V8 O! Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Y( |/ T; r: l8 U, s
else wait for 10 sec% B3 d9 ^ t L- ], Q/ x
if A_i=A_leave then send to die
- ~# l, ]0 e3 v5 S$ H: z6 r" M) b else inc A_i by 1
( [# s) ~. B3 k end
9 t: m: t& \5 O9 h bend
" m$ O$ |" Q# E
% J7 k2 l, ]" k2 L& h C! K, Lbegin P_pick3 arriving$ J) a+ p& k$ R( q8 m1 k9 E; p
set A_i to 210 V% w* b( |$ O( C
move into Q_induct3
) Z, S' m1 {/ W. E, f) Y* b9 i move into pickaisle.induct31 S! L o$ e0 A0 j" J% D' r
while A_i<=30 do begin
! K0 L$ t' H2 _; k9 X travel to pickaisle.con(A_i); L* K$ w7 _. ]! v" A6 w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- a0 m! }5 K7 q& T' f2 k4 U else wait for 10 sec
: B* f# N$ F! D! K* G: b) Q if A_i=A_leave then send to die
- G7 L! a8 j5 }( R" H2 p else inc A_i by 1( d& ~3 @% w- g d$ B! Z" l
end
. g T) g/ S7 d: g2 n* U% Xend |
最佳答案
查看完整内容
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,其它按你的 ...
|