|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, ?" w* _/ y2 T/ q$ r; _$ @2 S9 \; t( i% N& 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中的数值,不知道会不会有什么不妥。: S; a: Z m4 b6 n$ |2 u; l& K
; F& C4 S$ |. \3 P" N2 [5 W
begin P_read arriving/ P/ ~; Z! a6 W3 ?2 r+ l
while 1=1 do begin
3 V0 V) N. d8 D0 B: c( W2 I read A_tote from "data.txt" with delimiter "\n"
# s$ t' I# J7 l! J! t' m0 Z' d read A_time from "data.txt" with delimiter "\n": {8 b, T: T0 J' ?0 v* a
read A_leave from "data.txt" with delimiter "\n"# v6 E+ g# Y* Q
read A_picks from "data.txt" with delimiter "\n"4 ~7 ] h2 O |# ~- M
set load type to A_tote- I6 e! e# C0 r# G
if A_tote="tote 1" then set A_induct to 1
, v1 k1 G) Z M- ]5 J8 e else if A_tote="tote 2" then set A_induct to 2- Q6 d; L2 u2 Z9 B8 s. n
else set A_induct to 3
R. E5 [* w p' ?; E set A_i to 01 i; o1 B) S, r2 b2 ?. P
clone 1 load to P_induction
# {7 O! i9 I/ Z2 ~ wait for A_time sec
2 E4 J* o/ N% Y end" q$ w0 @- u$ a( K
end
9 \) s \: i! I+ P/ L
; Z4 R5 D1 q- i$ vbegin P_induction arriving; i8 Q' n& y& q/ q# r
if A_induct=1 then clone 1 load to P_pick1
$ b: {: F j$ h8 O8 N7 }9 I' R else if A_induct=2 then clone 1 load to P_pick2
3 `6 N! y( ]3 k- V! g: b- y else clone 1 load to P_pick3
( k$ T! P" P& @0 F5 ~8 cend
6 {: B" o& y" A2 q9 K- ?9 U4 d- S" z! g" i& a6 r4 y% o! }/ F
begin P_pick1 arriving
$ P \6 J& }7 F$ x$ ~2 @ set A_i to 1* s9 Z6 H. U9 _. t: m6 n" ~% }
move into Q_induct1
: R# J9 D( p q move into pickaisle.induct1
% @0 i2 ]" }/ J1 z while A_i<=30 do begin
$ h$ k. X, J# W+ w ]$ M( ]3 j travel to pickaisle.con(A_i): X+ G! K! |- x# v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 v; f0 a! d# N: }
else wait for 10 sec
; Q1 `( G+ C' \( w4 z if A_i=A_leave then send to die' P0 U6 d9 k6 ^, \, r
else inc A_i by 1
, j9 A. y! `' K9 s: r5 o5 c& @ end+ g. ^$ s5 c! U+ ^
end
/ q2 C4 E* g s% G- @% H3 o+ |% c( L
begin P_pick2 arriving
7 a; C. u7 S5 o( A$ d# \ set A_i to 11
+ |9 }% q; l2 D5 f, ~. A: G move into Q_induct2
( ?* \. h9 s! J6 n9 y4 A move into pickaisle.induct2
' w% w& k' \, T6 K! y0 y1 t while A_i<=30 do begin4 p4 e# m; T9 O
travel to pickaisle.con(A_i)
. _( z, D. R% @" M2 n/ J. ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& W' F0 h6 p) R- _. H- n else wait for 10 sec
6 O; ^5 I% Y0 t- p& u3 H, ? if A_i=A_leave then send to die8 n' X% i" J! M6 `' P) i1 L% M% {# [
else inc A_i by 1
( n! M `( O' Q! `5 b* n end% q& f$ u" v2 d; A9 s
end# x9 x0 U( p, y% x
" z, r& M* k' ?
begin P_pick3 arriving/ `& M8 K, i0 s+ j5 n2 t
set A_i to 21( e) g3 h( A" a4 E6 u
move into Q_induct3
; f0 z: J$ P- B- x: X6 S move into pickaisle.induct31 w Q" T) \. `* \
while A_i<=30 do begin+ q, O, I: P s/ `) n4 V5 H2 t! s
travel to pickaisle.con(A_i)
, S( u7 |( z! c; b5 W) K) K! X2 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& o+ H% S8 Y" ]: j* y
else wait for 10 sec
7 b; h L* L" H% C$ O6 x if A_i=A_leave then send to die
* n) v: c5 s" I5 l) `! g else inc A_i by 1% U. z! v- c/ L& h8 Z4 M! ]! T
end
6 }+ b( d5 g/ I" T7 O q) q! I- iend |
最佳答案
查看完整内容
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,其它按你的 ...
|