|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 Y% \3 T3 x! J8 ]" d) o; f1 q& U4 v4 n' z* r( K$ S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) x& d1 B2 b: ~! C
: j3 X8 p: R2 c Sbegin P_read arriving
2 L2 l5 {: `8 l1 E Y6 } while 1=1 do begin
9 G9 D# @ ?, D: } j read A_tote from "data.txt" with delimiter "\n"
, [2 D; F2 W* G read A_time from "data.txt" with delimiter "\n"# T5 O2 e5 F' D
read A_leave from "data.txt" with delimiter "\n"
7 I8 s; p. t1 p7 n p! O& r" E( { N read A_picks from "data.txt" with delimiter "\n"4 g5 m0 f; ?) f) P& t+ @+ e
set load type to A_tote
8 t O; q( r0 t" l h if A_tote="tote 1" then set A_induct to 1. T1 k1 G& H2 {' W& l( t
else if A_tote="tote 2" then set A_induct to 2
0 H, c& P( a5 x/ t3 ]$ J- @ else set A_induct to 3
2 n3 p% U+ p* D1 Q2 j set A_i to 05 D6 I; i$ ^# `: e( H
clone 1 load to P_induction' v; C! P8 q$ Z M6 v
wait for A_time sec
c: l8 ^$ v6 u* B end
" L& Q1 _$ b; L l& Bend
4 C% {* r' |% h# ~
% i: @1 f1 R* j O5 H/ _6 x" vbegin P_induction arriving9 h9 Y8 u/ q, R, d1 u8 x& T
if A_induct=1 then clone 1 load to P_pick1
! k9 q( G% _. w. K- b* M else if A_induct=2 then clone 1 load to P_pick2* G$ T7 ~6 C7 |: s- F1 b
else clone 1 load to P_pick3
; ]8 T. C6 z" Q$ q0 [end
' X4 f* z# _) \. r
. `4 c0 {: u$ q$ q$ vbegin P_pick1 arriving
2 r& r' x6 D$ d6 |8 V- x set A_i to 1" w4 x7 l5 d: {1 y* ` _
move into Q_induct1+ T0 h. \8 b8 Y1 A; V, U
move into pickaisle.induct1" k; w( B9 i0 u6 r+ N9 b
while A_i<=30 do begin
6 ]8 \3 V5 @+ S( V+ ^. r6 Y6 F% l travel to pickaisle.con(A_i)2 _ Z; {# M9 `4 M; }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ~, D; _6 L' D' N4 U
else wait for 10 sec/ L. ~3 u) u) }- s, L" d
if A_i=A_leave then send to die% w. o! }! Z; U: O2 B: r7 R, P
else inc A_i by 1: Q/ P/ \0 P6 ^9 a1 ?( q
end0 C& |+ b: M+ n [2 [
end0 [, i5 a4 t6 N
7 N" i6 I7 L# h4 B$ Q8 v
begin P_pick2 arriving
$ O/ z$ t' P2 } set A_i to 11" z* V( b% s$ \, h8 R% `
move into Q_induct21 j! k) G$ {6 N# G& T* O: [
move into pickaisle.induct2" h- [8 B/ x8 p: d3 d% R3 j
while A_i<=30 do begin' o$ I6 E0 N Q) U5 j
travel to pickaisle.con(A_i)
/ N( i. `. q0 ]- Y/ i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( X B) P! P8 N; U- ?$ I7 G else wait for 10 sec$ r) ?- A% W1 x7 O
if A_i=A_leave then send to die
3 ]2 e& \6 x% C: G else inc A_i by 1 R; z# l! X! |4 j
end
. i' v _" L; y0 N) L& Mend& r4 q- E( L4 m: }1 Q
* [0 ^$ k7 U3 ? D' I
begin P_pick3 arriving6 ~/ }1 M0 |% _) d
set A_i to 21
% S h9 s9 A8 M4 _2 F0 Q5 W move into Q_induct3- V0 o# Q) h) B# s- `3 d, M7 z6 \
move into pickaisle.induct3; l) x1 ~8 h% S( n
while A_i<=30 do begin" t1 K/ d; ^- [" ^, d
travel to pickaisle.con(A_i)$ u8 B) \/ Y; g% w# Q$ X, Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S) Y; D- s- b3 W: w3 N
else wait for 10 sec
5 l& h% V$ U1 I% p; _1 j if A_i=A_leave then send to die% E) R/ y# j) \( k% ^
else inc A_i by 1
5 `: G D9 f- M6 o$ f end; a& z, ?( n; m7 g
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,其它按你的 ...
|