|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 T" j1 w% a2 V4 h* d6 F8 J3 H+ R0 Y' A0 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. E s& w/ [4 {0 x
- W) C' v }' P9 q6 ~( fbegin P_read arriving
2 Q9 K* ^, b- C0 f+ _+ d$ ^ while 1=1 do begin
2 u3 A* [1 m* x' R read A_tote from "data.txt" with delimiter "\n"2 j; K' \) C- ]; d
read A_time from "data.txt" with delimiter "\n"
- n) e0 n$ T! N read A_leave from "data.txt" with delimiter "\n"
. B4 c" Z0 P) M( l3 D read A_picks from "data.txt" with delimiter "\n"
* Q# H/ N6 I3 o$ P+ l set load type to A_tote
7 [& U! m' X/ o: r% d if A_tote="tote 1" then set A_induct to 12 Z# Y# L8 ^$ W# `' R8 m
else if A_tote="tote 2" then set A_induct to 2
* {2 }$ R' N" T6 y5 X else set A_induct to 3
; v0 e% R* C# E2 y/ W set A_i to 0
/ z" f* ?8 u3 f8 i7 Z clone 1 load to P_induction
$ o- @$ M, a7 a9 c wait for A_time sec; b0 x+ C9 n4 M8 R# { k
end- h3 p- a. h6 a7 b2 M) S0 M# `" i
end
4 e1 d d- T3 ~4 I& p% q' A
8 a; _! u5 u" X- l* i/ y1 `& Bbegin P_induction arriving
: W2 p e, ]. L if A_induct=1 then clone 1 load to P_pick1/ y( n. I4 l5 W @4 \0 ^; n
else if A_induct=2 then clone 1 load to P_pick2
/ }* ?$ k1 L! Z4 b3 l else clone 1 load to P_pick34 k) B: b* w: [+ s8 Z9 @: m* i1 h
end
0 R$ @" k( M4 d0 M
- u) i0 F* [ W. E/ dbegin P_pick1 arriving2 ~, w9 L$ K4 ~2 i$ F5 G1 E6 f
set A_i to 1% k' ?" }1 G0 \+ ^, [0 Q2 G2 K# c
move into Q_induct1
3 C! ^2 T- d0 `( ^" ~ move into pickaisle.induct1
6 N4 K3 k# h( |! @0 W: C3 ? Y while A_i<=30 do begin8 X5 [$ w' q3 n% j# J% }
travel to pickaisle.con(A_i)
1 N5 i0 D( ~0 _6 \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 b6 u0 p* ^ R% f. ?: E
else wait for 10 sec* \2 U6 l c8 L$ C: o" c
if A_i=A_leave then send to die
, D! }2 k9 h$ z4 q2 i2 K else inc A_i by 1
: e; i- |" I7 ]6 S! V end
2 @; C) S5 K3 D3 R2 ^ h; S( Hend& r8 A5 m+ c# O, h' L# Y6 Q+ e
0 T: m; }% e4 s6 ~begin P_pick2 arriving
' `. h. @* f _. u2 g' d set A_i to 11
: ?6 R# z9 N8 [3 n' j move into Q_induct2
7 [" c5 f9 n# M move into pickaisle.induct2) _. l( k$ u, d( j
while A_i<=30 do begin
: y7 _7 J+ f9 ^" ^( w; F' w; e! [3 d travel to pickaisle.con(A_i)
/ H6 t7 ~- x1 {6 h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& t; u5 P) L3 f p. z$ u! s
else wait for 10 sec+ V j7 i% z; J" E2 h2 i: ]6 g
if A_i=A_leave then send to die
( o( b, Z s4 d3 U, l0 I5 Y else inc A_i by 13 S+ x8 A* h" y5 {4 U# }- j
end5 c! k; |- [- f5 B O s8 c3 X
end2 D# Q* y4 B; Z. {6 i2 Q' J
. U9 D9 u+ s$ L; Z3 L; L5 W+ qbegin P_pick3 arriving
6 Y8 v+ Y& K1 a0 u% h' Q9 e set A_i to 215 n6 ^2 G7 g; X4 }
move into Q_induct3
9 ^( J) z, J1 J- Z7 M! } move into pickaisle.induct35 t7 N% V7 s, @ X
while A_i<=30 do begin. L$ e- i( Z: Q7 @
travel to pickaisle.con(A_i)7 o$ k& E$ I8 d: r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, G$ o0 |8 Z) [* {- V: m; N$ ?
else wait for 10 sec
/ q2 h4 Q% u1 {# q& ~ if A_i=A_leave then send to die& o# \1 h9 |. \* q; }. Y
else inc A_i by 14 K: @# Q6 z) I1 t, u5 S6 M- s
end
, Q( ?5 o5 J, [' Zend |
最佳答案
查看完整内容
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,其它按你的 ...
|