|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% A2 H& r$ j) x/ v! Y
3 s. J2 Q q7 l2 H& u我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 a [% }7 {2 f$ R' k. N& Y# N9 @* q' O; ~7 l; a
begin P_read arriving
! P9 o" {$ k. S8 K# f while 1=1 do begin
& z" E; `1 w" j, S9 m% o9 L read A_tote from "data.txt" with delimiter "\n"; Z6 \! J' e' j. C3 V# z
read A_time from "data.txt" with delimiter "\n"0 l/ {6 s$ f Y
read A_leave from "data.txt" with delimiter "\n"" m! _) J7 z! E- W( t
read A_picks from "data.txt" with delimiter "\n"
) e: d, r( }3 B3 g$ s* [4 Z set load type to A_tote, Y" W$ N0 C4 X1 V& z
if A_tote="tote 1" then set A_induct to 1* j& m0 ?+ C& n; U: V
else if A_tote="tote 2" then set A_induct to 2; v& q9 |% V; B" H$ |/ ]* ^
else set A_induct to 3 ! ^- z# L* g! v! U
set A_i to 0
' N' R' u6 n1 X5 B, t clone 1 load to P_induction
# z( O' S4 H& m2 T! { wait for A_time sec$ A' i+ g( z9 d$ j U/ n
end& s8 g$ H$ X' S7 O8 n
end g9 d2 u* s- ]( E8 j3 W
+ S2 S& S, ]; I0 Kbegin P_induction arriving
% ^$ r9 r* B3 C9 @/ d" z9 c% U if A_induct=1 then clone 1 load to P_pick1
/ v4 F* z, w* `+ Y1 O# O else if A_induct=2 then clone 1 load to P_pick2
9 D& ^. Z$ k8 r/ X: ]3 P( z else clone 1 load to P_pick32 e& J k! `3 q5 z1 p" l# m( Y/ M
end2 W r7 D4 u. G* |& P
% k8 O$ [9 _1 D+ W% V0 S# pbegin P_pick1 arriving" W2 t# ^- f- Y6 Y2 B+ D. F
set A_i to 1" j: } S/ y# i6 a: `$ x8 F9 p$ l
move into Q_induct1
$ \* V7 y, r( j/ ? }: l# z: ]8 r move into pickaisle.induct16 l% l0 l; ^/ z9 q0 E
while A_i<=30 do begin
* L# D; ?2 k, ~+ X/ I- T$ ~7 @ travel to pickaisle.con(A_i)" B3 `9 g* T0 Y/ \! P( k: i, n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 S) |7 w8 G8 \; I
else wait for 10 sec' h2 r' m& u3 y! i
if A_i=A_leave then send to die
! p) H9 R' O# j$ L, o. k. `) i else inc A_i by 1
+ L/ _; q( l# Y; I: y5 t* O3 o4 p end
% p% {9 A9 F+ C3 c- F) wend
3 ~* s2 S. V" w# d, u: G: M; \
: G' s: u6 r+ n1 E6 D3 Sbegin P_pick2 arriving; f- G+ o5 O' X# r
set A_i to 11
+ v, i! {8 t6 O) f- a0 G& u move into Q_induct2
) D' m- U1 b' E move into pickaisle.induct28 C6 i+ ~: X/ y
while A_i<=30 do begin
& z6 p4 C( ^3 E) ? travel to pickaisle.con(A_i)5 s4 o+ g# e' n5 _# t: e& A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* u* |* a; T1 G7 S% ?, b" W9 `
else wait for 10 sec+ B" g' N% w3 v. y4 J
if A_i=A_leave then send to die
' r5 p: _" A8 M3 q else inc A_i by 1 h8 s$ V8 A0 Z+ V) X" E$ C5 w
end. n h9 f0 b! d% Z, b5 S- B
end
# k# H* ^' \; `0 B$ A( H
! g1 ~0 N! p3 Y5 ^7 fbegin P_pick3 arriving V) s) A: j8 }" ?* S4 r, G
set A_i to 21! p$ q1 l% w; Q0 m& L0 l# S P7 v, X+ M
move into Q_induct3
4 D; C2 h0 _ p3 H move into pickaisle.induct3
* i- q% }, P7 F$ U% }6 x1 H C* ] while A_i<=30 do begin
' m" d9 ~8 c7 N* c$ P0 L) l travel to pickaisle.con(A_i)
( H. L% K0 a$ u& O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( c, W: n1 D( I& H% {% h4 z" a
else wait for 10 sec8 J9 m" g/ M( n
if A_i=A_leave then send to die; V$ d6 z4 F, y3 j: k9 j x
else inc A_i by 1! z" r6 d" i c9 Y
end
9 b; l! ?4 ?/ wend |
最佳答案
查看完整内容
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,其它按你的 ...
|