|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ M- r$ G9 K$ K& T2 m; i$ }7 [7 p7 G7 J4 Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( s1 M/ q4 @2 o" h& i
+ j) Q0 U ^3 V7 w4 m d2 vbegin P_read arriving
8 Y3 e$ S; S2 q; J while 1=1 do begin
+ s0 N1 w* ^. L$ W read A_tote from "data.txt" with delimiter "\n"
* d8 o& H( n, c6 ] read A_time from "data.txt" with delimiter "\n"
0 R0 N9 Q) r& h- Z5 F/ ?# N. t+ c read A_leave from "data.txt" with delimiter "\n"* b1 {3 c) V; Q( v' ]
read A_picks from "data.txt" with delimiter "\n"+ A" O( j% n% P- F0 O, z( i
set load type to A_tote
6 ?, y# y1 ^6 C if A_tote="tote 1" then set A_induct to 1' V( J) }$ T4 j4 L3 R
else if A_tote="tote 2" then set A_induct to 2
; {! ], w8 o) {" p2 I else set A_induct to 3
- g6 W7 e. d$ S set A_i to 0 c' g% ~5 X C4 B5 y, l: D
clone 1 load to P_induction6 Z6 N' }' p0 B ?
wait for A_time sec
$ N3 m7 P/ V3 f, X& m end8 T' ~# L( U( ?% L! P
end; Z2 q8 F/ {5 T7 t N
4 f# \) F1 g& K8 i6 `
begin P_induction arriving
+ B1 {& l# Q0 ?+ d& @0 j6 U. e5 i3 | | if A_induct=1 then clone 1 load to P_pick1
* x7 M4 l6 H @, g, { else if A_induct=2 then clone 1 load to P_pick2
( T- W' y* \- i+ k5 w9 u& r else clone 1 load to P_pick34 O1 q% V* C7 g; k! K7 |
end
% X1 \0 N1 f% I4 G/ y, ?/ x8 R ?" L2 @
begin P_pick1 arriving
$ X- v4 U! |. w set A_i to 1
& E$ V- f U6 c4 {9 G# b move into Q_induct12 q3 I& x! [' T& X; T& E4 K }# w
move into pickaisle.induct1
" m" n* N& m; C0 X4 ? while A_i<=30 do begin
. |) d+ P1 t* u4 m: O travel to pickaisle.con(A_i)
0 r: d; ?$ c( W9 x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 @( d7 g$ m& X, }) d9 Q# |, U else wait for 10 sec& z& @2 ^1 s8 F
if A_i=A_leave then send to die" ?) p9 ~, M# f- T4 j8 U
else inc A_i by 1. J: `1 Q; {/ X3 C" s
end
$ W I5 F: ~7 s+ a9 d' ]end3 j9 `+ \5 l7 `
, ~$ b! h6 w. D' u$ W8 L. obegin P_pick2 arriving
1 p' \0 ]2 A$ Q, T- {5 Q! r: [ set A_i to 11
, Z3 }/ k' Z) d+ M! m7 S2 _ move into Q_induct2+ G: v. i2 P7 A' T
move into pickaisle.induct2, s) u1 ^, M/ p( r' j
while A_i<=30 do begin& p; O$ k8 d6 j6 t8 R
travel to pickaisle.con(A_i)
- a X' w( B: w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. I' v% B, k" V else wait for 10 sec
" T9 U; n* ~3 @& Y if A_i=A_leave then send to die
8 K4 s, i# L, y else inc A_i by 1
' ?& t* ~$ j9 ~: x# a, Z end- f8 \8 p3 J7 a4 K" G) X l' m
end+ Q3 i0 y1 `) O3 f
2 |+ ?5 K# i# L0 ]begin P_pick3 arriving
. V, v! R4 C2 @' Y set A_i to 21
# f: L6 |& k$ m% z move into Q_induct35 B% Y+ p l% x' a# i4 `. h. Z+ u# K
move into pickaisle.induct3
) G+ s' V5 T9 _+ P, ^/ v while A_i<=30 do begin
: J/ Z7 |$ e0 Y% } travel to pickaisle.con(A_i)
2 J) x$ J1 S) {: Y! Y; k8 n0 D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 F& w5 s: f4 C% u else wait for 10 sec
# A6 D4 Y4 x4 _1 m6 W# `' t if A_i=A_leave then send to die
8 k$ a+ S- A' G( T) b: y1 s else inc A_i by 1
}1 g9 L+ b# h# g end5 R. n9 o4 v7 i" p# 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,其它按你的 ...
|