|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 h* R' j+ r- I3 s3 C- M
1 j; u! K. B' ^7 e9 ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ X5 a. g$ L4 ~4 I( z, ^) J$ Q/ w, ]+ X- j) k
begin P_read arriving
( c2 a. Z3 X1 k. ], m while 1=1 do begin
0 s& d# n. ~' O L; a7 ?: t read A_tote from "data.txt" with delimiter "\n"2 u3 j. n7 Y- U: m
read A_time from "data.txt" with delimiter "\n"8 b% q4 D/ s" l. }2 W" l9 x
read A_leave from "data.txt" with delimiter "\n"
0 C5 {9 F! i* H1 N read A_picks from "data.txt" with delimiter "\n"2 ?- B X0 e6 Y# [
set load type to A_tote
# T. v. ?+ d( h8 ` if A_tote="tote 1" then set A_induct to 1
4 `6 c3 o% H5 y X; f! B else if A_tote="tote 2" then set A_induct to 28 ^; Y7 N3 O2 D e* J
else set A_induct to 3
8 l/ s" B4 [) T; }8 }9 \ set A_i to 0
: S2 K/ D! v4 X' h c clone 1 load to P_induction$ Q* I2 U( t# L; G+ G+ O% w
wait for A_time sec/ p9 Z _; M& J" l7 b
end
( V: J8 B9 {* V( y5 B8 r( l, `end
% C) I5 Z0 c8 G" |: e1 y
. u* ?# S" @6 q$ `begin P_induction arriving
% d* ~/ F$ {- b- @ if A_induct=1 then clone 1 load to P_pick1
7 i1 q4 [1 r$ D$ J" u) S8 B, d else if A_induct=2 then clone 1 load to P_pick2/ p) H1 @2 j" m+ P9 H7 L
else clone 1 load to P_pick3
$ l! d: b$ A# ]3 Y% Vend
Z# J2 _4 |' K0 E; _0 \8 x
+ h, y' ?1 G9 X5 c% W2 _begin P_pick1 arriving8 o9 ~2 q8 c% N$ L
set A_i to 1
V4 Q7 F2 C% [ move into Q_induct1
% a( Y. {) f! R! f move into pickaisle.induct1
2 x5 { D9 F/ }8 U+ c' U; [ while A_i<=30 do begin
/ c/ Y. R# o. Q9 F- J [$ i travel to pickaisle.con(A_i)
K0 v. o8 ]1 m0 h& y6 U" ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 a/ K5 I( w7 R9 L1 u7 Y else wait for 10 sec* g1 [+ B' [) m; K7 u* j5 n- v
if A_i=A_leave then send to die& L6 m8 V/ j( u
else inc A_i by 1. ?! n. @1 J. \4 }8 L) y- }- O
end
1 _# t1 S# B; Q& b3 L: i1 b3 aend
6 V- ^. X: X [0 R9 J/ k
2 W g8 v6 c" j$ ^. mbegin P_pick2 arriving' z" k/ {7 ~' Y9 A( y8 s8 c
set A_i to 11, M4 u4 Z/ ^$ \- ^" t% |6 o
move into Q_induct2
4 \1 Z- q( o, X0 F+ S move into pickaisle.induct2
. o2 W( Q, q1 }4 f& v/ ` while A_i<=30 do begin0 b: J! o% k/ n
travel to pickaisle.con(A_i)# I' c8 x; r, s9 k3 |: s. A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ K9 m$ a" Z3 t. s; a$ ^
else wait for 10 sec- F; _. L/ Y+ z m
if A_i=A_leave then send to die+ M7 x, I S+ z7 F* \* o; R
else inc A_i by 1; p% B. [5 Y: t* V; a4 X
end1 M) P/ M' K( x2 E+ p
end
1 B' ~3 p z S5 u, C
& {- D* y L2 R/ l* lbegin P_pick3 arriving
4 a: x1 j/ u. g* F6 g" t: v set A_i to 21
) f. C4 w# P0 Q7 `/ l move into Q_induct32 b6 Z2 z7 K7 p# b5 [0 s
move into pickaisle.induct3
: t8 W0 x) j7 N while A_i<=30 do begin2 O7 Z, u0 D5 Z% {/ ^7 [! U7 _7 F
travel to pickaisle.con(A_i)
/ j7 P6 K9 T7 V1 {4 {$ P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, R1 W% Y5 U, p! y# @7 K% o else wait for 10 sec
0 F; f4 v9 X' D/ Y' ?6 M( d if A_i=A_leave then send to die: n1 k9 T# J/ }9 r& {! D
else inc A_i by 1) B4 P% d6 j( t/ w) e3 F
end
0 n4 D. N5 S4 t% k/ k; Iend |
最佳答案
查看完整内容
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,其它按你的 ...
|