|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. L6 L6 N) w1 I7 h6 f# ]% t# Y1 n
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! t4 a, m; }+ w6 f. {# L
; m1 C) T. v2 @( N3 ]7 G
begin P_read arriving
5 v y1 B g, r: J while 1=1 do begin5 u& Q* D3 A/ w; h) f6 N$ o
read A_tote from "data.txt" with delimiter "\n"
: J* n) w( @9 I# W' T I read A_time from "data.txt" with delimiter "\n"8 o, `% _3 U$ }
read A_leave from "data.txt" with delimiter "\n") m5 L8 f* @, p& a
read A_picks from "data.txt" with delimiter "\n"3 r; r1 B7 R% v% O: s
set load type to A_tote
9 ]8 x6 Q B- x4 v if A_tote="tote 1" then set A_induct to 1
( Z' C; j; r" d) u) T else if A_tote="tote 2" then set A_induct to 2
4 K8 V4 C- i+ `7 | else set A_induct to 3
4 G; r: H7 Y- I. i set A_i to 0, l. ^7 B! r7 h+ f- d
clone 1 load to P_induction1 W8 u/ J* ?# v" }* ^
wait for A_time sec
4 [5 a! W2 Y$ z" x end0 D6 I3 V# |, y! x" L
end2 c; w, K, K* C
8 ^ Q* v% B: Z( lbegin P_induction arriving# [- A$ R; q; F* i8 `
if A_induct=1 then clone 1 load to P_pick1
& I! ^8 g( c9 F% | else if A_induct=2 then clone 1 load to P_pick2
7 ^9 Y/ S$ q' N2 p else clone 1 load to P_pick3
+ ?5 m; u1 q, Q3 K' y, u* C3 }7 kend- p1 \% Z7 F. I4 \
+ h( w/ I0 ~1 e' T5 a
begin P_pick1 arriving! D. D# k/ O2 u7 M
set A_i to 1
3 b! U: b5 K7 i3 s) V" ]. n( P& M- v move into Q_induct1. Z% j, [1 m: D
move into pickaisle.induct15 N/ R! s; c# Y! a6 e8 d( N
while A_i<=30 do begin
- J+ V9 R+ |4 m% t: R0 D9 U9 F) g travel to pickaisle.con(A_i)
# I* `+ ]$ K* u3 o# n6 a8 ]% C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% m! H; z- i0 z9 u3 O8 `+ z* v
else wait for 10 sec H: G1 T- O4 l D$ G6 o/ L) S, ?
if A_i=A_leave then send to die
$ g" W2 Q9 T# ^. @, H( k* f& X else inc A_i by 14 I8 }9 X1 w# Q }0 S5 }
end8 Z% m5 K, k5 z
end
% H4 A# e+ n% K z8 j; ]( [) Q4 F' k# k
begin P_pick2 arriving
6 X8 Q) \) F6 v0 t5 a( J; N set A_i to 115 w2 M" g; {- B1 a
move into Q_induct2, e. x7 N! f9 }1 n# q# X# h1 s! `0 m
move into pickaisle.induct2- P1 {* r# o+ A `) `
while A_i<=30 do begin# _: |" ?* E7 H! t! f1 A
travel to pickaisle.con(A_i)
+ D F9 m) O0 L; C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" q' R3 S1 g0 ~# _8 o
else wait for 10 sec
9 |% f1 @! [* B8 _6 x7 B6 z if A_i=A_leave then send to die
J& d5 a* i l7 c; w else inc A_i by 1
8 J" f I; e. Q" l. Z end
# U3 c1 D( J" f7 f% P7 B rend! i- b: \0 u3 {
5 n, h- v2 k7 g8 V: h9 |" z o/ m
begin P_pick3 arriving7 h @/ |6 L( s8 e0 o0 ?
set A_i to 21" @: g8 A& z4 m1 R$ t
move into Q_induct3
) C$ b9 f( A6 o; m! O. l' X move into pickaisle.induct3
: s2 B7 c1 D! w$ g5 a2 c$ [+ e while A_i<=30 do begin
8 G9 e- b+ d S# y9 v' M0 J travel to pickaisle.con(A_i)
, n8 u1 ]& Q+ m/ } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* w. R7 ?5 E. }; d: u else wait for 10 sec6 R- ^& e3 f/ J# J; P7 g! T. c7 ]4 x
if A_i=A_leave then send to die
6 j2 R- O8 y" V. F. G& s else inc A_i by 1
: d" N6 }! c2 D9 A8 {( F' T' |9 s end
4 v1 t/ B/ x; b9 O$ A9 Xend |
最佳答案
查看完整内容
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,其它按你的 ...
|