|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) a# R* z* T- a, q. u3 o3 E3 @( N6 H
; J5 n( T# @' o8 s9 n我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ l/ l) x: I( E5 r8 x2 y o7 {; t) s
begin P_read arriving1 Q% O% c- l/ ?6 G' D( s" H
while 1=1 do begin
( r$ i$ s" U+ I2 i5 F read A_tote from "data.txt" with delimiter "\n"
* S5 @! G% M2 m7 m4 m: H read A_time from "data.txt" with delimiter "\n"
1 u. y2 g) k) t7 V$ ~' r read A_leave from "data.txt" with delimiter "\n"6 @9 T" F9 `8 M- p
read A_picks from "data.txt" with delimiter "\n"9 |8 C2 u8 l. q$ z5 k
set load type to A_tote
- s5 D3 ~- _& i" h2 @: u4 w2 l# X if A_tote="tote 1" then set A_induct to 1; L6 I# |& ~( \5 r! \( z# i
else if A_tote="tote 2" then set A_induct to 2% ?/ C- C: f" }# Y) C' W& G0 y
else set A_induct to 3 - `/ l9 Z/ K' m4 y* E0 I
set A_i to 0
$ ?) K, a/ e O9 d% c E clone 1 load to P_induction
$ z9 I$ m7 L" c1 `$ w wait for A_time sec
5 T& D9 L. H @. A# U9 ? end$ \, t; l2 L# |% Z. E% v8 T
end
P; p* e* K" Z" D0 j
6 [5 z3 M2 k4 V; L+ A; Dbegin P_induction arriving+ E1 C9 \% w* m. J3 S) I# T
if A_induct=1 then clone 1 load to P_pick1
& Y. y7 n& P- ?2 s else if A_induct=2 then clone 1 load to P_pick2+ m: d7 e* M, d6 C( n# K0 ]
else clone 1 load to P_pick3
4 }) h" g6 o- I8 G7 N# u Vend. C. ?; c4 s1 P
& R' l& T& v6 Ubegin P_pick1 arriving5 G! u2 e+ y% @, o$ Q/ J8 h0 ~ k
set A_i to 1
4 e& N$ a% r7 C6 w move into Q_induct11 H- q, T( g( f/ b
move into pickaisle.induct1
6 ?: b! ~7 p& K* l) M3 c while A_i<=30 do begin7 M8 ]1 f( ^$ P( m
travel to pickaisle.con(A_i)
% M: ?$ Y) M: O. r+ y4 i- o" v, j0 Q& C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 U+ U& A2 n2 L7 U" E% i0 y4 X+ ` else wait for 10 sec
1 C" ?. J5 @& E& G: D3 Q if A_i=A_leave then send to die
" k+ @; H* \" M( U( N+ A5 J- \ else inc A_i by 14 _. j+ h$ y, E. k4 L8 k
end
& W' ?# R1 L5 A5 yend- @$ ?+ n" ]! E! g- Q7 K
% l T: m# I/ R) A2 Y( H! ?begin P_pick2 arriving
. r6 V' Q# y2 i; c& {# w set A_i to 11# F2 Y+ ?/ V5 Z2 i) i6 w
move into Q_induct29 B M* x+ a8 S( S! {
move into pickaisle.induct2
6 p! c4 V9 L" W& g# S* ^) s" r9 h while A_i<=30 do begin
1 [9 `) O- g- e* J; l' f travel to pickaisle.con(A_i)
2 d7 U% f, A1 r( l& V( W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, G3 z1 x' o3 [2 o% z else wait for 10 sec
$ b/ U* G H) q- \, F l if A_i=A_leave then send to die
6 Z/ v1 G7 S0 A l" [5 s# ~ else inc A_i by 1
. B6 T# c, e( l c+ E8 S end
! I* |7 e4 H. b8 |, ~end
- D; R( ^4 [$ P7 r- T4 s' k
) W7 h0 E8 H2 Y+ f! {begin P_pick3 arriving
: t2 i4 g( t4 L. O" R set A_i to 21
: ^ K2 \. }$ y4 R move into Q_induct3
( Y6 @& ~; s4 Y! h3 W3 t3 U6 H move into pickaisle.induct39 h7 k# Y' \ g: J8 s! m
while A_i<=30 do begin
# j& U, N+ Q5 [* h2 S0 Z$ V. I) ^ travel to pickaisle.con(A_i)
# Q; t3 S# j, C! O. I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ^- N7 l7 F& t7 n! E: \& p
else wait for 10 sec
) R, n* z2 X3 n$ N2 Y if A_i=A_leave then send to die
; U) w5 H/ A: s, p* ]) v else inc A_i by 1 Y, h8 L1 A$ |: T6 a
end
$ P# s( |2 B; S' L; J/ J( h/ |4 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,其它按你的 ...
|