|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 T# z; ?8 Y- S' w# \
" @' C" Z+ s( O; t. P' u我的问题是,在每个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中的数值,不知道会不会有什么不妥。* g1 C; e$ u7 x7 ]& B, ~
3 P1 T9 @' T3 j6 n# ?' z& [
begin P_read arriving
8 y" ^2 V& p a: V8 ~' @ while 1=1 do begin+ n! k) g) n$ |' G9 {; a
read A_tote from "data.txt" with delimiter "\n"
$ a- H& q) U6 ?& s2 {5 N# t read A_time from "data.txt" with delimiter "\n"
* R7 @9 C4 m$ z, j% A+ R read A_leave from "data.txt" with delimiter "\n"0 K; W; ^+ n" [9 t \
read A_picks from "data.txt" with delimiter "\n"
; J0 T; M* K, v/ a- Q set load type to A_tote
" R7 v3 x* R) [2 T( V( J) }% Z if A_tote="tote 1" then set A_induct to 10 |. N/ B0 n+ {' I
else if A_tote="tote 2" then set A_induct to 2; S1 A5 B. t2 H6 ?5 Z) o
else set A_induct to 3
! W# J- I4 ]4 G. {" ~/ m: i set A_i to 0' M1 w+ T% ]$ A/ L
clone 1 load to P_induction0 l* `+ X; @' O [! a
wait for A_time sec
+ X9 ]1 q$ I9 W1 H7 l end5 g9 O p( a# S1 O
end
4 ^# K. c; I$ L# z: `% y
& u9 X- e& s8 E1 obegin P_induction arriving
) M* j- `. R: g! D" g2 N if A_induct=1 then clone 1 load to P_pick14 C! y/ V3 o& u. l, c2 t. L- O
else if A_induct=2 then clone 1 load to P_pick28 Z N8 E5 s" t9 @' o
else clone 1 load to P_pick3
2 a/ Z* H- u. i" _$ r: pend
, h$ B) P, Y! |; g* l, U; {9 m' \' O
begin P_pick1 arriving9 D5 V5 G; L1 ?& U' x# r
set A_i to 1" j6 P: N8 E( ]& l1 ^: q
move into Q_induct11 s5 |# ] Y0 A- a
move into pickaisle.induct1: X/ K& x9 v9 k& ^
while A_i<=30 do begin' I$ A' W; y" g7 ?1 ]+ y
travel to pickaisle.con(A_i)
, ]+ e! ]/ b3 V( }: H' |* C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; ]& n; y2 @! O5 o. V, o/ U else wait for 10 sec
( P9 |2 `& E4 p if A_i=A_leave then send to die: U/ T h- Y" i( Q# S7 ^6 b
else inc A_i by 1
! I/ l+ {! T4 [5 \ end
H6 J8 x8 R, O& l( U' yend
" r8 l5 K+ ~, U5 P
& f8 G* `$ r0 R8 x9 w4 Xbegin P_pick2 arriving: C$ S5 \2 h. E6 s5 x# O4 c1 l
set A_i to 11
, `- W) q* I6 r: J. ^ move into Q_induct2
9 f, x' E& m+ c move into pickaisle.induct25 M/ ~$ l5 r& S; A
while A_i<=30 do begin! N& d3 {6 _8 c8 G; a* E
travel to pickaisle.con(A_i)# T8 N" ~) K1 o# a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: d3 r* Q+ f& N* T
else wait for 10 sec. e. q* r# @5 c! U3 S0 g7 V1 {
if A_i=A_leave then send to die7 @# [0 j* P" N
else inc A_i by 1
; y' g& s d6 n2 E end
+ @" @- k0 O& y# Y) [end: K7 B* n2 Z" U& D. ]# x# r: Y
- n) r0 Z- N8 n; r% [begin P_pick3 arriving
+ \) _- m: X: e6 M set A_i to 21/ Z. Q2 J4 [# W& n# G4 |
move into Q_induct3
0 g: ]. U7 M; S [% r0 X move into pickaisle.induct3
4 T( C3 A* t; r8 v* _- k while A_i<=30 do begin
/ K* C8 ~, [- b travel to pickaisle.con(A_i)
1 x( ~8 t2 ^1 [* a& f0 g! h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, @ ^9 z4 j7 ]- n* f4 C* r else wait for 10 sec) D# ^3 n% y3 p5 c& F1 @8 A) Q
if A_i=A_leave then send to die' A9 o; C; p# `
else inc A_i by 1. E' [& n& U$ n6 Q% N. N
end. N1 b: V1 f! ]; j& d
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,其它按你的 ...
|