|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( H# N W2 \6 {/ A, x4 Z! y1 S
4 Z" {9 a" }3 o1 y2 @, b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ Q! ] g) G, p
" Z& [2 H, @; v: [( e+ |
begin P_read arriving5 N8 A: A3 F x# v& X* S8 J- J1 J
while 1=1 do begin
/ U9 Z+ d) l4 f8 Q read A_tote from "data.txt" with delimiter "\n"
7 _) V4 h2 E+ s. R4 I read A_time from "data.txt" with delimiter "\n"' ]' i9 C6 T; l( {7 @% i( H5 T
read A_leave from "data.txt" with delimiter "\n"9 ~9 }) i$ c$ ]8 p
read A_picks from "data.txt" with delimiter "\n"
3 f. H- c- p& o2 q% |5 ` set load type to A_tote
. _/ X& E1 I9 p* C if A_tote="tote 1" then set A_induct to 1
7 x/ N: G" J, n( g1 y, i6 A else if A_tote="tote 2" then set A_induct to 21 k7 d2 l, X! @8 ~/ v
else set A_induct to 3 " m9 P5 P+ ]; f6 H( V' j
set A_i to 09 b7 |* {( g! q8 y! V5 G& F2 }
clone 1 load to P_induction
! O6 c* ^- T' A& L wait for A_time sec
' \8 v7 G* M. Q- F; ] end
+ n& `/ U. L$ a1 h3 fend- Y' M7 I* [" L: I
! n. `9 c6 t. d1 |0 d6 ybegin P_induction arriving
w; C4 x/ u1 N; p if A_induct=1 then clone 1 load to P_pick1# g) ]- |& Q3 F$ H: U
else if A_induct=2 then clone 1 load to P_pick2
. A: }: k0 u. | else clone 1 load to P_pick3
; S8 K; j8 \" D5 X# H# z6 Fend
8 L+ y% K6 O& ~( g5 f
5 y7 K& E! p6 v+ ~7 g( }* cbegin P_pick1 arriving. d3 F3 j1 v! r2 ^* z
set A_i to 1* u* R G5 e( J# a y
move into Q_induct1
z9 ^+ ^9 u4 }9 ~3 p# v move into pickaisle.induct1$ b$ Z2 b! Q! V' H- P
while A_i<=30 do begin
, B% z) F7 @4 y travel to pickaisle.con(A_i)
7 ]: \! [6 s& ^- q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! O# a/ w% b; w" M' z6 Q9 l Q% B
else wait for 10 sec5 c, t: ^- z0 Z
if A_i=A_leave then send to die
* R* u& h* D- X2 g+ r; L else inc A_i by 1- \" W3 h: |5 D3 m/ K" `
end
0 z5 @/ R) [% ^4 Y7 x1 yend$ j. y6 o4 p! Q/ z2 F1 x5 Q
/ U! K- G$ {8 xbegin P_pick2 arriving
+ f7 |8 t1 i- [1 j$ @4 Y; s set A_i to 11
5 [# M2 Z0 s. S1 E6 I& {1 a move into Q_induct2* v* ~7 v7 Z( Q2 v, X% R2 ^+ a1 _
move into pickaisle.induct2 A" @* m! X; Z+ C# \
while A_i<=30 do begin
, R# o$ x5 R9 u5 y$ N; h travel to pickaisle.con(A_i)
4 m( d, L% I& t! @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ?. C% h7 ^- w; e) C7 G5 h else wait for 10 sec, M) n6 }* b( B* v
if A_i=A_leave then send to die
4 j: h; D3 p5 G( y2 z else inc A_i by 1
& w3 V2 ^1 N5 X1 S' f8 V end) Y8 Q1 `) Z# i& H9 M
end
$ b; l1 @3 i- p- S( j9 ]9 G: X) K# k# n- x# b) {) r4 e
begin P_pick3 arriving
2 V3 ~7 |' f! I set A_i to 21
# u: |& @& B7 U# ^1 H7 l! I/ H4 j move into Q_induct3
: k0 q9 T5 q' K+ r) I+ U8 n9 e move into pickaisle.induct3
* v/ f* l9 e+ C( i% i" C8 n while A_i<=30 do begin! J; f" y) e) I/ @ K
travel to pickaisle.con(A_i)
& ~. S4 J0 H( ]8 A& Y2 h3 {% } S+ m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& Z! V; }& h9 o } else wait for 10 sec
% {4 @. }5 b9 w" `$ _/ v if A_i=A_leave then send to die' n+ v) {% o+ r ]' R
else inc A_i by 14 E: C! j4 \" \7 \7 p% e
end
q- R$ D7 I! h& 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,其它按你的 ...
|