|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 G+ u2 r C" c9 L; _# N
0 C+ j. Z: u" z% V+ s
我的问题是,在每个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 K- I% L7 G7 E4 G+ |5 D5 f* Q7 M5 Z0 z6 T' R
begin P_read arriving
- L1 E G: D+ m8 P* t: @# W$ c while 1=1 do begin
# _" P3 v# k7 K read A_tote from "data.txt" with delimiter "\n"( Q7 j' V$ ^- b7 Y
read A_time from "data.txt" with delimiter "\n"' `4 B' Q2 [% ^ M7 }
read A_leave from "data.txt" with delimiter "\n"
" w) y" l/ B4 J1 S8 Q& n read A_picks from "data.txt" with delimiter "\n"
z0 S$ N: [* a; ~, c set load type to A_tote8 J8 G9 x! S7 {* _0 c! \
if A_tote="tote 1" then set A_induct to 1! r- F2 Y. G, v) O3 J
else if A_tote="tote 2" then set A_induct to 2 Y, X9 d, N/ _( ]
else set A_induct to 3 + [8 W3 U- I3 N! O( k2 n" a
set A_i to 0' ]" S! m0 Z4 v7 u+ s: j0 y
clone 1 load to P_induction
0 M4 L" D2 B" d+ N+ _ wait for A_time sec
" [& d! _+ E( F" N end
2 R' \2 w) `3 K+ gend
" K+ {. d" O7 i) e4 F1 d- T; v" c9 L2 W8 G( n
begin P_induction arriving* W% I3 l9 p! ~: n) D8 d
if A_induct=1 then clone 1 load to P_pick1
4 T ?# b) m( L: @. c3 g2 o, ?2 | else if A_induct=2 then clone 1 load to P_pick2
. \% m, F9 R! r$ D$ _6 C! ~ else clone 1 load to P_pick3
3 t' b) Y) s! q, i4 Z7 send
% O9 S: F$ ~8 n9 o0 b; T0 z: I7 }% d8 |% Z
begin P_pick1 arriving
! L+ l: T# D4 N set A_i to 18 ~% Q: [4 T/ e, k' \
move into Q_induct1* z1 z; R" T) t* A
move into pickaisle.induct1- A. _1 r9 }# A. _
while A_i<=30 do begin
+ @4 P* N- E% l' C3 } E: k! T travel to pickaisle.con(A_i)
/ M0 z5 q3 `8 p& T2 P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, b3 U z5 S+ m( E
else wait for 10 sec
( w$ i4 z2 r' R9 I if A_i=A_leave then send to die3 [5 j! J# @4 b: S9 E* b; c3 z
else inc A_i by 1! | m# `8 |7 f' i$ r: Y( g; @
end1 T! z6 e8 M. K+ c% n$ |+ I$ V8 A
end0 ~: Y4 c, U3 D7 S7 H+ |2 q3 j. b8 K
0 q$ V1 @4 r" }begin P_pick2 arriving: e" o. S1 A3 {+ @1 b& U
set A_i to 11
: U8 R0 Y0 {9 z) }$ e" b, V# F move into Q_induct2
$ v5 _* ^/ h% N" j% A# y move into pickaisle.induct2
/ N) f/ R/ N, d1 L5 O4 C4 {* A& m while A_i<=30 do begin
8 X) F4 s5 X$ T. X4 Z+ Y travel to pickaisle.con(A_i): }; v8 F, g4 _0 E2 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 q9 S( P9 P! J: ?) R
else wait for 10 sec! v- E6 d9 j: B0 V: ?
if A_i=A_leave then send to die. o) m7 t* W1 H0 V
else inc A_i by 1( t( ~. w# |1 E' P6 j
end
7 x; u- G6 E# |; V- v# ?end" y3 G2 a4 K" L3 w
) _8 @! t A4 k7 B% S( Fbegin P_pick3 arriving
1 |; u2 }5 z! p# }$ j set A_i to 218 N/ V' t% y l, k: S, ~. \
move into Q_induct37 M& {+ D+ U/ `+ V" B6 ^9 N
move into pickaisle.induct3
& r+ S4 O9 c7 }8 ~& m# ? while A_i<=30 do begin6 q i. v7 G; `2 Z
travel to pickaisle.con(A_i)5 H$ ]9 Q& R' J+ y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ K7 \' s/ I& B5 i F9 c$ S' s
else wait for 10 sec
0 t% Z6 d/ M+ q if A_i=A_leave then send to die
: |+ e2 m+ |8 n/ i$ D: B$ ^3 A9 w; k else inc A_i by 1" A" _- ~$ S6 f) i' k
end( r$ ~# K3 [2 w7 Y, q) ?% ^
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,其它按你的 ...
|