|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- _+ }, x6 K, x. L) i# S3 e0 |# z3 z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。 a2 a1 Z) p) I* a3 _" Y/ c" r
, D$ z! O, _" B/ Y9 O8 cbegin P_read arriving. d$ \, t2 E* V9 e
while 1=1 do begin
: U: S& r5 \# U read A_tote from "data.txt" with delimiter "\n"6 ]& K" d( J4 L9 o' |
read A_time from "data.txt" with delimiter "\n"! P) l, X* G- l: }, W H4 Y
read A_leave from "data.txt" with delimiter "\n"1 D7 v4 e" A9 c1 ~
read A_picks from "data.txt" with delimiter "\n"
* ]/ ~; Y. y9 s2 B set load type to A_tote# R. g+ l6 p4 P, A9 b) Z2 M
if A_tote="tote 1" then set A_induct to 1& q7 v* `% ?3 b# G1 y
else if A_tote="tote 2" then set A_induct to 26 ~' m4 N8 v( w' o3 a1 A& x
else set A_induct to 3 $ M: A- R: j+ e$ W- Y, M: `% L7 U
set A_i to 0% K: i+ R2 {: T5 X% N8 [! Z
clone 1 load to P_induction
8 I) f5 q) {7 ?7 p* ^ wait for A_time sec
9 ~" R& ~5 @. {0 z* A7 o end
- P6 z4 e! e( D& V" Cend
3 N( u4 F3 t) Z6 D
: F1 K: v/ U, p' t, E0 ybegin P_induction arriving
K% O3 e& q% K/ n1 ^ if A_induct=1 then clone 1 load to P_pick1
0 X% Y- t5 [! ~$ U+ l: ? else if A_induct=2 then clone 1 load to P_pick2
* N- @% U6 b! A# C" q7 [ else clone 1 load to P_pick30 f) I/ J3 S0 {3 k* e
end
/ e% d. O _: E( B3 P) J3 C9 J' h
3 w5 }7 e+ r: e2 ^3 L/ q# U7 u( bbegin P_pick1 arriving. F, y: j3 D9 O+ T7 k% a/ V
set A_i to 1
4 w/ B1 j( u8 l) O% E: U- n move into Q_induct10 A l6 q& t' q& C8 @
move into pickaisle.induct1
- p. @0 \( o4 ]$ t. ?+ Y, l while A_i<=30 do begin) X: `8 T: v, X( z3 T
travel to pickaisle.con(A_i)0 i) Z) W/ b6 F& ^0 L$ E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 ^7 h5 i. _: y! F& ^ else wait for 10 sec
2 s8 r5 |( Q) Q! {; Y; ` if A_i=A_leave then send to die
; B/ L* n# I( Y* i1 a else inc A_i by 1, u, A0 \+ v+ _0 W8 x0 Q
end ]5 N. E" M6 o2 V4 x
end' T* ?8 K+ e2 n, P4 Q2 H9 E# U
0 \% l$ s& X8 }7 ]: P
begin P_pick2 arriving; e- B* ~: P( h }% m$ ~
set A_i to 11
* A8 a3 y X: u( b move into Q_induct2, y" Y8 A& a6 X5 `
move into pickaisle.induct26 B% \: N; B5 j3 c+ r$ E: S. `( `
while A_i<=30 do begin
$ o/ m. C7 D8 \* [2 H$ n1 u2 u travel to pickaisle.con(A_i)
7 c* E; ? a3 V [% @) \; V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 v/ D3 l4 @! y( }; @
else wait for 10 sec
- U* F( L5 @- U% t# g if A_i=A_leave then send to die
. D+ `" q+ T' w4 m2 Q# y5 Z8 v else inc A_i by 14 ?; V$ n2 E& ~- s
end& q& r3 F' d; j. U2 w: l
end
2 l; j( }" w0 z, I0 q8 L4 T" a; b: A b3 @% q% a
begin P_pick3 arriving9 _1 t! ~) _5 q7 [& k( Y k
set A_i to 21- v' V3 m. G9 }( s+ \, W' E
move into Q_induct3* A& o) Z: [. j6 t F4 Z
move into pickaisle.induct3, F$ M5 T3 q5 L) i
while A_i<=30 do begin
4 @3 p" |8 z9 E: M travel to pickaisle.con(A_i), z. T" g$ }# T6 O" \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 c8 K9 W- s H" w5 g) Z else wait for 10 sec% o. D. n' N" b' `& d( R: H9 d
if A_i=A_leave then send to die9 [( M7 X9 G- k+ ?# `8 b
else inc A_i by 1- ~: z7 j# S3 u2 _' a* K
end
2 A& a" R' c- Nend |
最佳答案
查看完整内容
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,其它按你的 ...
|