|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! p* i# s( x Z3 f1 V# S
+ p- {4 N$ K; |; V w" f; R F我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) V3 A0 _' J7 m& S. P1 r
7 u$ @+ }' G, a9 F# Fbegin P_read arriving. T( A& ~$ ^/ @: |+ D: l
while 1=1 do begin
- F: a: r$ L" }7 J read A_tote from "data.txt" with delimiter "\n") I; v, B/ j& I
read A_time from "data.txt" with delimiter "\n"8 R! O& O# d/ @: z! {: s- G* @
read A_leave from "data.txt" with delimiter "\n"0 h: d( W! ^' p8 Z# M( m
read A_picks from "data.txt" with delimiter "\n"
6 O; i+ Z% V2 _& v1 _ ^2 v( x set load type to A_tote
I6 I) E+ y% s4 ?+ H if A_tote="tote 1" then set A_induct to 12 U% l5 O [1 K5 `- i
else if A_tote="tote 2" then set A_induct to 2# e( z- r+ q& C1 o5 h; n
else set A_induct to 3
) \) p5 H5 r9 p2 N set A_i to 0/ r4 a% l3 z& V! y4 j7 \
clone 1 load to P_induction; J& W! Y3 @# R/ ]
wait for A_time sec
% n9 t% r+ m5 V' {5 z, x end4 G. m' R3 J, ?6 |2 f, a' ]) X
end# G J4 \5 i& U9 t9 N& U
, Z7 e' ^4 b& i6 wbegin P_induction arriving& k# \$ R% z/ \/ u$ \9 V
if A_induct=1 then clone 1 load to P_pick1% E- C& t2 x5 u: K0 P
else if A_induct=2 then clone 1 load to P_pick2) p) }3 d) ?( Z) z
else clone 1 load to P_pick35 i" ?4 q5 Y. G5 ~
end
( S" l, j- c- P6 l6 Z5 S1 g6 @# S" J( Z9 P( H- A- R
begin P_pick1 arriving
- J4 Y* n) k( E6 }; ` set A_i to 1- T" I4 R# }0 ]8 b3 G% v# _
move into Q_induct1! L$ t: c1 E8 {8 d9 k, t+ h& @2 u4 T
move into pickaisle.induct1, l3 d, u2 k# w
while A_i<=30 do begin6 w2 z. q* p, ^, X, X
travel to pickaisle.con(A_i); @* ^5 P; {( B/ Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 v T6 w9 e' o/ @8 t
else wait for 10 sec
M) v$ S, ~4 @; H if A_i=A_leave then send to die
5 B3 p6 U& s0 P- f3 P1 G' H$ e else inc A_i by 1
1 [1 l0 z' p2 [: `. z end U# @2 V. J1 x
end
' q1 }8 k( P! [" ]2 R0 J% L# }% O) _3 `( n7 E6 r
begin P_pick2 arriving$ \* L, @ [2 w9 P
set A_i to 11 [% C4 Z K# V4 Y$ Y1 b
move into Q_induct2$ {4 i# Y: J: r5 o' h6 `+ Y
move into pickaisle.induct24 L* c/ n" z4 z% D
while A_i<=30 do begin3 Z% g! J6 x, d k A3 f; r0 P8 p
travel to pickaisle.con(A_i), x7 |) c) G( I4 `) ]/ n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec y+ [# L; W- G/ N: y4 F5 K
else wait for 10 sec$ Y) P* E( ^1 W' ^! @
if A_i=A_leave then send to die/ N. P0 e1 G& U
else inc A_i by 1
! l2 B! K8 p2 \; B" k+ l- ?3 P! K end
, |. w& A: x' P3 @end' C/ D9 }1 B' j( S3 r; A
8 g0 H/ Z/ @/ R( V- Tbegin P_pick3 arriving
+ x) {9 A2 |) g. b) A/ ^9 `- E5 r7 C7 N set A_i to 21
0 p' \# K u7 v- r2 A8 B move into Q_induct3% u- T* s$ Y5 g! W
move into pickaisle.induct34 {3 u; e$ L' `2 M& V2 z" Y. T
while A_i<=30 do begin1 z2 K/ L5 A( m
travel to pickaisle.con(A_i)
$ W) L: y& l9 l1 u2 d- q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) r/ W7 `% B3 t$ R; e1 I
else wait for 10 sec4 P' B& ~5 f; @2 h! h/ w% W. ?; f
if A_i=A_leave then send to die
% h/ u. R& Z; A N% x+ { else inc A_i by 1
5 d: ]! X: A: w s" N4 G end
" O3 y) n# P% u& F8 c1 e9 \+ Jend |
最佳答案
查看完整内容
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,其它按你的 ...
|