|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ s" }1 B! D, M4 D7 e% w
& i; Q$ J& j5 {; q) ~+ B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 h) _2 S8 y' d9 D; D6 Y7 e- I% w# n8 p0 l
begin P_read arriving, g/ `/ }5 \5 k/ x$ h
while 1=1 do begin, L3 U+ W% L2 y" z1 ~3 {! \! }5 e
read A_tote from "data.txt" with delimiter "\n"( b4 t5 k8 @0 `( ~, X1 r2 w
read A_time from "data.txt" with delimiter "\n"6 t/ ~. Z! d, z: s& @0 ]& ^# W
read A_leave from "data.txt" with delimiter "\n"5 n- |( w, @ \
read A_picks from "data.txt" with delimiter "\n"
$ Q- l6 X4 L+ j6 i& [7 U set load type to A_tote/ b% C$ ]* f. v
if A_tote="tote 1" then set A_induct to 1
; [2 ]$ n- D& E1 l6 e+ \) R2 k, N else if A_tote="tote 2" then set A_induct to 2' m1 [7 Q& `1 |
else set A_induct to 3 $ t5 }2 M- G& G, o; c' w& K. M
set A_i to 0
. d$ K6 l o8 }, v" W% ~ clone 1 load to P_induction" p( D9 _8 O- f- j9 H6 ^
wait for A_time sec
. O" R5 t) h% a/ v5 { end
+ Y c1 F' @' f% Z7 e9 K) H# m* Kend2 o! g0 d" ?1 Q! ?" y2 U1 i2 R
8 H, |' G! g7 d
begin P_induction arriving* ]) a6 V8 K5 B; }9 ^8 [0 H
if A_induct=1 then clone 1 load to P_pick1
" e; p( u$ F% P0 R7 y- y else if A_induct=2 then clone 1 load to P_pick26 E" h7 M& J9 [1 Z C1 W7 u
else clone 1 load to P_pick3
) I" h' R/ _9 t0 Z2 c6 f- F+ Lend
( K8 a* ], m2 Z- x- _" m* H! g" f
# A" }$ T% t' z. Ubegin P_pick1 arriving
" y* B4 k1 M$ l, g/ k set A_i to 1" A( g9 G5 ?( t) A' [6 U) y
move into Q_induct1 m% x( E0 o2 y3 O
move into pickaisle.induct1. |7 R2 O+ ]! }* E7 z
while A_i<=30 do begin
) L d3 D S3 d travel to pickaisle.con(A_i); [0 a2 T6 L( }' [- z3 |" x$ j8 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 `6 f" z6 g8 T& D
else wait for 10 sec. M$ E) S# J" R" j! s3 R) b
if A_i=A_leave then send to die) L# y1 l- \/ ` u) B3 M" ]
else inc A_i by 1
! ~6 E% L Z! K end0 ~% v1 K* w" _' }4 R- @8 ~
end
* Q9 _) X) v' h- ?# O- u% O! |* l
begin P_pick2 arriving) A$ H* t; y7 r8 `* i
set A_i to 11
1 S; D0 c! X( X3 y) t move into Q_induct21 e/ l" B) F6 r5 |7 g4 S
move into pickaisle.induct2# M; K" F) A. T) S
while A_i<=30 do begin& I9 n2 c" G* g6 y |1 v& l3 n; K. Z" v1 e
travel to pickaisle.con(A_i)
+ m3 B1 |6 Y" I+ _% X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec ?$ T. H4 v4 @( y4 J
else wait for 10 sec
6 k2 g6 t# L/ G- h if A_i=A_leave then send to die
/ v: n* V$ M; Q1 o else inc A_i by 1
1 k+ ^% z6 w+ F- t% _; K end$ y. D6 u1 M6 V; c3 \
end
. p" E7 d$ Q5 n2 t) C
% j( K B: U7 r; y$ F# P4 H$ m& G0 Wbegin P_pick3 arriving" R0 b: K8 M5 _) z( a
set A_i to 21$ c7 a2 D1 q/ S# y
move into Q_induct3
# \! w3 Z. k0 [2 p. Y- i% f move into pickaisle.induct3; }4 F& P4 a, f& Y4 p* `
while A_i<=30 do begin! T# L4 u' r7 W
travel to pickaisle.con(A_i)
9 B7 H5 Z/ n8 H5 G6 }, `6 |7 I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 J1 a; ~: `( T6 t7 ?! o6 R
else wait for 10 sec
H8 ?7 h- S. u: v5 n% X if A_i=A_leave then send to die% f" X7 i& \& O3 K
else inc A_i by 1' [) V7 f& {+ g& Z4 W! K
end
2 f! o' l! Q7 M) z b9 l6 u0 E, Bend |
最佳答案
查看完整内容
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,其它按你的 ...
|