|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 q% H5 e2 M( ^9 i
6 X) d5 k; P' r1 n Z A+ h. K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 F+ C9 J, u9 t# Y
& F2 r) f. Z8 d" _. E5 ebegin P_read arriving0 u( \/ J3 F6 U5 L
while 1=1 do begin) B7 a% @8 A9 F, o! w6 ^& U0 S
read A_tote from "data.txt" with delimiter "\n"
3 K4 } E* V- ?: @! p read A_time from "data.txt" with delimiter "\n"
, {% N, f6 u, }: i% W5 x( [4 o read A_leave from "data.txt" with delimiter "\n"
& W: a5 }! [8 E" D0 e2 f, r read A_picks from "data.txt" with delimiter "\n"# U7 R) P/ S3 [% q- B. T% _- q# R0 g0 |5 n
set load type to A_tote8 H$ Y& W) a% M$ R$ c; J
if A_tote="tote 1" then set A_induct to 1# }9 D" Q2 U, I0 F4 I0 H: q
else if A_tote="tote 2" then set A_induct to 24 o: J9 r6 X- a4 ?$ N2 y
else set A_induct to 3
3 N* f! O# c* f) U% F+ G" T) v set A_i to 07 q/ v$ Z1 k, _& _
clone 1 load to P_induction4 b; Z, l+ b# E \
wait for A_time sec# U0 v( j6 k" j1 p8 Y. [% S0 M( j
end3 `7 U( u1 s4 c+ I7 u# P
end
# s! N5 Q4 w7 c* l1 \8 D4 v* O% l: n8 d% f* a6 Z9 U/ v, `2 }
begin P_induction arriving
) c. f# f$ d2 ^6 v* ^ if A_induct=1 then clone 1 load to P_pick1+ l8 l2 u P. q( b6 {
else if A_induct=2 then clone 1 load to P_pick27 F0 i+ Q3 C: G( j: @
else clone 1 load to P_pick3
: @# I/ t z0 Eend
& k7 E* k3 |, E0 C% D) `' \" c- T Y6 }7 V6 K
begin P_pick1 arriving
+ O- y7 S E. e- |" N set A_i to 19 t# w/ [% X% R
move into Q_induct1$ P! O Q7 S& H; }- p: o. o
move into pickaisle.induct1
1 s( E/ H8 R, z+ E5 ?; U3 x: p while A_i<=30 do begin( r* y3 [" {1 H9 q9 b; N
travel to pickaisle.con(A_i)4 J& Q o1 }! @6 i/ m. X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 O4 i3 n) f1 B7 b
else wait for 10 sec
( M; T. Z# p9 R. Y5 I if A_i=A_leave then send to die; y, v; P$ S0 t9 p& j8 X [
else inc A_i by 1' n7 k4 A( h0 I' \* \: T
end% P3 R* B: P$ p" \# S
end
8 y4 E& L1 s) Z# {$ R2 X) c9 s: W2 N8 D/ H1 c
begin P_pick2 arriving( f* h+ e: n' ?( J
set A_i to 11& Y* v; U1 a+ b0 R5 ^$ m
move into Q_induct2
$ Q0 q% I7 S& T4 \9 y move into pickaisle.induct29 A3 p) \9 _. m
while A_i<=30 do begin
; h' k! `- f( }+ Y7 h travel to pickaisle.con(A_i)
6 P$ A4 ?2 n) A2 e. s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
a% V0 B% j) N/ @' N2 q! v else wait for 10 sec
/ ]! O6 r* r" |8 ] if A_i=A_leave then send to die
N6 O* u) g' A( c e0 M2 `' g- Y else inc A_i by 1: b) v0 ?+ ?$ K9 ?8 Y6 x
end
. f6 q- D4 A+ H' {& eend) d* u5 k0 j! h$ v
/ R6 p; D0 ?7 E3 f7 G4 b) a; qbegin P_pick3 arriving
" x# b& ^: e) r set A_i to 21
$ a% X5 F. H. ] move into Q_induct3
* B5 L6 q3 g+ q" q5 j move into pickaisle.induct3
) V0 ~7 T+ b7 M3 c' K' g9 B2 V# O while A_i<=30 do begin
" p3 S# _. A1 a' q# P4 c' U2 m* E# n) ] travel to pickaisle.con(A_i)
% f' _5 x- a. [: e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' b: }2 w8 u0 c
else wait for 10 sec
. j) L! Q3 d2 c if A_i=A_leave then send to die
, p4 P) m7 o' Y; J! ]+ D; g else inc A_i by 1
; z- V0 P5 G* C$ x8 p+ t) J end
6 G; \9 ^6 i+ V& e2 j% Uend |
最佳答案
查看完整内容
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,其它按你的 ...
|