|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
I# m1 `& j4 t. x0 { K3 w: ?6 p; E; f" ~% D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
Y" [2 p& P [' e- R3 ?( U5 k
) m. m p, ` V' K7 k, a7 wbegin P_read arriving
. @- C! G" C! O! e7 P% U while 1=1 do begin
9 Z1 c: `1 q/ ^6 u read A_tote from "data.txt" with delimiter "\n"
' x S. z+ k* w read A_time from "data.txt" with delimiter "\n"( I% m' J. i$ a- ?
read A_leave from "data.txt" with delimiter "\n"% `4 Z l8 \; u, v2 U" ~: a
read A_picks from "data.txt" with delimiter "\n"% l _5 ?" b: U0 u: }% b
set load type to A_tote
: g& D$ X p: f% w* d" | if A_tote="tote 1" then set A_induct to 10 W9 w& k) D. K" w T' m2 J
else if A_tote="tote 2" then set A_induct to 2
* [+ r! Q: J5 j( v else set A_induct to 3
9 @ a; h+ k' s9 k; G4 s set A_i to 0
8 K: s2 l8 o( m8 Y clone 1 load to P_induction- E! Y. k8 e+ e* A
wait for A_time sec/ X: s7 p# j. `2 G% B- a6 G
end2 p) R8 Q8 ~ e0 f7 n$ s9 D( y8 y% I
end
; Z9 ] q. a) j( ^( i6 D# R" c- A! m5 N% G% B
begin P_induction arriving4 @7 e2 a4 S+ \6 _- `2 `3 H. w y' D. L
if A_induct=1 then clone 1 load to P_pick1
* t$ D* l# [3 V9 A; }) V% K else if A_induct=2 then clone 1 load to P_pick2% n4 y, }3 X: {8 Y' }
else clone 1 load to P_pick3
+ H E9 e2 V b$ M, ~+ u4 xend
/ W0 A& X! E& d; P& m. c' p
V* m' j# l" T Xbegin P_pick1 arriving
6 m$ ]" ?- F2 v% a! f set A_i to 1
; G7 s& y! k9 `1 i+ O( g/ [* M move into Q_induct1
- i* S+ r4 N% P move into pickaisle.induct1
1 n( d+ B- w6 L& t8 a4 T while A_i<=30 do begin" x1 W) v0 X. ~
travel to pickaisle.con(A_i)6 b0 N: `0 y$ r1 z3 t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* `+ g: o+ C. C! s6 g H2 y5 P- R else wait for 10 sec2 T8 l/ b0 d3 J
if A_i=A_leave then send to die( F9 N. P3 i5 }, X5 o
else inc A_i by 13 ?- t$ J* H8 R: i
end
2 ]( m2 p- v; Z1 x3 }0 V. D: \end. C% V- q: |1 k& o; a2 e' g
2 b$ K+ o: F& i/ o1 y# F
begin P_pick2 arriving2 `! n, d3 H% Z( m# S! P' J
set A_i to 11
: K% i& x; ]9 N, D. D- k. Z move into Q_induct2
p. K0 X* p+ h3 @/ F move into pickaisle.induct2/ ]7 q# m4 x4 |% P
while A_i<=30 do begin! _) S1 ~3 |; X) i/ C& z' G1 f
travel to pickaisle.con(A_i)
) f: Z+ a: F+ \" { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. K5 X. H* l! B) { else wait for 10 sec: E+ {3 j* D4 u: o' v
if A_i=A_leave then send to die" k' ~8 n) V$ w; }
else inc A_i by 1. _0 s5 y, }& E
end
2 s, u6 ]* s. C R% [/ J i6 \, O$ Aend/ I5 W( P8 s5 V) `
7 p/ N0 F# S X, Q2 cbegin P_pick3 arriving1 U; v! Z. c) g/ n1 h3 L1 O! k/ L
set A_i to 216 O2 {9 }1 f, W7 u2 R, T' V
move into Q_induct3
6 q8 d5 u7 l# | o2 z move into pickaisle.induct3 W# g6 _; l2 n0 A
while A_i<=30 do begin4 q' O7 l$ L( w7 i# u+ L
travel to pickaisle.con(A_i)2 A" r7 p- A0 K r2 }2 S8 ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ q+ n& X# J& z
else wait for 10 sec
# U% d @2 s. Q- x. e5 c2 Z8 k if A_i=A_leave then send to die2 C$ T& a9 B' J1 N! ~1 d5 c
else inc A_i by 1! v- p4 l1 b' v1 ]/ d
end
1 }/ p# m$ T+ U& X- X) Hend |
最佳答案
查看完整内容
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,其它按你的 ...
|