|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; O( |6 e$ R. c C7 b' V, p1 p! G5 [; f: _/ ^( y9 r
我的问题是,在每个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 V. e9 k4 I# x" K: I r# u" n- N9 @, o
begin P_read arriving
; ^8 H7 H$ S! O1 y7 z- e" q& y1 I while 1=1 do begin; K. r1 ?4 D m, a
read A_tote from "data.txt" with delimiter "\n"
n$ e, k \* q: d$ f/ E& Z, c read A_time from "data.txt" with delimiter "\n"
2 w0 t' x- U- C( m+ W9 h! | read A_leave from "data.txt" with delimiter "\n"
8 s1 h2 \4 R R+ g- K0 D3 F6 T, \ read A_picks from "data.txt" with delimiter "\n"$ Y& I. r8 ?* y/ e M' h/ b
set load type to A_tote
) T+ t! k1 v! R f if A_tote="tote 1" then set A_induct to 1
4 m7 j U H/ A8 S q" [8 e else if A_tote="tote 2" then set A_induct to 2
9 q3 @' ^- D: ?$ ^6 y else set A_induct to 3
2 N+ b$ p4 \% h* L% y set A_i to 0, u1 H& q/ `" T4 s" f5 s1 A- m
clone 1 load to P_induction
8 ~+ ^) Z1 g+ {. X6 V4 [7 [: _' W wait for A_time sec
! ]$ B4 g/ p: g9 z/ d end8 g5 g: ? S$ ] I! Y' C
end
% {7 J* P5 _0 Z0 `. s8 m. p9 F# P
begin P_induction arriving
& m+ M; y" c; W/ v a% ?) | if A_induct=1 then clone 1 load to P_pick10 ~' \1 N8 L6 p9 m' o# d. J
else if A_induct=2 then clone 1 load to P_pick28 k& r3 K5 a" j1 M0 ~3 c3 o
else clone 1 load to P_pick3( A5 {4 }3 G4 ^ J' P+ b& k$ \: l
end6 o9 Y/ W' A [+ p5 E
. F1 R4 t8 Z# ybegin P_pick1 arriving% T- w) r1 D& _! ^7 H& n/ W
set A_i to 1
- p6 l4 P- K y5 q9 w1 L move into Q_induct1& n }5 m/ d( Y% W. N \' |3 u. ]
move into pickaisle.induct1
8 ^6 R" ~/ Q. K/ h* C v while A_i<=30 do begin4 }! f- n0 e/ ]+ o, P" r# j
travel to pickaisle.con(A_i)+ ]; M; p$ B# Q6 `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 G1 |7 n5 T$ L5 J- c0 ?. s; c6 ^ else wait for 10 sec
, C* O/ l6 Z9 d if A_i=A_leave then send to die
1 l& |, j |1 B- e else inc A_i by 1! Z5 b% Z1 q8 e# A9 m5 Z
end4 s- ^. u+ v) V8 ^
end
) w, m5 U. C+ Y6 j4 \$ r! v9 p+ [. s2 o: y
begin P_pick2 arriving
! w; o$ w/ I( L set A_i to 11
4 Z: V/ w# R) O. u move into Q_induct22 S/ I. W) U1 e/ A% D
move into pickaisle.induct2, P4 K& z! @7 M& K- L
while A_i<=30 do begin
* _4 K% k) o5 p' }' I8 a7 s2 V travel to pickaisle.con(A_i)
$ p* p0 Y1 M9 w) ?" c8 o0 A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ O9 m+ \4 n d% p* k# ^' M+ f: [
else wait for 10 sec9 y) h' }' w- h% D5 r
if A_i=A_leave then send to die
! z1 l" _7 s2 s' C7 ^ else inc A_i by 1/ |+ p* t: D! H/ Q! @8 K6 v1 |
end
( b3 f% n, [: A# W5 c* hend
" U; k; a1 U+ E2 ^$ N! C
# C/ ?( I; I& K# w! Z- Rbegin P_pick3 arriving
1 H7 Z2 |. L9 C9 e set A_i to 21! B K$ [: {) S3 v
move into Q_induct37 u% E6 j5 K2 n( p. Z! K7 K) Q( X
move into pickaisle.induct3
2 D8 r w3 n v5 q. u1 k& B while A_i<=30 do begin: f4 P* I9 L5 W: C
travel to pickaisle.con(A_i)9 c3 J& c" X' ?9 B- p- |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 T1 q: u+ e+ p5 ^
else wait for 10 sec
) g5 J# _, @7 A0 K1 w6 s% h if A_i=A_leave then send to die
* c, x! H' Z5 p else inc A_i by 1
$ K) w- n4 [6 g; \ end
1 H4 ?; r6 D/ Q7 C8 M7 Z! Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|