|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. C, x6 ]4 e5 e4 P. a5 h# n
: `1 Y: G' R/ U, ~0 O我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 W' E7 f: ]3 @5 ^" S5 X
3 O4 D8 B4 _5 H h$ y$ _/ |8 O6 E
begin P_read arriving
9 q2 M/ l3 w3 N/ J; f5 Z while 1=1 do begin
, u/ E. T3 u/ G' G9 | read A_tote from "data.txt" with delimiter "\n"
/ K. P; O# e0 d* W read A_time from "data.txt" with delimiter "\n"7 |. {. G- h( c1 ~7 s7 l8 d& \
read A_leave from "data.txt" with delimiter "\n"
) L; m! u R% B5 R* u p read A_picks from "data.txt" with delimiter "\n"
/ w6 V- f# X+ Q set load type to A_tote5 M. c. D+ e- x
if A_tote="tote 1" then set A_induct to 1
$ v/ b5 ?2 k, W* D else if A_tote="tote 2" then set A_induct to 26 Z3 w" t- G4 k3 y$ b* G1 G$ a
else set A_induct to 3 4 o- r# t1 G# W* h% P
set A_i to 0
: Q' m" h! R, x clone 1 load to P_induction: F( W, m1 z- U! e# b& Q
wait for A_time sec
+ d! O( l8 |! ]! u) f0 Y) |0 w end: g9 N% q. T: g3 X4 Z+ W7 Z
end6 y: R7 o. W4 ]- R7 G
0 w5 s+ f8 s: x+ B% e& ?begin P_induction arriving! I4 w. _) [6 i) J; N4 f
if A_induct=1 then clone 1 load to P_pick16 X) b7 `3 T6 D: [9 f
else if A_induct=2 then clone 1 load to P_pick2
; S8 `' w# Z+ O$ s+ m$ G else clone 1 load to P_pick3
# k7 p W, W/ F* ^# y! i' Xend( `* Y( A% ^: g# |1 H! W4 z7 V! L4 }
3 K' R* ?3 [" j1 _% d* W Y* u7 ]
begin P_pick1 arriving
5 \1 R9 }+ l/ X1 s: Y* I set A_i to 1% S; Y; F- `$ S9 w8 a
move into Q_induct15 S+ F( a) i+ x: h4 T
move into pickaisle.induct1
. K6 @1 K. C" ^. b& `+ r5 V# o6 ? while A_i<=30 do begin6 o+ D" Q/ V" z# d
travel to pickaisle.con(A_i)
/ }6 n* x9 k7 j$ I3 e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ W1 @, X I! e4 @9 J/ S4 W
else wait for 10 sec7 R9 f) {7 T8 t0 A" {( T: N
if A_i=A_leave then send to die
& k, [5 t3 x( t else inc A_i by 1
% b' E! ], s9 R+ f. Y: t end
. d0 b1 r" ?' @1 Eend
5 j+ `# v. O6 s: k, L- l
3 j. J, Z2 S3 J: @begin P_pick2 arriving6 ]; `" z7 u/ P: L [
set A_i to 11$ o$ m; b4 g3 V9 @' ^- h$ F3 Q
move into Q_induct24 W7 G3 ^) ~. R" ?! x& X) h3 Y
move into pickaisle.induct2
/ f% p4 I# b. a while A_i<=30 do begin( [* d$ g+ [0 ^
travel to pickaisle.con(A_i)4 g: [4 d ?( I3 H% ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* `/ L/ E! p. e5 V' U$ O$ B else wait for 10 sec
L; X: a& T4 @% K' O if A_i=A_leave then send to die
. U* h# h: l n/ Y0 _1 ]5 d else inc A_i by 1, Y, q/ @. \2 P( H
end
. b* C- U' x* r+ r% aend+ U* [/ {' R1 X3 a
8 Y% b) o2 h- L4 V! jbegin P_pick3 arriving
7 p5 I' W% c3 B5 N% ]% e) } set A_i to 21) n+ U u1 r6 D+ ^9 H- E7 {# r
move into Q_induct3
! V h* b% u+ X) b3 Q: f) [ move into pickaisle.induct3
& X, E. W) p1 Q' `; z while A_i<=30 do begin
% A, e @1 r; L+ L, b. u1 u) q travel to pickaisle.con(A_i)$ J( }% r3 J6 D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ~$ _ y) E& E( S else wait for 10 sec
5 F6 A, D+ ^6 g# w if A_i=A_leave then send to die
- W3 S% R4 Q8 M) @ else inc A_i by 1- q! j7 c* E9 ^- K
end* \3 @5 ?3 D/ `4 u2 d
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,其它按你的 ...
|