|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 P9 K2 u1 ^" K, `7 y
5 O( y, N7 D; }' n# }& C& 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中的数值,不知道会不会有什么不妥。6 J) S; m" |9 Y+ _3 }: h9 q
' o3 \* x" S' A/ D6 m
begin P_read arriving
4 J2 s: R# q5 h& P while 1=1 do begin
# r. _9 Y& n( o read A_tote from "data.txt" with delimiter "\n"# N: N* q) c }/ p
read A_time from "data.txt" with delimiter "\n"0 }1 ?$ J4 R5 d- Z1 P: g6 B
read A_leave from "data.txt" with delimiter "\n"
9 J7 x; |; R# ?5 K0 n read A_picks from "data.txt" with delimiter "\n": N/ P5 V: K2 S1 `8 p. G. i7 u- |
set load type to A_tote
' c- a/ I( J6 ]* ? if A_tote="tote 1" then set A_induct to 1
7 C. ]: j; e/ Z9 r# @ else if A_tote="tote 2" then set A_induct to 2
; ?1 B- ^. u. b! g) X/ K' } else set A_induct to 3
3 s6 K5 g7 { k8 ?, T set A_i to 0
H% ?, X, V9 k3 W% B clone 1 load to P_induction
3 V/ \! [5 \3 ~6 u9 U2 j+ { wait for A_time sec
2 \; v9 z% b* }, r end! R' c# \$ {2 I) a8 k# {% |9 W
end
$ c4 o5 E, w$ y3 ]3 D+ H5 X( f$ P. Z, {7 Z4 c9 \
begin P_induction arriving9 O$ V$ f4 K9 A7 a( U( d# x( A
if A_induct=1 then clone 1 load to P_pick1
. W) E& v6 [3 n+ C1 g0 W' {! ~. N( s else if A_induct=2 then clone 1 load to P_pick2
1 x! k7 B2 Y5 |" k else clone 1 load to P_pick3
# M- P" E0 _' u2 W5 ]end1 x$ s+ I/ H) c+ u6 y
& k2 n3 W' u- D' A X+ nbegin P_pick1 arriving, _- z8 q! V6 q/ o$ }& P4 \
set A_i to 1
' G, {0 c+ \& z \4 Y: Q: |! Y move into Q_induct16 s/ l! V7 b5 `, t9 S
move into pickaisle.induct1
1 _3 W+ X: f4 u% c9 ?8 |# Q: u while A_i<=30 do begin& C$ t% h, X4 s: I9 T i
travel to pickaisle.con(A_i)
z6 ]$ C# W/ g: J( [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 C) {' L/ D" B7 d7 } else wait for 10 sec
: Y% M. G3 {- `+ J- A' [9 z if A_i=A_leave then send to die" Y9 |4 Z% N9 ~5 X/ C
else inc A_i by 1$ W9 [: O" n6 K Q3 d4 H2 z
end7 r, k; {3 {6 C3 F( x1 c) z* u4 p7 H! h0 ^' M
end/ t% P/ p. D3 u# d9 X" X, ]* z
$ b9 F# |2 g( ~6 _& D4 Y0 x3 y$ Obegin P_pick2 arriving, G- r9 A. T2 r, f5 P: ]! S6 u
set A_i to 115 Y8 q9 F8 A& B3 U# s( Z' J8 f' Z7 }6 m
move into Q_induct2
8 w, M0 C$ [6 u# X; p ~0 M move into pickaisle.induct2. q6 ]7 Z# t/ R# g+ a( I
while A_i<=30 do begin
1 f ]7 d6 J+ p) l& u' [ travel to pickaisle.con(A_i)- F" P: w! j6 N, d% \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% X1 r: C$ g( ^; c4 Y; C: j/ U- v else wait for 10 sec
$ B8 [( W) ^# g% i if A_i=A_leave then send to die
+ F6 Y; z0 ]. f: @0 [% y/ C6 W else inc A_i by 15 G7 g _- y' o$ [. a" e
end: X; l( [# P/ J
end- ^0 a3 V" B5 t
* s* t. V- v# F
begin P_pick3 arriving
7 T9 D, t b/ }* `# n9 g: Q set A_i to 21
: w& y1 d5 P( y; F# c/ O move into Q_induct3
' C5 W+ Y# v8 [ L( Z+ K move into pickaisle.induct3+ {& Q" ]2 C8 f) }
while A_i<=30 do begin, Z$ {- F" X4 r- m0 u, X3 y; \
travel to pickaisle.con(A_i)8 ?- P* O, d# ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, F% N8 |# F* Q/ }& R
else wait for 10 sec% M# q3 f; p7 @9 x7 m/ c2 Q
if A_i=A_leave then send to die9 t* B# B0 D9 |( R L) ?7 z- d
else inc A_i by 1
/ T( y3 i$ {# d) c" C1 v4 O# E end
& I5 f; E# K) L% d" V) v7 l& v8 p# mend |
最佳答案
查看完整内容
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,其它按你的 ...
|