|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 g& _3 `" J7 j1 g! v1 @5 U/ X" @" w4 V% e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 W& Q3 r7 H6 ^7 w
+ B/ S+ [* V1 L
begin P_read arriving
4 o' l4 n* {4 u2 Z; R while 1=1 do begin& U% }; N( w! ~
read A_tote from "data.txt" with delimiter "\n"4 V+ L7 C- p: ]# G" O. Z! V9 v
read A_time from "data.txt" with delimiter "\n"' O9 W, `# v' v3 U- ^! J" M
read A_leave from "data.txt" with delimiter "\n"
) K7 c7 R6 n5 I6 e; P1 k3 d+ j* P read A_picks from "data.txt" with delimiter "\n"" ~ W( p7 k" x# [$ h( C
set load type to A_tote
( M" p' ~2 m- J4 L! Q+ c if A_tote="tote 1" then set A_induct to 1
|7 n; ~# ]7 J else if A_tote="tote 2" then set A_induct to 2; J* P0 a6 z" n6 V+ E, z
else set A_induct to 3 8 F, p# e/ ]' e. n# E' r3 U4 ?
set A_i to 0
/ u. L0 |) }# T7 |0 ~+ B1 b clone 1 load to P_induction
) k6 X- M. W$ l wait for A_time sec
]- J$ H# l- W& G M, M9 T end+ S: R7 f3 O1 ]
end
. M, C5 |) P' V7 k# {6 ]- S6 d' f: h. g/ C2 E
begin P_induction arriving1 U' d7 z. S, X/ O, G
if A_induct=1 then clone 1 load to P_pick18 b8 X7 r7 [6 O* Z3 A
else if A_induct=2 then clone 1 load to P_pick2
4 H( t) ] T, r" }+ o1 C/ v else clone 1 load to P_pick3
7 \1 Y ^0 p2 {) {end
# |/ D* _% r$ p$ p8 P6 P
8 B+ t6 s& z; [( g- Qbegin P_pick1 arriving
/ _) G( S/ l, i, |9 e, d& ]/ l set A_i to 12 k( r) [0 x* o: A
move into Q_induct18 y3 D9 b& X9 T$ w4 N
move into pickaisle.induct1& l4 r) g! o" [
while A_i<=30 do begin
0 a% G2 Q* }) a$ J- } travel to pickaisle.con(A_i)3 C1 s" g2 x) A1 `+ \$ V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) H/ m5 w( t: T2 _* |" @
else wait for 10 sec
- ^, L, t! \7 r2 h+ e2 v% A: J if A_i=A_leave then send to die
, P2 m7 r, p. n, E! w% d1 h5 e else inc A_i by 1
# Y& h9 t4 }% W; `, i. N( j end
0 D3 t; }, c0 ^5 \( oend6 {. s: d% v9 ^
- D% c0 k4 l7 p" z e$ h' I
begin P_pick2 arriving0 n$ a; C, E" {4 B# e, _
set A_i to 11
U) K; ^, } U( e/ b move into Q_induct2 y; R! y* Q; O# H2 Z
move into pickaisle.induct2; `% I+ B$ r9 m
while A_i<=30 do begin
7 c; R1 B( B/ D- D9 I( b6 N; a travel to pickaisle.con(A_i)' v* r5 `& \3 D2 ], F2 Y4 F, f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ]0 }0 e, b. f else wait for 10 sec1 I8 K: L4 G1 Y! c) p
if A_i=A_leave then send to die# G) s+ |7 L$ L2 M3 v; J7 O: `' H
else inc A_i by 1
2 g7 r' f5 M5 N8 n/ _2 `( } end
8 _. r+ Y9 z. \2 T- P$ g+ Kend# B3 z& R! ]; I& b0 }
# ^- S# g3 i$ Wbegin P_pick3 arriving
2 H7 K4 W9 ?8 }" _% D7 V# f) u7 o set A_i to 214 j2 w5 ]* |& j9 c9 M8 [$ V& t
move into Q_induct3. e2 E; T. c0 d V6 l/ E
move into pickaisle.induct37 \' ^6 w- F" h- Z. |8 E
while A_i<=30 do begin' ^; W( c; [* I3 B6 t6 _9 f; D
travel to pickaisle.con(A_i)9 }" E" ]6 N) r: ?+ J/ w) a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ T% _3 W: S( v' z! A6 x3 M else wait for 10 sec$ t; Y% y6 d3 ~( n4 n: |
if A_i=A_leave then send to die
9 S. [9 E( e% ^/ ?8 z) g) ^ else inc A_i by 1" E% \& H/ o( A6 j( r L+ f O
end) d: b5 a) L$ E2 \/ i! I$ f
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,其它按你的 ...
|