|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 c: x- C/ a) ]( T% f* s
, D; ?( j' F/ A7 y6 V' R. |1 E我的问题是,在每个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中的数值,不知道会不会有什么不妥。) P# j3 H. g. K. V1 n W+ W" r
4 I8 u+ b& y! x. T- `, `4 R
begin P_read arriving# z5 K K/ I* v( ]1 e0 v) m
while 1=1 do begin
0 o# P0 o4 k$ `8 t5 D9 q read A_tote from "data.txt" with delimiter "\n"1 g) [0 e/ F. ~, I2 `7 ?# Z! R
read A_time from "data.txt" with delimiter "\n"
+ k& @! { f8 N# N- b read A_leave from "data.txt" with delimiter "\n"
9 I, Q' [# x% A" t6 y read A_picks from "data.txt" with delimiter "\n"/ g( T- v$ t. R1 }) b4 I
set load type to A_tote
# \) Q6 m! G& B$ R. B3 ? if A_tote="tote 1" then set A_induct to 1" z. f- |- y$ s# l
else if A_tote="tote 2" then set A_induct to 2# X0 j5 O: V3 P% o! T% t2 W
else set A_induct to 3
1 d' \ \# X" x9 C. X* I8 a+ s set A_i to 0. R( W% U2 t4 s' A- B
clone 1 load to P_induction+ `9 ]& I7 v4 l; B+ M* E' i) D% i& q
wait for A_time sec4 B/ p L) O& f: I! s6 s2 ^
end5 Z: i3 E, A7 Z3 U/ a2 W5 n
end
( g& @1 `! ]+ t* j7 [$ ^# b. ^
( _' S& L6 M! }5 Xbegin P_induction arriving/ ~ ~$ y4 n& X; r* w
if A_induct=1 then clone 1 load to P_pick1
& h4 a' H( [. L6 f: A% ?7 \ else if A_induct=2 then clone 1 load to P_pick2 A0 B/ i7 n6 _' ?, ^
else clone 1 load to P_pick3
/ y% L9 S( P" Y$ ?2 xend7 ~+ w# x; |5 h) }- l& W5 o$ G
( P8 y. F% J# V" r3 U, k* ]
begin P_pick1 arriving0 k. s3 B3 Q4 z, @
set A_i to 1
$ o9 B$ u2 F3 I. I; | move into Q_induct15 a, q0 Q3 M4 C5 J
move into pickaisle.induct1/ c8 g: k) ~9 `
while A_i<=30 do begin
* m- K! B9 P1 j2 p travel to pickaisle.con(A_i)
; ]: E, h4 w* Z+ \1 h, ?/ B' o$ E4 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& Y: ]. c6 q5 ]1 d( L/ M5 \% \* s+ y! `
else wait for 10 sec
. d1 g0 ]: ~& c: ^6 d if A_i=A_leave then send to die
: Z$ ^0 m5 v; I1 } else inc A_i by 1# U% J8 B- U8 S) ~# Y- R
end
. Q$ K9 \9 j' H v- X/ S+ X! iend+ d( O2 s3 d# [ D4 z, d
( l6 y" `$ s: E( s' Pbegin P_pick2 arriving
% h, F. I$ q) d" v7 I. r set A_i to 119 P& ?7 [- k3 w- h4 \5 b/ c5 i8 M9 u
move into Q_induct2
8 d7 X% z) n1 t* N5 R move into pickaisle.induct2
% |4 E. X. d' ^ M# a6 M# F while A_i<=30 do begin. w7 n, N- n" ^+ K
travel to pickaisle.con(A_i) K4 X* @9 z+ u- f: e- d% C; E" l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S( ]2 g$ B' e+ z- ~
else wait for 10 sec, d$ d, s: `5 v
if A_i=A_leave then send to die9 P* j# F! B9 `1 Y
else inc A_i by 19 P2 I. j4 {. m/ y$ P: B5 i
end
6 c9 C: i/ ^2 {% \" R! Qend
1 w, _1 [% a& e8 h1 W# W9 I3 R! q9 Y( R/ n/ R; p
begin P_pick3 arriving
) J) P ]0 i( K8 _ set A_i to 21
$ `2 D- |* {, U5 Q" i move into Q_induct3
( r; m1 v! E( V/ I) d move into pickaisle.induct3
6 X+ {3 Y7 W) R1 R5 P5 K5 S# A while A_i<=30 do begin5 D8 b, h4 \% f7 }
travel to pickaisle.con(A_i)
# [& A) ~- `: k9 s* Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 v7 [. j& F9 l
else wait for 10 sec) e8 }8 f# {% E4 c1 v% Y6 q
if A_i=A_leave then send to die' M' i( |" G, o$ v1 T5 I1 Z8 \
else inc A_i by 14 U$ K* a- Z/ y, W$ W P1 \& S& n
end
6 A$ A( b4 q/ r- E) R) P! }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,其它按你的 ...
|