|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 l* @; H' W9 e5 c: J, Y) g$ e2 E8 q( ~; H5 a/ C, E& l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。 Y& M3 y- h3 Q
: M8 U" k+ [0 g9 S' R/ }begin P_read arriving" |, Q/ H$ b, `
while 1=1 do begin
5 K' J) i3 D( Y/ T; K7 z$ X7 I3 z1 [5 y read A_tote from "data.txt" with delimiter "\n"* r4 @4 P E9 O1 B( I
read A_time from "data.txt" with delimiter "\n"5 `' e8 h0 _% e% s
read A_leave from "data.txt" with delimiter "\n"
0 V$ @" e3 a; w" V# _ read A_picks from "data.txt" with delimiter "\n"
8 d" f" s: _% ^: l8 k, v4 \6 s set load type to A_tote7 u+ V* e4 o: W: h6 i3 U6 X
if A_tote="tote 1" then set A_induct to 1$ h; Y8 l4 z4 g) K
else if A_tote="tote 2" then set A_induct to 2" z4 s0 d8 K4 j. c: t
else set A_induct to 3
- G6 N# o- g0 ?8 `3 i! ^/ f set A_i to 0
' j" \7 s' [6 ~: t: \; D' _: d6 e clone 1 load to P_induction3 O0 A* T3 O* O5 v1 Y: G) i
wait for A_time sec- Z1 T9 T3 H: g
end' y8 H' j1 k* v; z
end
5 c6 R+ v( z6 h: |" ~
, C2 @) r9 `2 I) {7 ~& Dbegin P_induction arriving, j {0 [ _2 h* A3 w2 Z1 c* v
if A_induct=1 then clone 1 load to P_pick1& B2 N9 ~( H. `( v% z. |: ]$ ^; i
else if A_induct=2 then clone 1 load to P_pick2/ K( A0 j2 @6 _6 j/ \$ N
else clone 1 load to P_pick3
0 C8 ]5 u+ H/ X4 K3 Iend0 O5 d, S9 Y+ X6 H" m7 G$ o
8 U7 y* ^- B8 q$ g
begin P_pick1 arriving
% W2 P% |/ \- V* k3 v+ a set A_i to 1$ [- l1 A( N. W* N# w
move into Q_induct1
' H7 T, j8 e2 r6 D* m move into pickaisle.induct1
. k X# W8 b! ~. X2 G d: ^9 Z while A_i<=30 do begin4 Z7 w! K: i5 H: Y% M8 `4 m
travel to pickaisle.con(A_i): Z; R5 i4 L' ~ g* p/ B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 m4 D# ?. L( N) J- n else wait for 10 sec. h" k2 I) `# E8 Q. x
if A_i=A_leave then send to die
" E' O& r2 b) g: i' f else inc A_i by 1
' `, G3 }; H F) I end
$ e" J) t, J& t% j6 y/ hend
5 n6 n! O5 @4 O# S# u R3 x! H' S' c, J8 M& ]- s+ m. {9 M
begin P_pick2 arriving3 v; T- A1 [$ U1 |8 \
set A_i to 11, _. V+ H4 ]1 L/ Z* h; h; K9 f
move into Q_induct2$ O5 k, \# {! e; M8 R- N( {
move into pickaisle.induct20 B9 R& V# ?! W. `8 H( I. s: H- m
while A_i<=30 do begin
" W3 ?( ~! V% l, ?8 @" S$ d( \ travel to pickaisle.con(A_i)
4 N* l* w4 s+ p3 ]; }- O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( |/ u( h. }5 V; ^7 Q/ g" i L1 M) J else wait for 10 sec
& F- X" Z% E' X0 z+ R w [ if A_i=A_leave then send to die
5 T/ N' `) c& e- j: H% ~! F: D. |9 [( G else inc A_i by 1+ N* ~6 C" ~$ b& |
end
( U* P" k, f; o- ?1 k! @end9 P* s; M# k$ B. w- M1 U
& a* Z! e, W# Y6 P w
begin P_pick3 arriving
% ?9 t( j& x* n: W set A_i to 21
2 M5 j6 P- e8 K& i+ K move into Q_induct3 J7 n& x7 L: Y
move into pickaisle.induct3
" o1 |, j# W- V3 I/ | while A_i<=30 do begin" W, S, a q: I8 o0 \) k/ G9 r
travel to pickaisle.con(A_i)8 _4 G4 V' h% ^ S6 a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 }4 B2 ?/ P- ~9 ?; I
else wait for 10 sec. M# M. {1 w: O0 n% N3 v: i
if A_i=A_leave then send to die
/ G, D3 P8 t& C& B0 j) H2 M' Q else inc A_i by 1
3 ~1 T- x' x7 S3 u# g4 f end+ K3 E3 z5 Z) ]$ F, g$ h9 a9 @7 N
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,其它按你的 ...
|