|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% N3 \ K6 Y" e! Z
% H( V0 j% S7 a9 V我的问题是,在每个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, j; K1 n2 c( r% o( E6 Y8 ~& g. u
begin P_read arriving# [ X$ l0 F& j. B+ d+ t# A6 n8 d
while 1=1 do begin
8 v S+ Q$ b) Z+ e read A_tote from "data.txt" with delimiter "\n"$ v& Z( M. |" I' m
read A_time from "data.txt" with delimiter "\n"
1 B; i: L' m% w; S* L read A_leave from "data.txt" with delimiter "\n"2 Z6 G/ }2 k; g. Z/ X1 P
read A_picks from "data.txt" with delimiter "\n"
4 e6 v7 @0 {# M set load type to A_tote: V4 O0 S" Q7 _& z
if A_tote="tote 1" then set A_induct to 1
9 p8 K! L9 n0 B1 E& x else if A_tote="tote 2" then set A_induct to 2" B0 N- M6 s6 ^* G$ \* A
else set A_induct to 3
7 W2 d$ Z" c( z& ~/ @0 O set A_i to 0
4 P) V; J" W$ L; I clone 1 load to P_induction
8 I4 A/ e4 [+ |: \ wait for A_time sec
! D( C4 \2 H- m4 x4 R, u7 X3 F1 O end
9 k. u0 w W) R* [end& @ x& r6 u8 T- t3 W$ @, _% a
, Q4 z0 @, T% i+ S2 P9 \begin P_induction arriving
# O# D; V! U* d6 s7 ~, R$ l if A_induct=1 then clone 1 load to P_pick1# W8 s A! l2 L' G- Y4 B, m* a
else if A_induct=2 then clone 1 load to P_pick2
7 w' n/ S- ]5 l7 h2 A else clone 1 load to P_pick3
! ~; K! H: j) P+ g4 B, o' d# I" M4 Y; `end: X! y( H" b( L2 ], [% B1 R
4 B. x2 q& W- D* D7 x/ |4 zbegin P_pick1 arriving& a: v3 n- |3 H \
set A_i to 1% O' }, S: s5 ^8 X! H) O
move into Q_induct1/ L$ g! L0 T& F' P/ A3 B% [. W( o3 @
move into pickaisle.induct18 j9 C& q- f. F q. K2 R
while A_i<=30 do begin
1 x: I; J9 `5 X; ?; I travel to pickaisle.con(A_i)
$ U, V( M/ u& r% ?! G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 B0 a/ f7 _( g: J
else wait for 10 sec. ], f/ I* g ~( A5 }6 E0 U
if A_i=A_leave then send to die
0 f; D2 F& W- \$ Y else inc A_i by 19 P9 @ |7 |' x
end
/ O) Y3 m9 F+ C( v! I) vend+ U R! `7 z- c: H$ s6 S
4 O9 [4 |( c- ^/ ~begin P_pick2 arriving
2 X Q+ m8 j9 v7 A set A_i to 11
( w+ w1 h# a+ Y# Z move into Q_induct2
: K) Y" V# l) ^3 C move into pickaisle.induct2
0 Z! s% p5 R( [: p while A_i<=30 do begin
6 e" T w# {) N8 n2 A; `% o travel to pickaisle.con(A_i)9 |2 l; l$ i* B* z. E; d- a4 t7 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) G/ z! L0 s! k0 e' F, e: V$ O, w
else wait for 10 sec' e) O" v$ F% i
if A_i=A_leave then send to die. f | N3 Z9 [- {1 f5 |* i- u
else inc A_i by 1
' Q3 Z% w1 q: X+ ?4 r end7 \0 G: Z) W# Q. ]
end" U6 b! R3 E4 C, m4 B
2 i0 ?4 U" B- G8 E8 mbegin P_pick3 arriving
& E0 T: `) }! [& v+ X( B" B set A_i to 210 y9 i$ c3 z5 i( b2 |
move into Q_induct3
* A# r4 L; q5 ?: s8 S; h' G" q move into pickaisle.induct3
- H2 G! z2 A' v, R s$ r- q- D while A_i<=30 do begin
- c! ]( M6 V" ^! D. i" }5 S travel to pickaisle.con(A_i)
) J4 D0 g$ |* j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; t3 d K! q( U Y) a" w
else wait for 10 sec, R d1 Y- U+ j- S$ C: [ O
if A_i=A_leave then send to die: _2 s& f; z8 ]8 k0 ]. j5 c
else inc A_i by 14 P8 W0 M2 X# b) p i# p! W, Q: @
end
8 f, o" s) V/ A& K$ 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,其它按你的 ...
|