|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, Y9 q7 n w# K
6 ~+ S% b5 ]' L我的问题是,在每个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中的数值,不知道会不会有什么不妥。: E( [* m- ]& T$ q
F# D% n1 `/ vbegin P_read arriving8 f; `% I( e2 d) j9 n. V, k( I
while 1=1 do begin
# O J9 u1 F* [8 J- ^1 d4 F/ y+ \ read A_tote from "data.txt" with delimiter "\n"
* w$ P0 v, p+ [ r. } read A_time from "data.txt" with delimiter "\n"; Q9 q$ j7 s2 c7 E
read A_leave from "data.txt" with delimiter "\n"
$ L9 L0 z7 |) \9 A3 T+ t7 W read A_picks from "data.txt" with delimiter "\n"! B* W5 V+ S$ x j1 h6 Y( j
set load type to A_tote, i+ y' v; b9 \$ b% C" h
if A_tote="tote 1" then set A_induct to 1: R' O1 O e# `" d' X0 S
else if A_tote="tote 2" then set A_induct to 28 c% a, v0 t2 H
else set A_induct to 3 ' H' W& M( w9 c& l
set A_i to 0
, L9 s9 n" {5 I, K6 j clone 1 load to P_induction( f. b/ Q- k2 f( q( a& x4 k
wait for A_time sec& X+ q0 ]. v4 ?* T! O9 K9 U9 o+ B
end# |, [; a6 l8 L
end# r% E$ m: H* a2 Y$ z
6 h8 G6 Y4 @5 h1 j, ]9 g0 @' l2 t
begin P_induction arriving
4 W3 p1 C, N) D! b if A_induct=1 then clone 1 load to P_pick16 v; [0 q- g! l3 K& b% m
else if A_induct=2 then clone 1 load to P_pick2" N4 y2 m# S# y( h0 `
else clone 1 load to P_pick3
! V9 R% i" V$ q( N* Z7 F, k2 x5 _end
; G p! A. C) e$ k# M, o
2 ?, K( B* q6 z; L3 ?4 r' Q- wbegin P_pick1 arriving
: i. \: m$ ?- j) E) O [- \* v set A_i to 12 z' G; B: b( P$ `. E4 F- V
move into Q_induct1
# Z% f; D- \4 q move into pickaisle.induct1
' x4 ]3 Z- u4 \- J% r while A_i<=30 do begin
9 T/ P3 I: f" h) s M) ` travel to pickaisle.con(A_i)7 d# J( t& l- h5 z% {9 `+ N. I- e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 l; c% I# R. y7 P/ [: M
else wait for 10 sec6 H, T* J2 |7 S% @
if A_i=A_leave then send to die- B* k k2 \/ S& e
else inc A_i by 1
& O4 Y# ~- s% ] end
2 {! a& U$ k( O0 f5 z$ O1 aend3 F$ {# F+ @% C7 Y9 r+ y) u
- S2 _* C* E* |% u2 Y
begin P_pick2 arriving2 W9 d4 Q% D# z4 J2 |
set A_i to 11
* A# |4 r# M: F: W: S move into Q_induct2
' _+ T7 l+ o8 X+ Y- S5 f. x1 g move into pickaisle.induct2
$ Y6 V) Z! t3 {( |4 n while A_i<=30 do begin/ Y! V K" q* e( q. M5 f
travel to pickaisle.con(A_i)
, H4 W9 x. e( R8 D; }& q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 w6 B F: x* Z! e( @
else wait for 10 sec/ `$ Z7 P C! m! @9 f
if A_i=A_leave then send to die
* S# [& O& O3 k/ i+ H/ g" o& v' i2 M else inc A_i by 1
$ e% O' z4 I( @! E+ _- P# ] end
* S! M' I U6 G; Qend
% _2 T2 n a; S+ q& x' f2 l) s. O' W' V, B7 n: J \
begin P_pick3 arriving
, u& w( _) p! I- [. d) _6 O6 s set A_i to 21
9 P- X( C3 I* L% @# ^& @ move into Q_induct3
h* C9 O, V) S: x move into pickaisle.induct3
5 {0 _/ Y4 x6 [ while A_i<=30 do begin( }. Z- V, \' d" Y9 v2 A( N6 x
travel to pickaisle.con(A_i)
/ S# l7 e4 x" A! _! L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 d( x+ c" _% z+ m9 g! p% \ else wait for 10 sec! q) `, e D0 |2 d1 A
if A_i=A_leave then send to die- w- P, Z8 H+ y) ~
else inc A_i by 10 h4 X) }' r( T# d( m. Y* s
end$ Q4 o/ z0 C1 i, }. W7 ]
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,其它按你的 ...
|