|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" ` B4 }8 m' ?$ e0 m2 u0 }, h" ~" x5 O8 _& F" A
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 V; q; U. l( F; G1 ~( \
2 a- k1 ^* @0 S6 gbegin P_read arriving
6 y. E9 k/ h4 J* A; \' G- m5 _ while 1=1 do begin
% t; \4 K ?$ [" @+ n$ V read A_tote from "data.txt" with delimiter "\n"& K0 N/ U' {; z9 }, l. {* a
read A_time from "data.txt" with delimiter "\n"
) i- R c1 U+ U# ~ read A_leave from "data.txt" with delimiter "\n"
3 m& v2 z7 g# B) Y2 r! @8 o- [ read A_picks from "data.txt" with delimiter "\n"
% ~! z* B: N( H+ v9 v0 c2 p9 c set load type to A_tote Z, \" \9 l- E! w7 I/ V
if A_tote="tote 1" then set A_induct to 1: S( A/ s2 v: `8 a
else if A_tote="tote 2" then set A_induct to 2
+ S- w* Q3 ^/ d! F else set A_induct to 3 / h5 ]8 [7 a1 B* }$ q! _, ]0 ~
set A_i to 0
) t: P3 P6 a7 e7 f3 ]$ V clone 1 load to P_induction
% v$ s0 \0 G& H+ J; T. X( m, B4 T wait for A_time sec; Q+ v' u' w' H
end+ R5 d7 j/ g. Q( k2 O
end
: u2 `* W( ] r4 _0 q! `$ A3 L$ X( l- w$ p8 F: }! W
begin P_induction arriving
0 ?* w Y) G6 S; I* v3 S% N if A_induct=1 then clone 1 load to P_pick1
, n3 R8 F! k) ]5 D+ h4 V* v else if A_induct=2 then clone 1 load to P_pick2
9 G: w7 j9 a# F# B W) _* d else clone 1 load to P_pick3
: N$ W" P- O0 ]8 L. Q/ Send
I: P% W' j7 S/ |, e
/ c% J( Z+ F3 W0 |% vbegin P_pick1 arriving
# G- Y/ h" x" Z set A_i to 1
2 Z, W) f0 w+ c6 G7 L move into Q_induct1/ ?, x* f# W) p+ ?
move into pickaisle.induct1. E! f7 R1 F. Q
while A_i<=30 do begin M3 U5 J0 o9 v
travel to pickaisle.con(A_i)
9 U' v. }3 s' R) \0 Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) g4 a& l; T9 m2 U8 b" z, u- D! s else wait for 10 sec! J N: F2 h4 F7 l E' U
if A_i=A_leave then send to die
* K8 q' P) t# \' w else inc A_i by 1" e9 E4 p2 \1 H! h% P, K) E2 m$ U
end
4 ^; U! S5 T. |7 S; R& t, F$ Pend
5 r+ q( N! ]2 T6 O! x! ^2 p2 }1 J6 u& h; N2 ]
begin P_pick2 arriving
7 d, m3 X% f9 u. O/ O4 R set A_i to 11
! G- u+ r5 a% k4 O3 A, u move into Q_induct2
; t- ?! c% @( p$ P C* o move into pickaisle.induct2- r5 l8 a7 z6 \7 x" y- M* X
while A_i<=30 do begin4 u. b6 N7 B/ B( x* y8 m
travel to pickaisle.con(A_i)
# ?/ \( {/ a" l' z' f+ g9 N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 X! q* k4 T- i* N9 u+ j
else wait for 10 sec
# Q; G% W* N% @. S$ {! J) s$ g if A_i=A_leave then send to die
: R' p/ z0 t7 k$ E! H else inc A_i by 1
% a" Y6 `6 `: ^; J end
( n- ]$ c7 W( F. vend% C9 U' C4 b! b {- G- B
4 s* ~4 X1 B$ O$ O( ~
begin P_pick3 arriving
, V3 F! r; z: K set A_i to 21
6 T3 w) v) r2 z$ o& U move into Q_induct37 g& o& D7 z4 d
move into pickaisle.induct3
+ D K& Q6 c$ S9 n while A_i<=30 do begin) W' p1 f7 x: ~0 J& e0 C* [4 o) d1 @% f9 g
travel to pickaisle.con(A_i)4 Z* _; ]1 t5 G& l& d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S" Q/ i% D( F- o$ ]
else wait for 10 sec
4 p/ \0 g \1 Z+ V) B1 m2 O% [ if A_i=A_leave then send to die
' P4 \9 @! B/ h$ X5 z/ K% Y else inc A_i by 1
. H* r7 O$ O9 Y3 e3 k% ^ end. r5 a& H6 J4 S+ R! |, j0 L: ?6 X
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,其它按你的 ...
|