|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ B; p" V9 M" O6 j" W1 B* ~& A: X5 M' g' p/ |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! f3 O1 n& `' o: v
* _* b3 B, h# P. ~7 bbegin P_read arriving
; k7 C) K/ l' }0 |* Q7 X& i9 @ while 1=1 do begin
' ~' {5 ]. i; q) h read A_tote from "data.txt" with delimiter "\n"
1 J& W: A% e1 e: R% m read A_time from "data.txt" with delimiter "\n"
$ B: c4 e9 |+ S: a: u6 T3 R' W# \) X read A_leave from "data.txt" with delimiter "\n"
# o& {, o: w9 V4 q0 [ read A_picks from "data.txt" with delimiter "\n"
0 {/ L1 c* ]( q/ M) @$ } set load type to A_tote
$ c' l; s) @* j. w$ O if A_tote="tote 1" then set A_induct to 12 _1 X) S2 `6 g/ N( d
else if A_tote="tote 2" then set A_induct to 27 \$ \) o! ]. [- j" \ g
else set A_induct to 3 ! A* |9 U) z: S, X n. d% }
set A_i to 0
2 @# }& c4 h% J9 y* Y4 F clone 1 load to P_induction
/ t# ]% O: e$ S wait for A_time sec
3 i* t; D" S9 p) v C A end3 _% `# I0 u! m
end
# Z! j+ B; N! Q; e& B% x' c( d
% g j$ p; R- ?9 wbegin P_induction arriving. k6 I. A" [2 X3 I' V$ k
if A_induct=1 then clone 1 load to P_pick1) `% x! K, S; S( W
else if A_induct=2 then clone 1 load to P_pick2
" P! R4 G- t% M2 p7 @ else clone 1 load to P_pick39 E. V9 @, k" T. N5 {% ?
end
8 N; p) ?+ r5 w. X8 X1 i# p- V! p5 z9 w) e
begin P_pick1 arriving7 \' [0 F- K7 L
set A_i to 16 n( P* H6 h9 l
move into Q_induct1
^0 I* @" C5 |: ?) d move into pickaisle.induct1
" L) B- V: g/ ]4 H! s) B# W7 P+ K while A_i<=30 do begin
& w P- J; T% _; @+ N& F, U travel to pickaisle.con(A_i)
% d/ w% Q& w! S* F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 ~( X6 z; B% i4 P$ o" u+ U9 { c
else wait for 10 sec
r P; r) b1 c) x if A_i=A_leave then send to die3 e4 B. \, g& e8 `3 G4 Y0 n" X
else inc A_i by 17 H. ^; l" p1 j& m
end
; |- z8 c P) ^6 n* U. v% b5 }3 Uend
- G8 \9 Y- ~" e3 a, i( u! C' K8 j: p4 u
begin P_pick2 arriving2 i+ S2 Q- ~3 r7 G3 L' l
set A_i to 11+ A7 g3 F/ R) J1 c& g! j
move into Q_induct2; [6 S" M3 Y( L' f: f `
move into pickaisle.induct2! Y: ?* o2 I7 N2 }
while A_i<=30 do begin9 J6 L' G$ @/ [9 v
travel to pickaisle.con(A_i)9 `9 c" F$ _, V+ ]2 }- t* D+ V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& I2 ^5 V0 ]; _; b* a, ?/ w0 S else wait for 10 sec$ f: s- z4 ~' M- x$ ~2 H3 k; d
if A_i=A_leave then send to die+ ^0 F4 ?. ?/ J( y9 G* Y
else inc A_i by 18 u; l6 r g0 V; F* j
end
6 N% F: U/ p4 k6 r+ m- A8 T+ ^end
, d$ Q: k! @; t) o e* X$ m! P' i' k2 k; _
begin P_pick3 arriving
# B! e+ W/ I8 Z, Q set A_i to 212 Q$ L s- {6 h) K0 I+ j
move into Q_induct33 W3 _! T9 B# ?9 j* s$ S
move into pickaisle.induct3
& q$ a2 w: Q' B while A_i<=30 do begin
! s: a' _3 D0 k9 B! g7 r travel to pickaisle.con(A_i)
3 Q8 \' t7 h3 k' W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! `8 j" g; b- ^$ M
else wait for 10 sec
# E. Z$ r/ F1 B, B% x, m) I' ^ if A_i=A_leave then send to die
7 m) p/ A' r" M+ h% [ else inc A_i by 1' E9 ~' c* Q- z4 ?
end& T$ ~0 m! _' y8 w
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,其它按你的 ...
|