|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 W. N5 f! N2 J- j" v" x
- i7 j( W7 V! P+ Q我的问题是,在每个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 [8 f% r; b0 O' |
3 J0 i% _0 q. E( s" D/ O0 t+ Nbegin P_read arriving/ b7 v7 {0 J" Z0 y0 Q- Q9 J P
while 1=1 do begin& G, ?/ i6 N! Y- l% @9 X
read A_tote from "data.txt" with delimiter "\n"
9 l( r: q9 L& f6 S read A_time from "data.txt" with delimiter "\n"
1 `, t2 |# u( g) d- O+ o read A_leave from "data.txt" with delimiter "\n"
" N( ^: Z7 X% O/ f: | read A_picks from "data.txt" with delimiter "\n"' ~2 z8 ~. u, j
set load type to A_tote
- ^, E) }4 G+ Z* R' @3 t if A_tote="tote 1" then set A_induct to 1; R. W% ]2 b, ~& N+ O' X' P
else if A_tote="tote 2" then set A_induct to 2
c; b) U4 r! j9 \* _( \0 m* o% q else set A_induct to 3
3 u# c) p4 U' ^ set A_i to 01 m0 R: B" u7 x+ B9 ]# V9 r7 ]
clone 1 load to P_induction- H$ r Y" a. y8 q1 `& X1 Y
wait for A_time sec0 }5 f% ~; N0 O! q6 G1 K6 A, I
end% B J7 e: \1 ^2 r$ R
end
- T1 l f# k8 t- m$ K( s. N
6 M4 ]( R3 @& A- J7 s) Mbegin P_induction arriving1 v- }# H) a8 Q; x
if A_induct=1 then clone 1 load to P_pick1, W' ^" N8 W; t+ O3 l
else if A_induct=2 then clone 1 load to P_pick2
5 ~( t. I! p9 ^: m else clone 1 load to P_pick38 I" q F+ s/ {* r
end
7 M$ R, R6 [: N! {1 V& c4 L$ O
# q. R9 o( o% p2 t: Bbegin P_pick1 arriving2 t4 i* l+ ?8 e0 f: ]! }" c$ a
set A_i to 1 I* f* d7 G( o8 X2 r4 Q1 K
move into Q_induct1
3 E8 Q( F5 s9 e6 u; f move into pickaisle.induct1
% q1 S; H. u% ]$ n while A_i<=30 do begin
5 t5 |) [. u( {4 T travel to pickaisle.con(A_i)
/ W; q, A5 m! L3 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 b+ B& B! N" f$ {7 r- `
else wait for 10 sec7 G) P' q6 e/ U, {
if A_i=A_leave then send to die
; c; U N+ E# E0 C6 Z$ s8 q9 G else inc A_i by 1
0 e; d- C8 \, j H+ T6 C end
- U( C0 W. ^/ u0 Y* tend4 F+ C2 Z& {4 s9 g. `2 j8 _
+ C/ ?- I) p- Bbegin P_pick2 arriving) k0 i; L4 s% [3 O# H1 _
set A_i to 116 y" G) k6 \$ T8 s1 `. X
move into Q_induct2
! A% D. g( M! y: t move into pickaisle.induct29 v( K& k4 l. j- l; H5 j. K Y- Y6 W
while A_i<=30 do begin5 _. t# s6 W5 m3 `
travel to pickaisle.con(A_i)
8 s# N" U3 S+ E# v" u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& n+ O( M* ~& e% |& T7 U else wait for 10 sec3 B& X& U0 b* Z0 i
if A_i=A_leave then send to die/ [, E* h% i! @0 t$ ^4 b/ l# j1 U8 o
else inc A_i by 1' d$ \% A0 y6 j2 c8 G
end
3 H* E/ i8 g& q0 J& A1 D/ F O& pend
4 K6 `3 x* U6 `# |+ h
% p, a" `5 {6 O% n6 ~/ wbegin P_pick3 arriving
. k0 i) g' T+ f set A_i to 21$ o3 `5 r: g2 {! n* `4 x) K2 u
move into Q_induct3: E* D, V' r4 F- L7 Y
move into pickaisle.induct3
; N; B; i. Z5 P while A_i<=30 do begin- ?) d) _0 b& Y, S6 D, G2 [
travel to pickaisle.con(A_i)
5 X: b* R! c/ ~3 D: A" d2 m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ x' W, c3 `' O, ?, k# k else wait for 10 sec
( n+ R6 Z4 q: L9 M' s" Y if A_i=A_leave then send to die: w# I8 J2 c. g7 C# E: Q$ `
else inc A_i by 1# m' Q( [& v0 M5 o2 O' X
end4 r6 N9 r Q0 L. a1 @
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,其它按你的 ...
|