|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% f) S$ G5 G. w
E1 L) X4 o1 J, ~. F0 ?
我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 U6 s" p" I' G/ Q' c2 j
* T N) H$ X# @1 R# e& U' Obegin P_read arriving5 E5 M7 h* S4 o+ T9 x% i
while 1=1 do begin
( @# f$ M2 C4 t1 W4 B$ b4 s read A_tote from "data.txt" with delimiter "\n"
9 O: u- B- [* k7 a, i2 @ read A_time from "data.txt" with delimiter "\n"+ _ Y6 z% A& z
read A_leave from "data.txt" with delimiter "\n"# J8 {4 O, A9 A: e4 `* J8 a; {, m
read A_picks from "data.txt" with delimiter "\n"
% e2 E# L% |8 K- y N3 O8 M1 D set load type to A_tote7 S7 ^- s0 R8 l/ f' g
if A_tote="tote 1" then set A_induct to 1
- _6 u- g% X$ J+ X9 g9 F; {$ s) E else if A_tote="tote 2" then set A_induct to 2$ `' v3 f5 }5 K, q
else set A_induct to 3
% i n$ S. m: I* j set A_i to 0: v1 H9 J! W$ [5 \) F$ P& ~( ?5 o
clone 1 load to P_induction+ S6 [. G! u/ z( e$ Q6 A! s
wait for A_time sec
( [' Z; A: W4 c$ K* u3 G end
# z' j' ^8 k q( E$ Y: @, Zend1 |, h% W# c! I' |
X/ I5 k C1 S0 u# P, h
begin P_induction arriving
( B: R: u# Z f7 Q: z4 K if A_induct=1 then clone 1 load to P_pick1* F2 x9 r7 J5 x+ H# Z3 z
else if A_induct=2 then clone 1 load to P_pick2- Z' U& W0 }; Y- Y* c4 P- e% F
else clone 1 load to P_pick3
0 t: Z) z) O2 g' N3 r. p Yend
! ^$ k: p# k! {6 ~
7 d8 c* b. V/ w- ~begin P_pick1 arriving
2 ]$ u3 M4 g+ e8 ~# r set A_i to 18 `& J- W, j" y3 Z+ O
move into Q_induct1
9 c3 Z+ l; c! X4 X' f move into pickaisle.induct1
1 S3 m. a$ z9 K. ?. u6 m while A_i<=30 do begin9 Y/ e2 U( N7 p
travel to pickaisle.con(A_i)
$ A$ m. _! q6 r& e8 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ a) {+ O0 P4 E# A$ _
else wait for 10 sec0 ?$ y" A. J" Z
if A_i=A_leave then send to die
& W- b. j) t n7 B else inc A_i by 1
) o# {1 {8 a1 x end
2 ~ I3 \ F/ n1 x m! Iend' j4 i% N) R! e8 t& R5 e6 @* {3 ?4 D% O
8 n6 ]1 k5 D& c' v
begin P_pick2 arriving1 k1 @" C6 K/ O# o
set A_i to 11
: T( v+ }9 [" B: Z1 w move into Q_induct2
0 k5 T/ t+ D- ~" E, v, t move into pickaisle.induct2; S: [' j' w* G* W* A3 P0 a
while A_i<=30 do begin
3 J5 [) n0 A" c7 r travel to pickaisle.con(A_i)$ u8 W# F7 i7 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; o- i* I j$ }& ?
else wait for 10 sec7 X- ]0 @0 a' i! Q8 y
if A_i=A_leave then send to die& W# D9 \% L' Y
else inc A_i by 1
; q, x6 f2 V; w# k0 t9 R: Q4 s8 S end$ w$ e! a6 ]! D5 A
end$ P5 E W9 M1 G0 N$ P5 F$ }. P5 h
G4 `) g- R' p6 z3 T3 ]
begin P_pick3 arriving
1 H4 v! u0 B7 i' q set A_i to 21+ o' V3 k3 _5 _; H
move into Q_induct3
7 y- K" d) M* `7 s move into pickaisle.induct32 G) F. d) z$ a' a5 P) S
while A_i<=30 do begin; \6 o. I; ]4 E( w9 I/ O8 G
travel to pickaisle.con(A_i)- b# n" c. ]: l9 Z+ u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 Y5 j1 o' U0 |$ i# A- @ m else wait for 10 sec
& Z; C# J( B: A if A_i=A_leave then send to die6 {! e" [3 i$ v+ ]/ U( Z3 q
else inc A_i by 1! N% g5 u! A/ A- \" [
end' Z3 B4 b% l* l/ L( h
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,其它按你的 ...
|