|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, a! ?$ ]) Z( `) l) }0 A: ^( U4 h5 t- B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 s2 S8 }# C w" G( J% n0 L1 w* m0 g
: ]3 P7 j* F+ |/ a+ h }0 b+ d8 Abegin P_read arriving) _0 y0 n9 S1 y( }' ?- s. s
while 1=1 do begin* |) w' }+ p8 F7 n# e
read A_tote from "data.txt" with delimiter "\n"' c+ l" C3 V! F/ |
read A_time from "data.txt" with delimiter "\n"$ S* ^# z2 f# i( i( U
read A_leave from "data.txt" with delimiter "\n") z& O! @6 K2 t5 K4 J1 z
read A_picks from "data.txt" with delimiter "\n"; V5 q+ c: }! i9 T% @# _
set load type to A_tote
5 c" Y) @2 S& ?* J/ a0 F4 S if A_tote="tote 1" then set A_induct to 1- S+ x' B" D. j2 @& U4 R; `- H) R
else if A_tote="tote 2" then set A_induct to 25 O7 i, u/ E$ k0 `
else set A_induct to 3
: n, c9 t# [- Q3 W/ w8 E1 O set A_i to 0
. i: t& P/ I" m m! H: y0 L& V clone 1 load to P_induction9 Y( ]& k6 m# d. c0 O* ] N
wait for A_time sec
0 C% [2 n* T( q7 z) l" m5 D- o end
* g4 s8 B7 }# z/ B8 cend
3 B3 N" l7 A p4 {$ y8 B8 m" ]3 @" O. U7 ~! s' R
begin P_induction arriving8 q0 P# h0 D7 Q- _
if A_induct=1 then clone 1 load to P_pick1. ^% j9 Z" M7 W" o1 g
else if A_induct=2 then clone 1 load to P_pick2
: \0 s! n9 |" A else clone 1 load to P_pick3
: f* J; B }1 c* @0 z* \9 ~end
( |$ y n, e0 a( T! d
' q7 R f2 R0 Ubegin P_pick1 arriving' _/ h2 m' n! ~/ w+ l W& S
set A_i to 1
" x. l# }' T4 q% y6 ^, c move into Q_induct15 g- C) k& c( u% o
move into pickaisle.induct1$ V! }4 Q7 D# C( p$ u; i3 j) ^1 {
while A_i<=30 do begin0 q% a% Y/ l* ~, Z% d7 M" s7 M
travel to pickaisle.con(A_i)
4 \ H: O% h: c) x% l" g* b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: |/ R) `7 p' G: ^/ D
else wait for 10 sec( @& i4 i5 Q2 d; ~+ J3 }
if A_i=A_leave then send to die
' U+ k! `1 C8 o% Z else inc A_i by 15 f7 l7 T$ J7 L1 r
end0 y' a, w [- K
end
4 b. O& n q, s `- C3 v- @3 p2 P
% v" v6 a3 K! x' W) X( B, A5 Lbegin P_pick2 arriving/ F* q2 {- A( U8 ?4 }
set A_i to 11
+ `6 e8 B/ V1 | move into Q_induct2
$ j; @- G5 n& x% m move into pickaisle.induct2
& L/ l3 c' L# ?! ]- @( H; D while A_i<=30 do begin
$ S1 Y' z% ~+ R/ ^* B+ K3 m1 S+ W# j travel to pickaisle.con(A_i), N4 C( K% ]1 ~$ d8 w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 w9 O4 A; K2 m8 _+ w6 L
else wait for 10 sec( J v! ^; z0 L4 |4 t3 [
if A_i=A_leave then send to die3 r4 N6 b" z4 F0 p+ v% Q% l
else inc A_i by 1
. Q8 t3 @8 C$ z; t2 ~: _! y end2 j% h8 w2 @& M, M. n' ^
end7 J# | |$ u9 T9 u! w
# t6 k0 Q. [4 c% u. l& {begin P_pick3 arriving, d+ a7 X; [4 h! y" c- H6 Q9 L f
set A_i to 21/ \* X$ b% c$ w7 V
move into Q_induct34 A* v9 v, Y) L' x! m9 J0 k+ u
move into pickaisle.induct3
/ F; r: n; o) {4 Z, R while A_i<=30 do begin' f2 c9 }$ b; W$ n4 o8 _; P
travel to pickaisle.con(A_i)
5 M" R0 q: v( I2 M# w5 o2 x: S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 z! Y/ \( X+ |& m+ x; }
else wait for 10 sec6 @- b3 ~$ g) x2 u- S' x, f
if A_i=A_leave then send to die1 G( E; ]+ S- Y& c
else inc A_i by 1, ?9 t# U% ?& ?2 s
end
% l& d2 E# a' P( B6 ~6 s7 ~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,其它按你的 ...
|