|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" q# {' Y+ P' _; y! f
# b: A6 h/ J; s, b/ b+ K; m我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 d3 M0 R, o- }) u. @3 M1 v
, ]7 r* W! C6 A' V+ j/ nbegin P_read arriving) p& D: ^4 A- e4 _$ D$ G7 O7 h
while 1=1 do begin
; U) D6 \8 A' J# x, T0 K read A_tote from "data.txt" with delimiter "\n"2 H) O, B& l; W0 P* R7 o: v: o
read A_time from "data.txt" with delimiter "\n"
: a, X& D; g1 _! }- c6 c z read A_leave from "data.txt" with delimiter "\n"3 R- w2 d- Q5 K! o8 P* b$ w
read A_picks from "data.txt" with delimiter "\n"
9 x& O' \4 q! H9 O M set load type to A_tote2 \6 J' f: U& U. M! W q: ]4 H6 t
if A_tote="tote 1" then set A_induct to 1
6 \6 K3 `$ ^6 v/ a/ g7 S( _* Q else if A_tote="tote 2" then set A_induct to 2# @0 u: ^9 U; o6 f7 Z
else set A_induct to 3 3 ? \7 z5 e/ N S
set A_i to 0
& F# f9 p1 W: J2 V clone 1 load to P_induction# V1 U; `) H% D
wait for A_time sec4 ]) x( |3 n4 P. k3 e* o) x
end5 E) r6 i! R8 \5 g2 R( c
end6 H) _# b+ ~8 o, o H
; y$ r( k1 z3 z2 {: @begin P_induction arriving
: H8 m- _. [1 z6 ^4 u1 ?0 N if A_induct=1 then clone 1 load to P_pick1
; x1 T4 |4 G o5 _ else if A_induct=2 then clone 1 load to P_pick2+ ~, {$ S. U8 p3 F; m: s6 X
else clone 1 load to P_pick3- `' j2 t7 w! H9 `! V( L) v# V) V
end5 i3 k. g6 d+ @4 e# g
1 [4 a) j# \4 L; V) W" vbegin P_pick1 arriving$ U% \) h! P! ?7 W
set A_i to 1
: x% @" y0 B P V* ]% ~; |$ b move into Q_induct1
. O3 F* L5 x% N move into pickaisle.induct1, J3 D% b* R2 ]- G0 @( Z
while A_i<=30 do begin4 M1 f0 v! T" I. V& D2 G
travel to pickaisle.con(A_i)
8 o! h. o6 U2 [! s$ [" r; L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" R U2 h7 Y2 J
else wait for 10 sec3 E' x: M" H3 W& Y. l: j
if A_i=A_leave then send to die- ^, I# P+ {% H( m* x* d- R- @' I6 l
else inc A_i by 18 {) V4 Z, _* Q/ l; k" f
end7 J3 h! ^* e0 f+ z
end3 N f+ s% D0 E' w! z( ~
# H7 h1 }2 \" N8 l4 J
begin P_pick2 arriving
m% z- c' d+ F5 W' y G( d9 I$ \ set A_i to 11
* y( d2 Y3 h4 B1 Y) F/ Q! ^ move into Q_induct2& ?+ x/ J3 {+ g9 t8 V! ?# i$ U2 G
move into pickaisle.induct2
. n; Y* c e" w6 T( p# d1 r while A_i<=30 do begin
7 P+ t. Q% M9 \1 v( d$ m% ?1 I4 L travel to pickaisle.con(A_i)
( N' `) g2 B* J% s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 S" K5 b, e5 |; @4 l% h( T else wait for 10 sec1 ?4 ?( }2 ^+ a: x' a. q; q
if A_i=A_leave then send to die
& f7 K6 P! a, D& P y else inc A_i by 1
& ]2 o5 y$ S% r1 K8 G& _ end
" i2 n( U4 i1 [5 c& E; ~end
! R/ ? l! \" n/ `6 j* z9 ]/ W, [/ |2 W9 H! q
begin P_pick3 arriving
' L. ]7 x$ P6 Q6 P: G set A_i to 21
( h. S: k% y, m. Z2 i move into Q_induct3
# I! ~$ \3 S" M1 _+ z move into pickaisle.induct3
* P/ d+ \2 B# a1 s while A_i<=30 do begin7 Z7 n5 K6 F, t0 B8 x
travel to pickaisle.con(A_i)
) P1 c: A: u: n7 e/ s) m4 `$ S/ ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 g# l% ]0 N5 P2 G" J8 X9 C# R
else wait for 10 sec
/ d% x' x' f4 u0 E/ g) _ if A_i=A_leave then send to die
' t1 `, e3 ^ r$ } else inc A_i by 1
& i7 {# T$ n9 f* h6 E end
# v1 l3 r* S- ?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,其它按你的 ...
|