|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) I9 `0 u# ]. V4 g
; z {6 S& p" q2 |! Q! u8 D; L6 R
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 B5 G6 p% Y1 Y. K' [3 L
' @5 `8 J( |5 R7 j
begin P_read arriving! b* T3 k- x5 r: z3 ~+ U
while 1=1 do begin3 {6 {/ k# a, u! z4 U. Y/ A+ k
read A_tote from "data.txt" with delimiter "\n"% ]; J6 \. v; R9 ] W
read A_time from "data.txt" with delimiter "\n"4 d5 ?# X. u6 j% Y5 n
read A_leave from "data.txt" with delimiter "\n"5 ]3 B1 ?" |( c4 E/ @: C% d3 |& F/ {
read A_picks from "data.txt" with delimiter "\n"
' v! D: P* k9 D0 u set load type to A_tote
* n2 x8 ~. ` ^# k if A_tote="tote 1" then set A_induct to 1
& l, z* k( U$ { o$ T: ?8 | else if A_tote="tote 2" then set A_induct to 2& f' J& E3 Q j
else set A_induct to 3
1 I" K7 K t( S7 V$ g7 ` set A_i to 0
) f& D0 e8 U A! F+ |) k clone 1 load to P_induction
+ Z% G3 R' K& z. V8 P3 B! O$ j wait for A_time sec
- h7 y$ n- |9 R4 Q/ b+ \) h$ C end( H5 A% ~+ ]5 F: C, ?+ p
end
$ ] V& r4 e& Y1 y1 {, b% ]" @- X0 ^$ D
begin P_induction arriving0 [* v0 z# x0 b V0 E
if A_induct=1 then clone 1 load to P_pick1$ ?1 b' C' A5 C) ?+ J/ T
else if A_induct=2 then clone 1 load to P_pick22 o8 x8 W) F! q- e# Y( m
else clone 1 load to P_pick3. @' f. t2 q& O( }5 Z5 O2 V) z
end
5 y {2 }& V- b) H1 b+ k- q
# n* Y- u! E* R; |* n0 j$ kbegin P_pick1 arriving7 M1 Y( ~# ^$ U B
set A_i to 1
9 {* j% n4 N) [& d N3 r move into Q_induct1* S8 o& U& L% l9 N: c
move into pickaisle.induct1. N8 \9 e- i6 E% ]8 \7 w
while A_i<=30 do begin
^7 j1 C0 A5 g; _) V/ x1 `' |$ H2 N7 ~ travel to pickaisle.con(A_i)0 o s! c& @: L! i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& V! l3 `+ t2 M/ q8 @
else wait for 10 sec/ B9 Z8 S! V* C- W7 e
if A_i=A_leave then send to die
, q( i; c! V. p4 j. q% c" ^ else inc A_i by 1/ i Z% [& p) o1 ]0 {+ A" W. o
end2 h+ \, D8 _5 h# r
end
9 _. E& g0 F5 ]: E4 G3 c7 o: W8 X! L% W! J7 z J4 n; B
begin P_pick2 arriving2 x% X' b6 _- I' X2 l/ o
set A_i to 11: d( w6 @' e: N5 C" v! `
move into Q_induct2
1 J9 V5 s, Q2 F1 |. K; }& F move into pickaisle.induct2
/ F9 ?0 p. q+ J/ n- _5 m+ B5 F while A_i<=30 do begin3 j" l- m y) n* F; b9 ^
travel to pickaisle.con(A_i)
3 W* u% S x6 H! K D: n( S7 B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 ^5 {1 H# N1 ]: R% l5 m* w$ u
else wait for 10 sec
8 H& x% v3 {2 g if A_i=A_leave then send to die
8 X; D, U, @; `, y. T3 ` else inc A_i by 1
" y5 H* [( o' i! V end6 U J4 X/ r% k: W1 J# ~
end
$ @1 \/ Q/ c# ~8 _' T, X! X) s
+ S0 ?8 I0 h* V6 h( ~! Rbegin P_pick3 arriving( Q! J5 _9 s8 [, f* l3 p& I
set A_i to 21
2 I ]# Q! B8 A: z move into Q_induct3! W: h0 L& E. M3 Q$ u
move into pickaisle.induct39 p% P# Y5 r# H9 b% P; N
while A_i<=30 do begin, I+ @# h4 P+ U; E9 n7 S# X
travel to pickaisle.con(A_i)2 k) Q3 t) k/ b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 H; q" C7 h; G* `: s* j$ Q else wait for 10 sec
3 i; q. R, A0 A' g8 T if A_i=A_leave then send to die9 J+ f5 B2 a* }: n- O/ M$ u
else inc A_i by 1
9 C# |# {( o% I4 {8 @ end
- v$ ], O9 z" ?7 I$ Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|