|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" t7 ~, {. D+ q! s) @
" A7 |, r' @, Z0 Y1 K5 A我的问题是,在每个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 H4 f5 C1 I; n$ b
& ~! }4 c2 M" d. p( |0 S0 abegin P_read arriving
/ e1 N8 F, |7 y) l% F5 ^/ n while 1=1 do begin
. V5 `' W# x% q/ | X read A_tote from "data.txt" with delimiter "\n"
( c- z! i/ o! J" ?4 d. M, C) W8 O; I read A_time from "data.txt" with delimiter "\n"
+ `# |$ M* ]/ ]2 [ read A_leave from "data.txt" with delimiter "\n"
5 X; z y1 H S read A_picks from "data.txt" with delimiter "\n"
1 d8 i/ Y/ R' @7 V2 m' s set load type to A_tote, Y& Z3 L6 U2 ]
if A_tote="tote 1" then set A_induct to 1. [; ?- z1 L# u, \
else if A_tote="tote 2" then set A_induct to 2& U! i4 Y! `" z, Z9 m6 F
else set A_induct to 3 7 S: i; u; K# h9 u
set A_i to 0
* ~ W& U6 d" j# J/ E) T$ f clone 1 load to P_induction. }6 s3 R& k" {7 r# f
wait for A_time sec
9 L$ G' c. F, U% U" G end
9 U7 O( G7 _6 \/ h+ ~end0 s$ G9 }/ s' A) K
$ p- i! X2 u. q! z- F+ D$ a, \begin P_induction arriving
. n+ Y3 U. I3 f( D if A_induct=1 then clone 1 load to P_pick1
% v M9 n/ A: b* |6 u7 N, o else if A_induct=2 then clone 1 load to P_pick2
: P2 I- B! U O; Z+ t0 @ else clone 1 load to P_pick3
7 Y% L K+ N& dend
( _( X. D, Z4 j+ i3 z. }. P# ]7 j' T+ `# w; d/ o6 j
begin P_pick1 arriving
4 h+ @0 `7 G. \; D set A_i to 1
, m2 m' o8 w& i7 B8 w5 e9 s6 R move into Q_induct1* F" ^# C" d6 |) i
move into pickaisle.induct1; }0 y5 D1 |6 e c( H( W( v
while A_i<=30 do begin& E0 y) a6 c5 R6 j8 M
travel to pickaisle.con(A_i)
2 a" r$ m" _8 W8 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 s% K* k. I6 M$ I9 J" [ else wait for 10 sec' T& t* S! d5 D; w& I5 _
if A_i=A_leave then send to die
7 o9 M" a6 [/ U1 H else inc A_i by 1* A% S4 y2 L4 p8 ]% ^ ]
end
& F/ R9 {3 z3 ]$ @/ Fend
% |' `. R# p* E& q t7 {4 l$ ~+ ]4 o2 A6 W
begin P_pick2 arriving
+ C2 G1 \9 q7 C5 N9 h set A_i to 112 }4 L" l, M/ c7 F
move into Q_induct21 K, V& g7 o* x3 g) j' r, {
move into pickaisle.induct2
) s( P# X) P8 K( {7 J/ w* p8 K6 S while A_i<=30 do begin' h8 V9 k0 |4 z# T. _4 P- O/ s
travel to pickaisle.con(A_i)" l" Q" g4 z8 R* O3 N$ a. \" C/ Z# ^; I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) ^6 f: D2 B; d! T
else wait for 10 sec
& ^, Y) P' H; `9 o5 l [8 i8 a if A_i=A_leave then send to die
3 T% j! U3 }# v2 U else inc A_i by 1. Z* g& ?0 W5 a0 M& K" i
end
, q+ {# k0 x7 e# L% Q2 s6 lend. b, p4 `7 L) c: I+ ~8 e- B
8 {% M. i5 w/ I: E% k5 T3 xbegin P_pick3 arriving* W$ C0 y( c" M2 |2 v
set A_i to 210 G/ t- t: ?1 ^, W8 A
move into Q_induct3
/ H/ z% ^/ t6 n( c- D move into pickaisle.induct39 ~( G# B- u. D- l* @; v
while A_i<=30 do begin
6 w* i, x3 n/ l travel to pickaisle.con(A_i)
3 C/ @8 P: h3 P: Y! r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* c0 D8 g" Y$ J% ]; A else wait for 10 sec( B. j0 j5 P. Y' H* @: i
if A_i=A_leave then send to die }5 s! f0 L( s' g
else inc A_i by 1
2 V+ }* T" @! E end9 [6 q8 D6 g( R
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,其它按你的 ...
|