|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! g6 l3 ^! ^/ W% ?3 i5 e$ t9 N6 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中的数值,不知道会不会有什么不妥。
$ {9 d% G) Y7 r2 k! j
' q8 n; w$ K! ^: b( g) Pbegin P_read arriving
4 u( F3 W5 N: Q# x while 1=1 do begin
6 w% ]% ^5 R$ H6 @+ ]! x read A_tote from "data.txt" with delimiter "\n"
# D5 I) Z& I+ y+ V+ P) p0 E read A_time from "data.txt" with delimiter "\n"8 k* H2 V7 l1 i1 s+ S1 o' e: v
read A_leave from "data.txt" with delimiter "\n"
% k+ o1 I( t# a) a6 y read A_picks from "data.txt" with delimiter "\n"
! u6 q( c* P" h" F9 z# w set load type to A_tote
6 c5 G3 o5 \ W1 m8 C7 o7 S if A_tote="tote 1" then set A_induct to 1% e9 h; o3 A8 Q/ ?$ f- |; q) O/ T
else if A_tote="tote 2" then set A_induct to 2
9 S2 H& _' |0 N: c else set A_induct to 3
, i' Q# A$ S9 v( S: ^" \5 ^, Q set A_i to 0
4 K' K* _! w/ l2 u0 V clone 1 load to P_induction
( ?9 D- a$ v1 E9 n) |* e wait for A_time sec! g4 Q4 ?- v) g1 D, x q* s- @
end0 g1 u6 q$ X0 N
end
3 o* ^$ X2 A& r; o, x+ a5 ]
}/ u5 |7 L" `begin P_induction arriving
2 T" E+ b6 _2 Y5 l if A_induct=1 then clone 1 load to P_pick1' c6 H& H$ u$ G. y5 W
else if A_induct=2 then clone 1 load to P_pick2
- K7 W! ]' g5 Y0 n9 I7 g else clone 1 load to P_pick34 g$ e1 \ o) ?8 O
end5 h+ x* l1 H' U' W2 X
* M# `& w+ f4 L8 obegin P_pick1 arriving
0 }6 T% |; U; k5 D$ ` set A_i to 1. i1 q& W/ [2 C9 X
move into Q_induct1
6 \( ~6 @! t) [( B$ _ move into pickaisle.induct12 f" b) \% A$ \& t
while A_i<=30 do begin
2 J" n; c! I$ n" c travel to pickaisle.con(A_i)* S2 h, ]& q/ B4 B- {8 r2 f& b, G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 o! Y- i2 Q6 |+ {: f. ^3 m; F else wait for 10 sec, R7 j& z& s% V9 a! a5 q
if A_i=A_leave then send to die, g6 m! Y$ f4 N8 K4 S& n; E
else inc A_i by 1
, j+ Z2 `$ S3 C+ j* b end6 h* l9 Y$ m/ A) {" X5 F
end0 z, J* j: l7 h% U; C
! H4 l$ k# N% n, N- a* @, a
begin P_pick2 arriving
0 g* P2 {) r% ?& M$ O6 w- W r set A_i to 11
1 V! w( \! O: P. b: C move into Q_induct2
2 z. X& X; l3 M& @9 y move into pickaisle.induct2* ? D e" d( j9 q! B7 A2 B. b
while A_i<=30 do begin# b* ]' [& }' A' t @
travel to pickaisle.con(A_i): P# g- e# p5 |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, e2 Y' W4 b# m4 |8 f; I4 y# T0 D else wait for 10 sec
3 G. T% c, I$ C3 @1 K if A_i=A_leave then send to die. }5 v+ p }, \, i7 h
else inc A_i by 1: K2 e z9 l [) s' a/ s
end3 m" Y7 y6 P: p
end D6 p5 u+ K a
7 T8 {7 }( W# x7 o; F; v/ ^
begin P_pick3 arriving
( }0 D0 W* y2 @3 v: ` set A_i to 21! ^# |! j$ r: A6 F2 a
move into Q_induct34 e: o, k& x7 ?6 s7 I5 _
move into pickaisle.induct32 {% P" y: Z0 P
while A_i<=30 do begin
7 P J/ P% e6 N5 t D travel to pickaisle.con(A_i)
. j& m( ~" e1 ~$ D; \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% u1 p* S! F8 P1 ?. O ~2 D; I
else wait for 10 sec
$ P x: T; r" c/ K" L) G2 p if A_i=A_leave then send to die7 q4 M8 j. K: {
else inc A_i by 1. m( p% i$ c, o4 S! {% u2 s
end
- d, O( c& Y, P V1 Y3 a6 Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|