|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- p- p+ y6 a+ \, f9 t
: h0 ^% p% a; [4 g
我的问题是,在每个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中的数值,不知道会不会有什么不妥。* _1 o! z' m) S& u7 w+ j
( C/ M% q- H7 D8 ^7 e
begin P_read arriving8 s* v: E4 y4 ^1 k
while 1=1 do begin
1 B d. ~9 @9 A9 J! X3 {8 \ read A_tote from "data.txt" with delimiter "\n"
* J9 D5 m' i v0 C7 W/ D. ~& y2 w read A_time from "data.txt" with delimiter "\n"8 }9 b: A0 Q4 |0 R+ O7 C! l+ ~
read A_leave from "data.txt" with delimiter "\n", U" q6 Z6 m [% n1 C
read A_picks from "data.txt" with delimiter "\n"
* V6 {5 j3 M# t+ V0 U& O set load type to A_tote) I4 _+ ?- \5 `: W$ A4 d3 L
if A_tote="tote 1" then set A_induct to 12 [" O8 ]* c! \' b' R
else if A_tote="tote 2" then set A_induct to 2
$ u- n. [) n- G2 x. u3 [% o else set A_induct to 3 # F' J E( _( n3 H( w0 `- Y; s! {, q
set A_i to 0
2 d& H. s& R+ U# V clone 1 load to P_induction) `, X+ [9 l @% S ?3 F* M
wait for A_time sec# W8 T6 B5 X% r
end
" q. I! b1 S$ U5 V# p0 vend( u/ o; C/ ^/ \3 D
s6 z6 _# V% S, \
begin P_induction arriving$ Y& U7 h. C! M1 ~% {+ A
if A_induct=1 then clone 1 load to P_pick1
$ w* ~1 `, f- B, \; N else if A_induct=2 then clone 1 load to P_pick2
+ t; I2 K. A! ]+ U9 v J else clone 1 load to P_pick31 x# ]7 `( p. ]9 C
end) ^" ^* Z3 s) V
# D# u+ W, t& gbegin P_pick1 arriving
, w- K: g/ \* `2 x! w3 Q set A_i to 1+ {4 E; @' O. I( u, X/ n
move into Q_induct18 v$ p" l9 Y1 C& R5 w6 o& j
move into pickaisle.induct14 o2 d V) T. N5 ^+ f: G% p
while A_i<=30 do begin! _. Y7 W) c" O
travel to pickaisle.con(A_i); x: s; V& J/ Q5 i" m/ Z5 B4 D+ @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* x* b5 K V ] else wait for 10 sec
7 a+ C ^5 ]' j. ]; [) \ if A_i=A_leave then send to die
# s' g7 A8 U, a& R else inc A_i by 1. D/ i4 L% W9 V/ P6 @
end
1 L/ I7 ^$ I1 r1 tend
6 C% r% l8 G: x8 ^4 Q9 ?! {- ~" a, C. s: ?4 k
begin P_pick2 arriving
: `$ N* t% G0 B' ]5 X. ` j4 J* ] set A_i to 11# j) ?0 H% N+ I# q u
move into Q_induct27 v/ v% c; {2 C! y+ C" Y
move into pickaisle.induct2
; L B: U" B% e8 G! B6 H. R while A_i<=30 do begin
" ^" Z( Z% V* o+ v5 w$ b% u travel to pickaisle.con(A_i)
4 d, [6 z3 f! F1 b+ M( u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# s! V6 O$ k$ N/ ` Z
else wait for 10 sec
3 a m& T( I. Y: B, C if A_i=A_leave then send to die
f; I$ K! P1 C! ] else inc A_i by 1
" o; F# W' V$ y4 X( s; P end% [5 p$ K' y4 y* B. }
end
& c% i7 n+ ]! E0 J9 n0 H
: C+ o5 w) s( q6 dbegin P_pick3 arriving
- P! j0 h+ T; b' y) n+ e8 f* p7 @ set A_i to 212 {* f9 @$ A" j" r; w. S6 D
move into Q_induct3
8 Y O" B" Z0 B# |& l7 T move into pickaisle.induct3* U; b k" ~" a& [5 L
while A_i<=30 do begin
Z9 X- _* r- f5 ?$ `4 k+ q4 b1 L" | travel to pickaisle.con(A_i)! V( e( a) D$ W b- F& l/ f% I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& A/ X$ O; b0 F& \0 N% } else wait for 10 sec
$ u, E. {( p* m# j if A_i=A_leave then send to die
1 w R: i" c5 @$ ^3 y else inc A_i by 1+ ^6 m5 b$ W1 Z: D( U
end' Q% x1 M$ y* {1 ~ q% v
end |
最佳答案
查看完整内容
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,其它按你的 ...
|